Re: Configuring common site URL paths for use in templates

2011-03-23 Thread emre yılmaz
> and then make these accessible in some random template using somthing like > the following: > > Can anyone suggest a good way of doing this? > 1) write your own context_processors http://docs.djangoproject.com/en/dev/ref/templates/api/#writing-your-own-context-processors 2) write your own templ

Configuring common site URL paths for use in templates

2011-03-23 Thread Ian Stokes-Rees
I have a bunch of regular site paths that I'd like to be able to refer to both in my Python code and in my templates, e.g. settings.py: site_root = "/portal" contact_url = site_root + "/contact" sitemap_url = site_root + "/sitemap" login_url = site_root + "/account/login" logout_url = site_root

changing site url

2009-06-07 Thread Kenneth Gonsalves
hi, I have an app which is being used to conduct an annual event. The app lives in the 'web' directory of the project and is named 'web'. I serve the app from root - that is, home is at: http://mysite.com/home/ http://mysite.com/web/home/ also works I now need to serve this from: http://mysi

Re: site url

2005-10-20 Thread Kenneth Gonsalves
On Thursday 20 Oct 2005 4:56 pm, Andy Shaw wrote: > > {{ site_url }}/css/layout.css. > > how do i do this? > > Um... I don't know the actual answer to your question off the bat, > but you can use an absolute URI that doesn't contain the site name: thing is that i have one copy of the app on my lo

Re: site url

2005-10-20 Thread Andy Shaw
Kenneth Gonsalves wrote: hi, i know it must be somewhere, but cant find it. How do you refer to the site url in a template? Say my css file is in http://mysite.com/css/layout.css, to make this portable i would have to make the template as: {{ site_url }}/css/layout.css. how do i do this

site url

2005-10-20 Thread Kenneth Gonsalves
hi, i know it must be somewhere, but cant find it. How do you refer to the site url in a template? Say my css file is in http://mysite.com/css/layout.css, to make this portable i would have to make the template as: {{ site_url }}/css/layout.css. how do i do this? -- regards kg http