project.py
class waffleweb.WafflewebProject(apps, middleware=[])
The WafflewebProject object is where you can access the wsgi app and a test server. It is also a central point for your project.
- Parameters:
apps (
list[str]
) - A list of all your apps. All the apps are strings with the module and the WaffleApp name. Example: ‘testModule.yourApp’ or ‘apps.testModule.yourApp’.middleware (optional) (
list[str]
) - A list of your middleware. All the middleware are strings with the module and middleware class. Example: ‘testModule.Middleware’ or ‘middleware.testModule.Middleware’.
loadApps(apps)
Loads all the apps into a list of dictionaries. The dictionaries have the module of the app and the WaffleApp object: {'module': app module, 'app': WaffleApp}
.
- Parameters:
apps (
list[str]
) - A list of apps. All the apps are strings with the module and the WaffleApp name. Example: ‘testModule.yourApp’ or ‘apps.testModule.yourApp’.
Returns: list
run(host='127.0.0.1', port=8000, debug=False)
Runs a test server. This shouldn’t be used in production as it does not have any security checks.
- Parameters:
host (optional) (
str
) - The host of your website.port (optional) (
int
) - The port of your website.debug (optional) (
bool
) - If your server is in debug mode.
Returns: None
wsgiApplication(environ, startResponse)
A WSGI application. As outlined in PEP 3333.
- Parameters:
Returns: iter()