From 8fe02156794c2cac0cbc6961332f9d8bebc1cb90 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Mon, 5 Dec 2011 00:12:38 -0500 Subject: the starter scaffold now uses url dispatch; add a minimal section about using another WSGI server; random docs fixes --- docs/narr/MyProject/README.txt | 3 --- docs/narr/MyProject/development.ini | 2 +- docs/narr/MyProject/myproject/__init__.py | 4 ++-- docs/narr/MyProject/myproject/resources.py | 3 --- docs/narr/MyProject/myproject/static/pyramid-small.png | Bin 0 -> 7044 bytes docs/narr/MyProject/myproject/tests.py | 2 -- docs/narr/MyProject/myproject/views.py | 3 +-- docs/narr/MyProject/production.ini | 4 ++-- 8 files changed, 6 insertions(+), 15 deletions(-) delete mode 100644 docs/narr/MyProject/myproject/resources.py create mode 100644 docs/narr/MyProject/myproject/static/pyramid-small.png (limited to 'docs/narr/MyProject') diff --git a/docs/narr/MyProject/README.txt b/docs/narr/MyProject/README.txt index 5e10949fc..c28d0d94a 100644 --- a/docs/narr/MyProject/README.txt +++ b/docs/narr/MyProject/README.txt @@ -1,4 +1 @@ MyProject README - - - diff --git a/docs/narr/MyProject/development.ini b/docs/narr/MyProject/development.ini index 3a4758c44..d61da580f 100644 --- a/docs/narr/MyProject/development.ini +++ b/docs/narr/MyProject/development.ini @@ -41,6 +41,6 @@ level = NOTSET formatter = generic [formatter_generic] -format = %(asctime)s %(levelname)-5.5s [%(name)s] %(message)s +format = %(asctime)s %(levelname)-5.5s [%(name)s][%(threadName)s] %(message)s # End logging configuration diff --git a/docs/narr/MyProject/myproject/__init__.py b/docs/narr/MyProject/myproject/__init__.py index ddcdd7162..31b02cf02 100644 --- a/docs/narr/MyProject/myproject/__init__.py +++ b/docs/narr/MyProject/myproject/__init__.py @@ -1,10 +1,10 @@ from pyramid.config import Configurator -from .resources import Root def main(global_config, **settings): """ This function returns a Pyramid WSGI application. """ - config = Configurator(root_factory=Root, settings=settings) + config = Configurator(settings=settings) config.add_static_view('static', 'static', cache_max_age=3600) + config.add_route('home', '/') config.scan() return config.make_wsgi_app() diff --git a/docs/narr/MyProject/myproject/resources.py b/docs/narr/MyProject/myproject/resources.py deleted file mode 100644 index 3d811895c..000000000 --- a/docs/narr/MyProject/myproject/resources.py +++ /dev/null @@ -1,3 +0,0 @@ -class Root(object): - def __init__(self, request): - self.request = request diff --git a/docs/narr/MyProject/myproject/static/pyramid-small.png b/docs/narr/MyProject/myproject/static/pyramid-small.png new file mode 100644 index 000000000..a5bc0ade7 Binary files /dev/null and b/docs/narr/MyProject/myproject/static/pyramid-small.png differ diff --git a/docs/narr/MyProject/myproject/tests.py b/docs/narr/MyProject/myproject/tests.py index a32165471..d8b764041 100644 --- a/docs/narr/MyProject/myproject/tests.py +++ b/docs/narr/MyProject/myproject/tests.py @@ -14,5 +14,3 @@ class ViewTests(unittest.TestCase): request = testing.DummyRequest() info = my_view(request) self.assertEqual(info['project'], 'MyProject') - - diff --git a/docs/narr/MyProject/myproject/views.py b/docs/narr/MyProject/myproject/views.py index 5b5d230f2..f571a5976 100644 --- a/docs/narr/MyProject/myproject/views.py +++ b/docs/narr/MyProject/myproject/views.py @@ -1,6 +1,5 @@ from pyramid.view import view_config -from .resources import Root -@view_config(context=Root, renderer='templates/mytemplate.pt') +@view_config(route_name='home', renderer='templates/mytemplate.pt') def my_view(request): return {'project':'MyProject'} diff --git a/docs/narr/MyProject/production.ini b/docs/narr/MyProject/production.ini index 9d025715d..97050e8fe 100644 --- a/docs/narr/MyProject/production.ini +++ b/docs/narr/MyProject/production.ini @@ -25,11 +25,11 @@ keys = console keys = generic [logger_root] -level = INFO +level = WARN handlers = console [logger_myproject] -level = INFO +level = WARN handlers = qualname = myproject -- cgit v1.2.3