Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
pyramid.pdf
Скачиваний:
10
Добавлен:
24.03.2015
Размер:
3.82 Mб
Скачать

5. CREATING A PYRAMID PROJECT

The debug toolbar will not be shown (and all debugging will be turned off) when you use the production.ini file instead of the development.ini ini file to run the application.

You can also turn the debug toolbar off by editing development.ini and commenting out a line. For example, instead of:

[app:main]

...

pyramid.includes = pyramid_debugtoolbar

Put a hash mark at the beginning of the pyramid_debugtoolbar line:

[app:main]

...

pyramid.includes =

#pyramid_debugtoolbar

Then restart the application to see that the toolbar has been turned off.

Note that if you comment out the pyramid_debugtoolbar line, the # must be in the first column. If you put the hash mark anywhere except the first column instead, for example like this:

[app:main]

...

pyramid.includes = #pyramid_debugtoolbar

When you attempt to restart the application with a section like the abvoe you’ll receive an error that ends something like this, and the application will not start:

ImportError: No module named #pyramid_debugtoolbar

5.7 The Project Structure

The starter scaffold generated a project (named MyProject), which contains a Python package. The package is also named myproject, but it’s lowercased; the scaffold generates a project which contains a package that shares its name except for case.

All Pyramid pcreate -generated projects share a similar structure. The MyProject project we’ve generated has the following directory structure:

46

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]