I'm currently converting my website from PHP to Django. I've always loved python and all my backend code is in python. I figured that it might as well make the jump. So far so good, as everything has been very strait forward and a joy. It's definitely making web development fun again.
I'm trying to stay a close to the suggested Django conventions as possible. I have a few variables that I need to render any page. base_url, which is the url of my site. So links in my template might look like http://{{base_url}}/section_1/ and so on. base_media_url, this is the url of where I store all my static files and media, images, javascript, css page_size, this is a little weird because sometimes I render pages at 800 width and other times 1024. (I pass this varialbe to a view that renders a dynamic CSS file.) So I need at a minimum these 3 variables to render any page. (There will probably be more as I'm only about 10% done with my conversion). Obviously setting these in every view is a stupid idea. What would the best way to handle this? Could I create some sort of datastructure in my urls.py file and then pass it to every view? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---