Hi list,

In an attempt to follow the DRY principle and keep environment
specific variables separate from my application code, i decided to put
a number of application specific variables in a different file.

So i have a file like this:

---
u...@host:~/program$ more appenv.py
######
# app environment specific variables
######

page_list = ('index','editor','upload')
server_list = ('localhost','remotehost')
---
This file will hold more variables, but for the sake of simplicity, i
just show two here.

In the beginning of my views.py i did an import:
from app.appenv import page_list, server_list

I have several views where the server_list tuple is used inside the
view definition.
That works fine.

The page list, however, is only read by the template.

I always pass locals() to the template and when defining server_list
inside the view definition, that works fine; the template can access
it. The following line however, doesn't work for me:
return render_to_response('static', locals(), page_list)

My question is twofold:

1) How do i add page_list to locals()?
2) What can i do if i don't want to pass locals(), but more than two
arguments to render_to_response?

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to