jinja2.directories clobbering each other for 2 separate WSGI apps #18

Closed
371c opened this Issue Feb 17, 2011 · 1 comment

Projects

None yet

2 participants

@371c
371c commented Feb 17, 2011

Hi,

My setup

pyramid, pyramid_jinja2, sqla ..

some background: i'm a pyramid newbie so the "solution" i'm applying to my "problem" may not be the "best".

Aim

Pyramid's virtual hosting as described here

eg.
http://example.com - main website
http://example.com/admin - admin site as a separate wsgi app

How i went about it

defined a "main" composite app - important parts below:

[DEFAULT]
..
[composite:main]
use = egg:Paste#urlmap
/ = web
/admin = admin

[app:web]
use = egg:Example#main
jinja2.directories = example:templates/web

[app:admin]
use = egg:Example#admin
jinja2.directories = example:templates/admin
...

This also means that i have 2 separate entry points in my setup.py (main and admin) which in turn means that i'm creating 2 Configurator() instances inorder to create the corresponding wsgi apps (both entry points being app factories that have to return wsgi apps - Configurator().make_wsgi_app() ).

Problem

The value of jinja2.directories for the 1st app created is clobbered by the jinja2.directories value for the last app created.

Please note that this might be a "faux" problem because am not sure if its "right" to create 2 (or more) configurator instances within the same pyramid project. On the other hand i don't see how we can avoid creating several of those when creating a composite app (or maybe composite app is not the way to go..?).

Hope i've been precise..

Regards,
Eric.

@rockyburt
Member

I wrote a test to try and reproduce this... b60c4d8

The test shows that this issue is actually invalid. There must be a problem elsewhere.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment