diff --git a/geekup/__init__.py b/geekup/__init__.py index e1c6984..84b7d38 100755 --- a/geekup/__init__.py +++ b/geekup/__init__.py @@ -50,9 +50,8 @@ def is_accessible(self): admin.add_view(AuthModelView(models.Venue, models.db.session)) -def init_for(env): - coaster.app.init_app(app, env) - baseframe.init_app(app, requires=['jquery.form', 'baseframe-networkbar', 'geekup']) - lastuser.init_app(app) - lastuser.init_usermanager(UserManager(models.db, models.User)) - mail.init_app(app) +coaster.app.init_app(app) +baseframe.init_app(app, requires=['jquery.form', 'baseframe-networkbar', 'geekup']) +lastuser.init_app(app) +lastuser.init_usermanager(UserManager(models.db, models.User)) +mail.init_app(app) diff --git a/instance/settings-sample.py b/instance/settings-sample.py index af592c5..e512863 100644 --- a/instance/settings-sample.py +++ b/instance/settings-sample.py @@ -1,3 +1,5 @@ +#: Debug mode (put this value in development.py only, never in settings.py) +DEBUG = True #: Google Analytics tracking code GA_CODE = 'UA-XXXXXXX-X' #: Typekit font code, from the embed URL: http://use.typekit.com/(code).js diff --git a/runserver.py b/runserver.py index 7b449d0..02dea8b 100755 --- a/runserver.py +++ b/runserver.py @@ -1,7 +1,11 @@ #!/usr/bin/env python -from geekup import app, init_for +import sys +from geekup import app from geekup.models import db -init_for('dev') db.create_all() -app.run('0.0.0.0', 4000, debug=True) +try: + port = int(sys.argv[1]) +except (IndexError, ValueError): + port = 4000 +app.run('0.0.0.0', port) diff --git a/website.py b/website.py index 6d45f0e..3e85bfb 100644 --- a/website.py +++ b/website.py @@ -1,5 +1,4 @@ import sys import os.path sys.path.insert(0, os.path.dirname(__file__)) -from geekup import app as application, init_for -init_for('production') +from geekup import app as application diff --git a/website.wsgi b/website.wsgi index 6d45f0e..3e85bfb 100644 --- a/website.wsgi +++ b/website.wsgi @@ -1,5 +1,4 @@ import sys import os.path sys.path.insert(0, os.path.dirname(__file__)) -from geekup import app as application, init_for -init_for('production') +from geekup import app as application