diff options
| author | Chris McDonough <chrism@agendaless.com> | 2008-08-18 04:06:35 +0000 |
|---|---|---|
| committer | Chris McDonough <chrism@agendaless.com> | 2008-08-18 04:06:35 +0000 |
| commit | e35dc1a58a4e91977dc9819c80259f09800a0b58 (patch) | |
| tree | e90fea96be6f491becd5399f177057f1feeadf68 /repoze/bfg/paster_template | |
| parent | 0235914a7c520e20dafcfc251237deddedaf3d80 (diff) | |
| download | pyramid-e35dc1a58a4e91977dc9819c80259f09800a0b58.tar.gz pyramid-e35dc1a58a4e91977dc9819c80259f09800a0b58.tar.bz2 pyramid-e35dc1a58a4e91977dc9819c80259f09800a0b58.zip | |
- Generated application differences: ``make_app`` entry point
renamed to ``app`` in order to have a different name than the bfg
function of the same name, to prevent confusion.
- Add "options" processing to bfg's ``make_app`` to support runtime
options. A new API function named ``get_options`` was added to
the registry module. This function is typically used in an
application's ``app`` entry point. The Paste config file section
for the app can now supply the ``reload_templates`` option, which,
if true, will prevent the need to restart the appserver in order
for ``z3c.pt`` or XSLT template changes to be detected.
- Use only the module name in generated project's "test_suite" (run
all tests found in the package).
- Default port for generated apps changed from 5432 to 6543
(Postgres default port is 6543).
Diffstat (limited to 'repoze/bfg/paster_template')
| -rw-r--r-- | repoze/bfg/paster_template/+package+.ini_tmpl | 5 | ||||
| -rw-r--r-- | repoze/bfg/paster_template/+package+/run.py_tmpl | 12 | ||||
| -rw-r--r-- | repoze/bfg/paster_template/setup.py_tmpl | 4 |
3 files changed, 11 insertions, 10 deletions
diff --git a/repoze/bfg/paster_template/+package+.ini_tmpl b/repoze/bfg/paster_template/+package+.ini_tmpl index 9bb03718c..2d6c4d0a2 100644 --- a/repoze/bfg/paster_template/+package+.ini_tmpl +++ b/repoze/bfg/paster_template/+package+.ini_tmpl @@ -2,10 +2,11 @@ debug = true [app:main] -use = egg:{{project}}#make_app +use = egg:{{project}}#app +reload_templates = true [server:main] use = egg:PasteScript#cherrypy host = 0.0.0.0 -port = 5432 +port = 6543 numthreads = 4 diff --git a/repoze/bfg/paster_template/+package+/run.py_tmpl b/repoze/bfg/paster_template/+package+/run.py_tmpl index f8228d30a..b3c3d1ed7 100644 --- a/repoze/bfg/paster_template/+package+/run.py_tmpl +++ b/repoze/bfg/paster_template/+package+/run.py_tmpl @@ -1,13 +1,13 @@ -def make_app(global_config, **kw): +from repoze.bfg import make_app +from repoze.bfg import get_options + +def app(global_config, **kw): # paster app config callback - from repoze.bfg import make_app from {{project}}.models import get_root import {{ project}} - app = make_app(get_root, {{project}}) - return app + return make_app(get_root, {{project}}, options=get_options(kw)) if __name__ == '__main__': from paste import httpserver - app = make_app(None) - httpserver.serve(app, host='0.0.0.0', port='5432') + httpserver.serve(app(None), host='0.0.0.0', port='6543') diff --git a/repoze/bfg/paster_template/setup.py_tmpl b/repoze/bfg/paster_template/setup.py_tmpl index 278153de8..d2b4d575b 100644 --- a/repoze/bfg/paster_template/setup.py_tmpl +++ b/repoze/bfg/paster_template/setup.py_tmpl @@ -35,10 +35,10 @@ setup(name='{{project}}', tests_require=[ 'repoze.bfg', ], - test_suite="{{project}}.tests", + test_suite="{{project}}", entry_points = """\ [paste.app_factory] - make_app = {{project}}.run:make_app + app = {{project}}.run:app """ ) |
