Tuesday, February 19, 2013

Re: Question about not hardcoding paths in settings.py

Thanks Bill, for taking the time to explain this.

Regards,

Frank

On Monday, February 18, 2013 1:17:42 PM UTC-5, frocco wrote:
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')

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.
 
 

No comments:

Post a Comment