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

36. ZODB + TRAVERSAL WIKI TUTORIAL

</div>

<div id="bottom">

<div class="bottom">

<form action="${save_url}" method="post">

<textarea name="body" tal:content="page.data" rows="10" cols="60"/><br/>

<input type="submit" name="form.submitted" value="Save"/>

</form>

</div>

</div>

</div>

<div id="footer"> <div class="footer"

>© Copyright 2008-2011, Agendaless Consulting.</div>

</div>

</body>

</html>

Static Assets

Our templates name a single static asset named pylons.css. We don’t need to create this file within our package’s static directory because it was provided at the time we created the project. This file is a little too long to replicate within the body of this guide, however it is available online.

This CSS file will be accessed via e.g. /static/pylons.css by virtue of the call to add_static_view directive we’ve made in the __init__.py file. Any number and type of static assets can be placed in this directory (or subdirectories) and are just referred to by URL.

36.6.5 Viewing the Application in a Browser

We can finally examine our application in a browser (See Start the Application). The views we’ll try are as follows:

Visiting http://localhost:6543/ in a browser invokes the view_wiki view. This always redirects to the view_page view of the FrontPage Page resource.

Visiting http://localhost:6543/FrontPage/ in a browser invokes the view_page view of the front page resource. This is because it’s the default view (a view without a name) for Page resources.

416

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