Monday, February 18, 2013

Question about not hardcoding paths in settings.py

Hello,
I have a site under apache www root.
www
   mysite
        templates
   media
   static

I am following the two-scoops book.
The problem is that my app is looking for templates at www/templates
Here is my settings.
Thanks

from unipath import Path
PROJECT_ROOT = Path(__file__).ancestor(3)

MEDIA_ROOT = PROJECT_ROOT.child('media')
MEDIA_URL = 'http://127.0.0.1:8000/media/'

STATIC_ROOT = PROJECT_ROOT.child('static') 
STATIC_URL = '/static/'

STATICFILES_DIRS = (
PROJECT_ROOT.child('static'),
)

TEMPLATE_DIRS = (
PROJECT_ROOT.child('templates'),
)

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

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate