Skip to content
Snippets Groups Projects
Commit 38b281c5 authored by Xingchen Zhou's avatar Xingchen Zhou
Browse files

Initial commit

parents
No related branches found
No related tags found
No related merge requests found
from flask_admin.contrib.sqla import ModelView
import flask_login as login
from blog.models import User
class AdminView(ModelView):
def is_accessible(self):
if login.current_user.is_authenticated:
if login.current_user.get_id():
user = User.query.get(login.current_user.get_id())
return user.is_admin
return False
import os
workers = int(os.environ.get('GUNICORN_PROCESSES', '3'))
threads = int(os.environ.get('GUNICORN_THREADS', '1'))
forwarded_allow_ips = '*'
secure_scheme_headers = { 'X-Forwarded-Proto': 'https' }
\ No newline at end of file
alembic==1.5.3
click==7.1.2
dnspython==2.1.0
email-validator==1.1.2
Flask==1.1.2
Flask-Admin==1.5.7
Flask-Login==0.5.0
Flask-Migrate==2.6.0
Flask-MySQL==1.5.2
Flask-SQLAlchemy==2.4.4
Flask-WTF==0.14.3
gunicorn==20.0.4
idna==3.1
itsdangerous==1.1.0
Jinja2==2.11.3
Mako==1.1.4
MarkupSafe==1.1.1
PyMySQL==1.0.2
python-dateutil==2.8.1
python-editor==1.0.4
six==1.15.0
SQLAlchemy==1.3.23
Werkzeug==1.0.1
WTForms==2.3.3
from blog import app as application
if __name__ == '__main__':
app.run(debug=True)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment