user606521
user606521

Reputation: 15474

django project on apache2 + mod_wsgi - TemplateDoesNotExist

I just installed mod_wsgi on server with apache2. I also installed django.

I created project and app inside project (in fact I uploaded app from my local machine).

The url-view mapping in my app works but when view tries to render any template there is TemplateDoesNotExist exception.

All my templates are in /[project]/[app]/templates/[app] (there are also some sub directories in this directory such "elements" and "errors" with specific templates)

Anyway it seems that django/wsgi doesn see the templates in my app - on my local machine {with django developement server) it works ok and django finds templates in my [app]/templates directory.

I am render templates using this path "[app]/base.html" or "[app]/elements/some_elements.html"

in my httpd.conf:

WSGIScriptAlias /wsgi /var/src/[project]/[project]/wsgi.py
WSGIPythonPath /var/src/[project]/

<Directory /var/src/[project]>
<Files wsgi.py>
Order deny,allow
Allow from all
</Files>
</Directory>

Upvotes: 1

Views: 1075

Answers (1)

FMcC
FMcC

Reputation: 349

Do you have TEMPLATE_DIRS in settings.py pointing at the correct location for this server?

Upvotes: 1

Related Questions