From a3ceb6cea0bad0ecd526a8033d7baf8465de9872 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Wed, 10 Nov 2010 14:29:46 -0500 Subject: fix project chapter to deal with paster template changes --- docs/narr/MyProject/development.ini | 12 ++- docs/narr/MyProject/myproject/__init__.py | 7 +- docs/narr/MyProject/myproject/static/pylons.css | 7 +- .../MyProject/myproject/templates/mytemplate.pt | 104 +++++++++++---------- docs/narr/MyProject/setup.py | 9 +- 5 files changed, 76 insertions(+), 63 deletions(-) (limited to 'docs/narr/MyProject') diff --git a/docs/narr/MyProject/development.ini b/docs/narr/MyProject/development.ini index 6741af913..9c51cfe6e 100644 --- a/docs/narr/MyProject/development.ini +++ b/docs/narr/MyProject/development.ini @@ -1,14 +1,16 @@ -[DEFAULT] -debug = true - -[app:main] -use = egg:MyProject#app +[app:MyProject] +use = egg:MyProject reload_templates = true debug_authorization = false debug_notfound = false debug_templates = true default_locale_name = en +[pipeline:main] +pipeline = + egg:WebError#evalerror + MyProject + [server:main] use = egg:Paste#http host = 0.0.0.0 diff --git a/docs/narr/MyProject/myproject/__init__.py b/docs/narr/MyProject/myproject/__init__.py index ac6ece3c1..bfbbfd4df 100644 --- a/docs/narr/MyProject/myproject/__init__.py +++ b/docs/narr/MyProject/myproject/__init__.py @@ -1,11 +1,8 @@ from pyramid.configuration import Configurator from myproject.models import get_root -def app(global_config, **settings): - """ This function returns a WSGI application. - - It is usually called by the PasteDeploy framework during - ``paster serve``. +def main(global_config, **settings): + """ This function returns a Pyramid WSGI application. """ config = Configurator(root_factory=get_root, settings=settings) config.begin() diff --git a/docs/narr/MyProject/myproject/static/pylons.css b/docs/narr/MyProject/myproject/static/pylons.css index a9c5c55c2..c153be07f 100644 --- a/docs/narr/MyProject/myproject/static/pylons.css +++ b/docs/narr/MyProject/myproject/static/pylons.css @@ -43,14 +43,15 @@ body h3, body h4, body h5, body h6{font-family:"Nobile","Lucida Grande",Lucida,Verdana,sans-serif;font-weight:normal;color:#144fb2;font-style:normal;} +#wrap {min-height: 100%;} #header,#footer{width:100%;color:#ffffff;height:40px;position:absolute;text-align:center;line-height:40px;overflow:hidden;font-size:12px;} #header{background-color:#e88f00;top:0;font-size:14px;} -#footer{background-color:#000000;bottom:0;} +#footer{background-color:#000000;bottom:0;position: relative;margin-top:-40px;clear:both;} .header,.footer{width:700px;margin-right:auto;margin-left:auto;} .wrapper{width:100%} #top,#bottom{width:100%;} #top{color:#888;background-color:#eee;height:300px;border-bottom:2px solid #ddd;} -#bottom{color:#222;background-color:#ffffff;} +#bottom{color:#222;background-color:#ffffff;overflow:hidden;padding-bottom:80px;} .top,.bottom{width:700px;margin-right:auto;margin-left:auto;} .top{padding-top:100px;} .app-welcome{margin-top:25px;} @@ -68,3 +69,5 @@ fieldset{border-style:none;} input{color:#222;border:1px solid #ccc;font-family:sans-serif;font-size:12px;line-height:16px;} input[type=text]{} input[type=submit]{background-color:#ddd;font-weight:bold;} +/*Opera Fix*/ +body:before {content:"";height:100%;float:left;width:0;margin-top:-32767px;} diff --git a/docs/narr/MyProject/myproject/templates/mytemplate.pt b/docs/narr/MyProject/myproject/templates/mytemplate.pt index a5a0dd214..6ad23d44f 100644 --- a/docs/narr/MyProject/myproject/templates/mytemplate.pt +++ b/docs/narr/MyProject/myproject/templates/mytemplate.pt @@ -8,57 +8,67 @@ + - -
-
- -

- Welcome to ${project}, an application generated by
- the Pyramid web application development framework. -

+
+ -
-
-
-
-

Search Pyramid documentation

-
- - -
+
+
+ +

+ Welcome to ${project}, an application generated by
+ the Pyramid web application development framework. +

- +
+
+
+

Search Pyramid documentation

+
+ + +
+
+
diff --git a/docs/narr/MyProject/setup.py b/docs/narr/MyProject/setup.py index 31f6c9d37..a64d65ba6 100644 --- a/docs/narr/MyProject/setup.py +++ b/docs/narr/MyProject/setup.py @@ -6,7 +6,7 @@ here = os.path.abspath(os.path.dirname(__file__)) README = open(os.path.join(here, 'README.txt')).read() CHANGES = open(os.path.join(here, 'CHANGES.txt')).read() -requires = ['pyramid'] +requires = ['pyramid', 'WebError'] setup(name='MyProject', version='0.0', @@ -21,7 +21,7 @@ setup(name='MyProject', author='', author_email='', url='', - keywords='web wsgi bfg pyramid pylons', + keywords='web pyramid pylons', packages=find_packages(), include_package_data=True, zip_safe=False, @@ -30,7 +30,8 @@ setup(name='MyProject', test_suite="myproject", entry_points = """\ [paste.app_factory] - app = myproject:app - """ + main = myproject:main + """, + paster_plugins=['pyramid'], ) -- cgit v1.2.3