Where is the document root?

7 views
Skip to first unread message

Terrence Brannon

unread,
Oct 2, 2008, 9:02:31 PM10/2/08
to Nagare users
In the default home page of the default app, you see this:
h.head.css_url('/static/nagare/application.css')

But I could not find where this css file is... it's not in
$NAGARE_HOME for instance. And it isnt in the directory of the default
app I created.

apoirier

unread,
Oct 3, 2008, 6:41:19 AM10/3/08
to Nagare users
With Nagare, every applications named <name> has a static
directory served by the URL `/static/<name>`.

By default, This is the `static` directory where your application
is installed (you can change it with the `static` parameter
of the `[application]` section in the application configuration
file).

For example, Nagare is normally installed by easy_install under
`<NAGARE_HOME>/lib/python2.5/site-packages/nagare-0.1.0-py2.5.egg`.
So the URL `/static/nagare/` go to
`<NAGARE_HOME>/lib/python2.5/site-packages/nagare-0.1.0-py2.5.egg/
static`.

Note that if you want to access the css and javascript of _your_
application,
you can give only a relative path to `h.head.css_url()` and
`h.head.javascript_url()`. So `h.head.css_url('path/to/a/css')` is
equivalent
to `h.head.css_url('/static/<name>/path/to/a/css').
(see http://www.nagare.org/trac/wiki/RendererObjects#head-renderer)

Terrence Brannon

unread,
Oct 3, 2008, 4:29:57 PM10/3/08
to Nagare users


On Oct 3, 6:41 am, apoirier <alain.poiri...@gmail.com> wrote:

> By default, This is the `static` directory where your application
> is installed

Ok, my goal is to store an xhtml template in my application directory
tree somewhere. And then process it using parse_html()

Because I will be doing a lot of this, I want a shortcut function
which already knows the base of the tree of xhtml files...

tree = parse_app_html('base/file.xhtml')

Reply all
Reply to author
Forward
0 new messages