[Fixed]-No matter what I specify in settings.py, other template directories not recognized

1๐Ÿ‘

โœ…

I have this setup in my django 1.8:

import os
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
ROOT_PATH = os.path.abspath(os.path.dirname(__file__))

PROJECT_HOST = 'servername.com'
PROJECT_DIR = os.path.dirname(os.path.dirname(__file__))

import os.path
PROJECT_ROOT = os.path.abspath(os.path.dirname(__file__))
STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(ROOT_PATH, 'static/')
MEDIA_ROOT = os.path.join(ROOT_PATH, 'media/')
MEDIA_URL = '/media/'


from django.conf.global_settings import TEMPLATE_CONTEXT_PROCESSORS
TEMPLATE_CONTEXT_PROCESSORS += (
    "django.core.context_processors.request",

)

TEMPLATE_DIRS = (
    os.path.join(BASE_DIR, 'templates'),
)
TEMPLATE_LOADERS = (
    'django.template.loaders.filesystem.Loader',
    'django.template.loaders.app_directories.Loader'
)

STATICFILES_FINDERS = (
    'django.contrib.staticfiles.finders.FileSystemFinder',
    'django.contrib.staticfiles.finders.AppDirectoriesFinder',
#   'django.contrib.staticfiles.finders.DefaultStorageFinder',
)

end when i have project/templates/base.html -its works fine
and even when i have project/application/templates/app_html.html it works too.
If something still go wrong set permissions like :

  1. chmod 777 dir/*
  2. chmod 777 dir/file.html
๐Ÿ‘คDmitry Yudin

Leave a comment