diff --git a/funnel/__init__.py b/funnel/__init__.py index aa4fd53b6..5d2a70251 100644 --- a/funnel/__init__.py +++ b/funnel/__init__.py @@ -36,26 +36,25 @@ # --- Configuration------------------------------------------------------------ -def init_for(env): - coaster.app.init_app(app, env) - db.init_app(app) - db.app = app - - mail.init_app(app) - lastuser.init_app(app) - lastuser.init_usermanager(UserManager(db, models.User, models.Team)) - baseframe.init_app(app, requires=['funnel'], ext_requires=[ - ('codemirror-markdown', 'pygments'), 'toastr', 'baseframe-bs3', 'fontawesome>=4.0.0', - 'baseframe-footable']) - app.assets.register('js_fullcalendar', - Bundle(assets.require('!jquery.js', 'jquery.fullcalendar.js', 'spectrum.js'), - output='js/fullcalendar.packed.js', filters='uglipyjs')) - app.assets.register('css_fullcalendar', - Bundle(assets.require('jquery.fullcalendar.css', 'spectrum.css', 'schedules.css'), - output='css/fullcalendar.packed.css', filters='cssmin')) - app.assets.register('js_schedules', - Bundle(assets.require('schedules.js'), - output='js/schedules.packed.js', filters='uglipyjs')) - app.assets.register('css_screens', - Bundle(assets.require('screens.css'), - output='css/screens.packed.css', filters='cssmin')) +coaster.app.init_app(app) +db.init_app(app) +db.app = app + +mail.init_app(app) +lastuser.init_app(app) +lastuser.init_usermanager(UserManager(db, models.User, models.Team)) +baseframe.init_app(app, requires=['funnel'], ext_requires=[ + ('codemirror-markdown', 'pygments'), 'toastr', 'baseframe-bs3', 'fontawesome>=4.0.0', + 'baseframe-footable']) +app.assets.register('js_fullcalendar', + Bundle(assets.require('!jquery.js', 'jquery.fullcalendar.js', 'spectrum.js'), + output='js/fullcalendar.packed.js', filters='uglipyjs')) +app.assets.register('css_fullcalendar', + Bundle(assets.require('jquery.fullcalendar.css', 'spectrum.css', 'schedules.css'), + output='css/fullcalendar.packed.css', filters='cssmin')) +app.assets.register('js_schedules', + Bundle(assets.require('schedules.js'), + output='js/schedules.packed.js', filters='uglipyjs')) +app.assets.register('css_screens', + Bundle(assets.require('screens.css'), + output='css/screens.packed.css', filters='cssmin')) diff --git a/instance/settings-sample.py b/instance/settings-sample.py index a045977a9..329896df2 100644 --- a/instance/settings-sample.py +++ b/instance/settings-sample.py @@ -46,3 +46,4 @@ WELCOME_MESSAGE = "The funnel is a space for proposals and voting on events. Pick an event to get started." HASCORE_SERVER = 'https://api.hasgeek.com/' CACHE_TYPE = 'redis' +DEBUG = True diff --git a/manage.py b/manage.py index ad822476c..feb087e09 100755 --- a/manage.py +++ b/manage.py @@ -2,9 +2,9 @@ from coaster.manage import init_manager -from funnel import app, models, init_for +from funnel import app, models if __name__ == "__main__": - manager = init_manager(app, models.db, init_for) + manager = init_manager(app, models.db) manager.run() diff --git a/requirements.txt b/requirements.txt index 694d5ac5c..80404ef13 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,9 +9,7 @@ icalendar git+https://github.com/hasgeek/coaster.git git+https://github.com/hasgeek/flask-lastuser.git git+https://github.com/hasgeek/baseframe.git -Flask-Script==0.5.3 alembic -git+https://github.com/tobiasandtobias/flask-alembic.git qrcode rq psycopg2 diff --git a/rq.sh b/rq.sh index 7ce56ee16..fe606ca71 100644 --- a/rq.sh +++ b/rq.sh @@ -1,3 +1,3 @@ #!/bin/bash -rqworker -c rqdev funnel +rqworker -c rqinit funnel diff --git a/rqdev.py b/rqdev.py deleted file mode 100644 index 175362d24..000000000 --- a/rqdev.py +++ /dev/null @@ -1,16 +0,0 @@ -from urlparse import urlparse - -from funnel import init_for, app - -init_for('dev') - -REDIS_URL = app.config.get('REDIS_URL', 'redis://localhost:6379/0') - -# REDIS_URL is not taken by setup_default_arguments function of rq/scripts/__init__.py -# so, parse it into pieces and give it - -r = urlparse(REDIS_URL) -REDIS_HOST = r.hostname -REDIS_PORT = r.port -REDIS_PASSWORD = r.password -REDIS_DB = 0 diff --git a/rqinit.py b/rqinit.py index 8a137cbe8..3dbdd9e15 100644 --- a/rqinit.py +++ b/rqinit.py @@ -1,8 +1,7 @@ from urlparse import urlparse -from funnel import init_for, app +from funnel import app -init_for('production') REDIS_URL = app.config.get('REDIS_URL', 'redis://localhost:6379/0') # REDIS_URL is not taken by setup_default_arguments function of rq/scripts/__init__.py diff --git a/runserver.py b/runserver.py index b61bb0e51..085c188de 100755 --- a/runserver.py +++ b/runserver.py @@ -1,8 +1,7 @@ #! /usr/bin/env python import sys -from funnel import app, init_for -init_for('dev') +from funnel import app try: port = int(sys.argv[1]) diff --git a/website.py b/website.py index dc24d4bfd..5784f11ef 100755 --- a/website.py +++ b/website.py @@ -1,5 +1,4 @@ import sys import os.path sys.path.insert(0, os.path.dirname(__file__)) -from funnel import app as application, init_for -init_for('production') +from funnel import app as application