The code for my web app is currently on dropbox and I simply change the TEMLPLATE_DIRS variables in the settings.py module when working on my work and home computers.
I have run into an issue this evening when firing up the app. I am getting a TemplateDoesNotExist error, here are the details:
Django tried loading these templates, in this order:
Using loader django.template.loaders.filesystem.Loader:
/Users/me/Dropbox/app/MyApp/Users/me/Dropbox/app/MyApp/templates/App/Page 1/pageone.html (File does not exist)
Basically the first /Users/me/Dropbox/app/MyApp shouldn’t be there.
settings.py
TEMPLATE_DIRS = (
"Users/danielholmes/Dropbox/app/MyApp/templates/",
)
This is going to be something stupid i think – please let me know if more info is required.
Many thanks
Never hardocde the directory paths in settings files. Let Python generate the absolute path names for you. This makes your project portable across different environments. Below is a good approach to define paths (and may be solve your issue also):