any import in file 'models.py' like:
from .common import db, Field
results in 404 NOT FOUND, also if there are no other programm lines in models.py.
How to pass the db-object to models.py
Head of controllers:
from yatl.helpers import A
from py4web import URL, DAL, Session, action, request
from py4web.utils.auth import Auth
from . import settings_private as s # alle App spezifische Konstanten s = settings
from . import mylogger, tools, dbaccess, models
session = Session(secret='EinradBeimRVLank')
db = DAL('sqlite://rvlank.db', folder=s.DB_FOLDER, pool_size=1)
auth = Auth(session, db, URL)
auth.enable()
@action("index")
@action.uses("default/index.html", db, session, auth)
def index():
return dict()
Since 2012 I use web2py for my company website, now I like to switch over to py4web.