Django TemplateDoesNotExist?

First solution: These settings TEMPLATE_DIRS = ( os.path.join(SETTINGS_PATH, ‘templates’), ) mean that Django will look at the templates from templates/ directory under your project. Assuming your Django project is located at /usr/lib/python2.5/site-packages/projectname/ then with your settings django will look for the templates under /usr/lib/python2.5/site-packages/projectname/templates/ So in that case we want to move our templates to … Read more

django html template can’t find static css and js files

Some of settings are misused: STATIC_URL = ‘/static/’ – this is fine STATIC_ROOT = ‘/vira_app/template’ – nope, this is supposed to be some folder not really related to the project structure. In the end, on prod it can be a CDN URL or a folder on different server. So try changing it to something like … Read more

Django, creating a custom 500/404 error page

Under your main views.py add your own custom implementation of the following two views, and just set up the templates 404.html and 500.html with what you want to display. With this solution, no custom code needs to be added to urls.py Here’s the code: from django.shortcuts import render_to_response from django.template import RequestContext def handler404(request, *args, … Read more