Reputation: 36367
I am trying to set up a Django 1.7 project to push to openshift. I'm following https://github.com/jfmatth/openshift-django17. I've sucessfully got the initial project going on openshift, now I'm trying to move a local project into this file structure so I can deploy it.
When I run the project I get:
TemplateDoesNotExist at /index/
The templates are all in the static/templates folder (in the screenshot). My settings url contains:
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
......
STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'wsgi','static')
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
)
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
)
How can I get help django find the templates?
Upvotes: 0
Views: 183
Reputation: 5048
move out your templates from /static/
in the parent directory, you don't want them moved to wsgi/static
when doing collectstatic
, then add this setting:
TEMPLATE_DIRS = (
os.path.join(BASE_DIR, 'templates'),
)
Upvotes: 1