from weppy.tools import Auth from weppy.sessions import SessionManager ## init our app app = App(__name__) app.config.static_version = '0.1.0' app.config.static_version_urls = True app.config.url_default_namespace = "main" app.config.auth.hmac_key = "99b2fdd8-3622-4237-9f1b-9ce4445045d9" app.config.auth.registration_verification = False app.config.auth.single_template = True ## language settings app.languages = ['en', 'it'] app.language_default = 'en' app.language_force_on_url = True app.language_write = True ## init database and auth from models.user import User from models.campaign import Campaign from models.donation import Donation from models.cost import Cost ## init auth before passing db models due to dependencies ## on auth tables in the other models db = Database(app, auto_migrate=True) auth = Auth(app, db, user_model=User) # auth.settings.update(download_url='/download') db.define_models(Campaign, Donation, Cost) ## adding sessions and authorization handlers
from weppy import App, DAL from weppy.tools import Auth from weppy.sessions import SessionCookieManager ## init our app app = App(__name__) app.config.static_version = '0.1.0' app.config.static_version_urls = True app.config.url_default_namespace = "main" ## language settings app.languages = ['en', 'it'] app.language_default = 'en' app.language_force_on_url = True app.language_write = True ## init database and auth from models.user import User from models.campaign import Campaign from models.donation import Donation from models.cost import Cost ## init auth before passing db models due to dependencies ## on auth tables in the other models db = DAL(app) auth = Auth(app, db, usermodel=User, mailer=None, base_url="/account") auth.settings.update(download_url='/download') db.define_models([Campaign, Donation, Cost]) ## adding sessions and authorization handlers app.expose.common_handlers = [ SessionCookieManager('verySecretKey'), db.handler, auth.handler
def app(): app = App(__name__) app.languages = ['en', 'it'] app.language_default = 'en' app.language_force_on_url = True return app