Skip to content

Commit

Permalink
Make init_for call implicit
Browse files Browse the repository at this point in the history
Fixes #154
  • Loading branch information
vidya-ram committed May 4, 2017
1 parent e18ea62 commit e365e71
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 17 deletions.
18 changes: 9 additions & 9 deletions hgtv/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@
from .models import db


def init_for(env):
coaster.app.init_app(app, env)
baseframe.init_app(app, requires=['baseframe', 'toastr', 'swfobject', 'select2', 'froogaloop', 'hgtv'],
bundle_js=Bundle(assets.require('presentz.js'), filters='jsmin', output='js/presentz.min.js'))
models.commentease.init_app(app)
lastuser.init_app(app)
lastuser.init_usermanager(UserManager(db, models.User))
app.config['tz'] = timezone(app.config['TIMEZONE'])
uploads.configure(app)
# Configure the app
coaster.app.init_app(app)
baseframe.init_app(app, requires=['baseframe', 'toastr', 'swfobject', 'select2', 'froogaloop', 'hgtv'],
bundle_js=Bundle(assets.require('presentz.js'), filters='jsmin', output='js/presentz.min.js'))
models.commentease.init_app(app)
lastuser.init_app(app)
lastuser.init_usermanager(UserManager(db, models.User))
app.config['tz'] = timezone(app.config['TIMEZONE'])
uploads.configure(app)
4 changes: 2 additions & 2 deletions manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

from coaster.manage import init_manager

from hgtv import app, init_for
from hgtv import app
from hgtv.models import db


if __name__ == "__main__":
manager = init_manager(app, db, init_for)
manager = init_manager(app, db)
manager.run()
3 changes: 1 addition & 2 deletions runserver.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/env python

from hgtv import app, init_for
init_for('development')
from hgtv import app
app.run('0.0.0.0', debug=True, port=8000)
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 hgtv import app as application, init_for
init_for('production')
from hgtv 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 hgtv import app as application, init_for
init_for('production')
from hgtv import app as application

0 comments on commit e365e71

Please sign in to comment.