Skip to content
This repository has been archived by the owner on May 16, 2020. It is now read-only.

Commit

Permalink
Merge pull request #13 from hasgeek/init_app
Browse files Browse the repository at this point in the history
making init_for call implicit. Fixes #12
  • Loading branch information
Bibhas authored May 4, 2017
2 parents 0b5c12a + 2e340b7 commit 66adc11
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 13 deletions.
11 changes: 5 additions & 6 deletions geekup/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 2 additions & 0 deletions instance/settings-sample.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
10 changes: 7 additions & 3 deletions runserver.py
Original file line number Diff line number Diff line change
@@ -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)
3 changes: 1 addition & 2 deletions website.py
Original file line number Diff line number Diff line change
@@ -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
3 changes: 1 addition & 2 deletions website.wsgi
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 66adc11

Please sign in to comment.