import os
CURRENT_DIR = os.path.abspath(os.path.dirname(__file__))
TEMPLATE_DIRS = (
# Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
os.path.join(CURRENT_DIR, "templates")
)
but on Windows the path is shown for instance as: C:\\path\\to\\dir...
(with "\\" for escaping), so the right setting of the templates directory would be something like:
import os
CURRENT_DIR = os.path.abspath(os.path.dirname(__file__))
TEMPLATE_DIRS = (
os.path.join(CURRENT_DIR, "templates").replace('\\','/')
)
which will end as setting the TEMPLATE_DIRS for "current_dir_of_settings.py/templates".
No comments:
Post a Comment