Skip to content

Commit

Permalink
Merge pull request #6 from weareasterisk/perf_admin-page-improvements
Browse files Browse the repository at this point in the history
Admin page improvements
  • Loading branch information
mkhatri1 authored Feb 24, 2020
2 parents be454f5 + 50aa2bd commit e0e9725
Show file tree
Hide file tree
Showing 36 changed files with 1,593 additions and 4,172 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,7 @@ venv/

.env*
!.env.example

.vscode/

celerybeat-schedule
83 changes: 43 additions & 40 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,47 +6,50 @@ verify_ssl = true
[dev-packages]

[packages]
amqp = "*"
appdirs = "*"
billiard = "*"
celery = "*"
certifi = "*"
chardet = "*"
click = "*"
gunicorn = "*"
humanize = "*"
idna = "*"
itsdangerous = "*"
kombu = "*"
numpy = "*"
amqp = "==2.5.2"
appdirs = "==1.4.3"
billiard = "==3.6.1.0"
celery = "==4.4.0"
certifi = "==2019.11.28"
chardet = "==3.0.4"
click = "==7.0"
gunicorn = "==20.0.4"
humanize = "==0.5.1"
idna = "==2.8"
itsdangerous = "==1.1.0"
kombu = "==4.6.7"
numpy = "==1.18.0"
psycopg2 = "==2.7.6.1"
pyparsing = "*"
pytz = "*"
redis = "*"
requests = "*"
scipy = "*"
six = "*"
urllib3 = "*"
vine = "*"
webassets = "*"
xlrd = "*"
Flask = "*"
Flask-Assets = "*"
Flask-SQLAlchemy = "*"
Jinja2 = "*"
Markdown = "*"
MarkupSafe = "*"
pyScss = "*"
PyYAML = "*"
SQLAlchemy = "*"
Werkzeug = "*"
python-dotenv = "*"
flask-marshmallow = "*"
marshmallow-sqlalchemy = "*"
flask-compress = "*"
flask-minify = "*"
jsmin = "*"
cssmin = "*"
pyparsing = "==2.4.5"
pytz = "==2019.3"
redis = "==3.3.11"
requests = "==2.22.0"
scipy = "==1.4.1"
six = "==1.13.0"
urllib3 = "==1.25.7"
vine = "==1.3.0"
webassets = "==2.0"
xlrd = "==1.2.0"
Flask = "==1.1.1"
Flask-Assets = "==2.0"
Flask-SQLAlchemy = "==2.4.1"
Jinja2 = "==2.10.3"
Markdown = "==3.1.1"
MarkupSafe = "==1.1.1"
pyScss = "==1.3.5"
PyYAML = "==5.2"
SQLAlchemy = "==1.3.12"
Werkzeug = "==0.16.0"
python-dotenv = "==0.10.3"
flask-marshmallow = "==0.10.1"
marshmallow-sqlalchemy = "==0.21.0"
flask-compress = "==1.4.0"
flask-minify = "==0.15"
jsmin = "==2.2.2"
cssmin = "==0.2.0"
flask-socketio = "==4.2.1"
eventlet = "==0.25.1"
psycopg2-binary = "*"

[requires]
python_version = "3.6"
182 changes: 143 additions & 39 deletions Pipfile.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions Procfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
worker: PYTHONUNBUFFERED=true celery -A gavel:celery worker -B -E --loglevel=info
web: python initialize.py && gunicorn gavel:app
worker: PYTHONUNBUFFERED=true celery -A gavel:celery worker -E -P eventlet --loglevel=info
web: python initialize.py && gunicorn -k eventlet gavel:app
13 changes: 10 additions & 3 deletions gavel/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
from flask import Flask
from flask_compress import Compress
from flask_minify import minify
from flask_socketio import SocketIO
import eventlet
eventlet.monkey_patch(os=True, select=True, socket=True, thread=True, time=True, psycopg=True)

COMPRESS_MIMETYPES = [
'text/html',
Expand Down Expand Up @@ -57,9 +60,8 @@ def start_app():
output='all.css'
),
'admin_js': Bundle(
'js/admin/jquery.tablesorter.min.js',
'js/admin/jquery.tablesorter.widgets.js',
'js/admin/admin_live.js',
'js/admin/admin_service.js',
depends='**/*.js',
filters=('jsmin',),
output='admin_all.js'
Expand All @@ -81,6 +83,11 @@ def start_app():
ma.app = app
ma.init_app(app)

SOCKETIO_REDIS_URL = settings.BROKER_URI
async_mode="eventlet"

socketio = SocketIO(app, async_mode=async_mode, message_queue=SOCKETIO_REDIS_URL, async_handlers=True)

import gavel.template_filters # registers template filters

import gavel.controllers # registers controllers
Expand All @@ -93,4 +100,4 @@ def start_app():
'min-views': settings.MIN_VIEWS,
'timeout': settings.TIMEOUT,
'disable-email': settings.DISABLE_EMAIL
})
})
1 change: 1 addition & 0 deletions gavel/controllers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
import gavel.controllers.api
import gavel.controllers.judge
import gavel.controllers.error
import gavel.controllers.socket
Loading

0 comments on commit e0e9725

Please sign in to comment.