Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed: Lots of unused imports! #8 #12

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions angular_flask/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import os
import json
from flask import Flask, request, Response
from flask import render_template, send_from_directory, url_for
from flask import Flask

app = Flask(__name__)

Expand Down
7 changes: 3 additions & 4 deletions angular_flask/controllers.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import os

from flask import Flask, request, Response
from flask import render_template, url_for, redirect, send_from_directory
from flask import send_file, make_response, abort
from flask import render_template, send_from_directory
from flask import make_response, abort

from angular_flask import app

Expand Down Expand Up @@ -38,7 +37,7 @@ def rest_pages(model_name, item_id=None):
if model_name in crud_url_models:
model_class = crud_url_models[model_name]
if item_id is None or session.query(exists().where(
model_class.id == item_id)).scalar():
model_class.id == item_id)).scalar():
return make_response(open(
'angular_flask/templates/index.html').read())
abort(404)
Expand Down
1 change: 1 addition & 0 deletions angular_flask/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ def __init__(self, title, body, pub_date=None):
def __repr__(self):
return '<Post %r>' % self.title


# models for which we want to create API endpoints
app.config['API_MODELS'] = {'post': Post}

Expand Down
1 change: 0 additions & 1 deletion angular_flask/settings.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

DEBUG = True
SECRET_KEY = 'temporary_secret_key' # make sure to change this

Expand Down
3 changes: 1 addition & 2 deletions manage.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import os
import json
import argparse
import requests

from angular_flask.core import db
from angular_flask.models import Post


def create_sample_db_entry(api_endpoint, payload):
Expand Down Expand Up @@ -55,5 +53,6 @@ def main():
else:
raise Exception('Invalid command')


if __name__ == '__main__':
main()
3 changes: 2 additions & 1 deletion runserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@

def runserver():
port = int(os.environ.get('PORT', 5000))
app.run(host='0.0.0.0', port=port)
app.run(host='127.0.0.1', port=port)


if __name__ == '__main__':
runserver()