Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
modern flask usage
  • Loading branch information
ProgrammingLanguageLeader committed Feb 25, 2019
commit 92125ab4f615196fd73794141edd0fa815b592bc
2 changes: 2 additions & 0 deletions .flaskenv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
FLASK_APP=system
FLASK_ENV=development
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
__pycache__/
.idea/
venv/
app.db
environ.sh
db.sqlite3
.env
17 changes: 0 additions & 17 deletions config.py

This file was deleted.

14 changes: 0 additions & 14 deletions manage.py

This file was deleted.

47 changes: 23 additions & 24 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,29 +1,28 @@
alembic==0.9.8
certifi==2017.11.5
alembic==1.0.7
asn1crypto==0.24.0
certifi==2018.11.29
cffi==1.12.1
chardet==3.0.4
click==6.7
Flask==0.12.2
Flask-Migrate==2.1.1
Flask-Script==2.0.6
Click==7.0
cryptography==2.5
Flask==1.0.2
Flask-Migrate==2.4.0
Flask-SQLAlchemy==2.3.2
future==0.16.0
idna==2.6
inflect==0.2.5
itsdangerous==0.24
jaraco.itertools==2.1
future==0.17.1
idna==2.8
itsdangerous==1.1.0
Jinja2==2.10
Mako==1.0.7
MarkupSafe==1.0
more-itertools==4.0.1
nginxparser-eb==0.0.9
psycopg2==2.7.4
pyparsing==2.2.0
python-dateutil==2.6.1
python-editor==1.0.3
python-telegram-bot==10.0.1
requests==2.18.4
six==1.11.0
SQLAlchemy==1.2.4
urllib3==1.22
MarkupSafe==1.1.1
psycopg2==2.7.7
pycparser==2.19
python-dateutil==2.8.0
python-dotenv==0.10.1
python-editor==1.0.4
python-telegram-bot==11.1.0
requests==2.21.0
six==1.12.0
SQLAlchemy==1.2.18
urllib3==1.24.1
Werkzeug==0.14.1
xmltodict==0.11.0
xmltodict==0.12.0
8 changes: 8 additions & 0 deletions system/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from flask import Flask

from system.routes import routes_blueprint


app = Flask(__name__)
app.config.from_object('system.config')
app.register_blueprint(routes_blueprint)
15 changes: 15 additions & 0 deletions system/config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import os
import dotenv


BASE_DIR = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
dotenv.load_dotenv(BASE_DIR)

HOST_URL = os.getenv('HOST_URL')

TELEGRAM_TOKEN = os.getenv('TELEGRAM_TOKEN')
WOLFRAM_APP_ID = os.getenv('WOLFRAM_APP_ID')

SQLALCHEMY_DATABASE_URI = os.getenv('DATABASE_URL') or \
'sqlite:///%s' % os.path.join(BASE_DIR, 'db.sqlite3')
SQLALCHEMY_TRACK_MODIFICATIONS = False
9 changes: 9 additions & 0 deletions system/routes.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from flask import Blueprint, current_app


routes_blueprint = Blueprint('system_routes', __name__)


@routes_blueprint.route('/')
def index():
return 'It works'