summaryrefslogtreecommitdiff
path: root/docs/narr
diff options
context:
space:
mode:
authorChris McDonough <chrism@plope.com>2010-11-04 21:13:54 -0400
committerChris McDonough <chrism@plope.com>2010-11-04 21:13:54 -0400
commitfb30035ec15d56ac93362160e08f0ffbbfdd1212 (patch)
tree520aee3a005ba7c696bcadeea8139a452aa3c1a5 /docs/narr
parenta2ec85f74c0cdbfd787d8fc452bd095b18b4f6b3 (diff)
downloadpyramid-fb30035ec15d56ac93362160e08f0ffbbfdd1212.tar.gz
pyramid-fb30035ec15d56ac93362160e08f0ffbbfdd1212.tar.bz2
pyramid-fb30035ec15d56ac93362160e08f0ffbbfdd1212.zip
- Move static dir from pkg/templates/ to /pkg/ in pyramid_* paster templates.
Diffstat (limited to 'docs/narr')
-rw-r--r--docs/narr/MyProject/myproject/__init__.py2
-rw-r--r--docs/narr/MyProject/myproject/static/favicon.ico (renamed from docs/narr/MyProject/myproject/templates/static/favicon.ico)bin1406 -> 1406 bytes
-rw-r--r--docs/narr/MyProject/myproject/static/logo.png (renamed from docs/narr/MyProject/myproject/templates/static/logo.png)bin6641 -> 6641 bytes
-rw-r--r--docs/narr/MyProject/myproject/static/pylons.css (renamed from docs/narr/MyProject/myproject/templates/static/pylons.css)0
-rw-r--r--docs/narr/project.rst51
5 files changed, 26 insertions, 27 deletions
diff --git a/docs/narr/MyProject/myproject/__init__.py b/docs/narr/MyProject/myproject/__init__.py
index 2dbaf0a88..ac6ece3c1 100644
--- a/docs/narr/MyProject/myproject/__init__.py
+++ b/docs/narr/MyProject/myproject/__init__.py
@@ -12,7 +12,7 @@ def app(global_config, **settings):
config.add_view('myproject.views.my_view',
context='myproject.models.MyModel',
renderer='myproject:templates/mytemplate.pt')
- config.add_static_view('static', 'myproject:templates/static')
+ config.add_static_view('static', 'myproject:static')
config.end()
return config.make_wsgi_app()
diff --git a/docs/narr/MyProject/myproject/templates/static/favicon.ico b/docs/narr/MyProject/myproject/static/favicon.ico
index 71f837c9e..71f837c9e 100644
--- a/docs/narr/MyProject/myproject/templates/static/favicon.ico
+++ b/docs/narr/MyProject/myproject/static/favicon.ico
Binary files differ
diff --git a/docs/narr/MyProject/myproject/templates/static/logo.png b/docs/narr/MyProject/myproject/static/logo.png
index 88f5d9865..88f5d9865 100644
--- a/docs/narr/MyProject/myproject/templates/static/logo.png
+++ b/docs/narr/MyProject/myproject/static/logo.png
Binary files differ
diff --git a/docs/narr/MyProject/myproject/templates/static/pylons.css b/docs/narr/MyProject/myproject/static/pylons.css
index a9c5c55c2..a9c5c55c2 100644
--- a/docs/narr/MyProject/myproject/templates/static/pylons.css
+++ b/docs/narr/MyProject/myproject/static/pylons.css
diff --git a/docs/narr/project.rst b/docs/narr/project.rst
index 25e607174..15b9bfde5 100644
--- a/docs/narr/project.rst
+++ b/docs/narr/project.rst
@@ -437,18 +437,18 @@ share a similar structure.
The ``MyProject`` project we've generated has the following directory
structure::
- MyProject
+ MyProject/
|-- CHANGES.txt
|-- development.ini
|-- myproject
| |-- __init__.py
| |-- models.py
+ | |-- static
+ | | |-- favicon.ico
+ | | |-- logo.png
+ | | `-- pylons.css
| |-- templates
- | | |-- mytemplate.pt
- | | `-- static
- | | |-- favicon.ico
- | | |-- logo.png
- | | `-- pylons.css
+ | | `-- mytemplate.pt
| |-- tests.py
| `-- views.py
|-- README.txt
@@ -668,15 +668,14 @@ tarball to other people who want to use your application.
.. warning::
- By default, ``setup.py sdist`` does not place non-Python-source
- files in generated tarballs. This means, in this case, that the
- ``templates/mytemplate.pt`` file and the files in the
- ``templates/static`` directory are not packaged in the tarball. To
- allow this to happen, check all the files that you'd like to be
- distributed along with your application's Python files into a
- version control system such as Subversion. After you do this, when
- you rerun ``setup.py sdist``, all files checked into the version
- control system will be included in the tarball.
+ By default, ``setup.py sdist`` does not place non-Python-source files in
+ generated tarballs. This means, in this case, that the
+ ``templates/mytemplate.pt`` file and the files in the ``static`` directory
+ are not packaged in the tarball. To allow this to happen, check all the
+ files that you'd like to be distributed along with your application's
+ Python files into a version control system such as Subversion. After you
+ do this, when you rerun ``setup.py sdist``, all files checked into the
+ version control system will be included in the tarball.
``setup.cfg``
~~~~~~~~~~~~~
@@ -764,8 +763,8 @@ also informs Python that the directory which contains it is a *package*.
it actually points to is a :term:`Chameleon` ZPT template file.
Line 15 registers a static view, which will serve up the files from the
- ``mypackage:templates/static`` :term:`resource specification` (the
- ``templates/static`` directory of the ``mypackage`` package).
+ ``mypackage:static`` :term:`resource specification` (the ``static``
+ directory of the ``mypackage`` package).
Line 17 returns a :term:`WSGI` application to the caller of the function
(Paste).
@@ -844,6 +843,15 @@ make any assumption about which sort of datastore you'll want to use,
so the sample application uses an instance of
:class:`myproject.models.MyModel` to represent the root.
+``static``
+~~~~~~~~~~~~~~~~~~~~
+
+This directory contains static resources which support the
+``mytemplate.pt`` template. It includes CSS and images.
+
+.. index::
+ single: tests.py
+
``templates/mytemplate.pt``
~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -857,15 +865,6 @@ Templates are accessed and used by view configurations and sometimes
by view functions themselves. See :ref:`templates_used_directly` and
:ref:`templates_used_as_renderers`.
-``templates/static``
-~~~~~~~~~~~~~~~~~~~~
-
-This directory contains static resources which support the
-``mytemplate.pt`` template. It includes CSS and images.
-
-.. index::
- single: tests.py
-
``tests.py``
~~~~~~~~~~~~