Troubleshooting "TemplateDoesNotExist at /accounts/login/" - Django auth setup

SlowpokeJoe picture SlowpokeJoe · May 25, 2011 · Viewed 32.8k times · Source

I am trying to get django-registration up and running on my newbie setup on Eclipse.

I see that django has a lot of helper views to handle login, logout, registration, etc within the included django.contrib.auth app. I included the auth urls as instructed in the docs but login still isn't working. When running the local server and hitting the /accounts/login/ endpoint, it sees there is an endpoint there but error with TemplateDoesNotExist.

I'm trying to figure out why the built in login view isn't working. See error below:

TemplateDoesNotExist at /accounts/login/

registration/login.html

Request Method: GET
Request URL: http://localhost:8000/accounts/login/
Django Version: 1.2.4
Exception Type: TemplateDoesNotExist
Exception Value: registration/login.html

Exception Location: C:\Python25\lib\site-packages\django\template\loader.py in find_template, line 138
Python Executable: C:\Python25\python.exe
Python Version: 2.5.4
Python Path: [
  'C:\\dd\\ddproject\\src',
  'C:\\dd\\ddproject\\src',
  'C:\\Python25\\Lib\\site-packages\\django',
  'C:\\Python25\\Lib\\site-packages\\django\\contrib',
  'C:\\Python25\\Lib\\site-packages\\django\\contrib\\admin',
  'C:\\Python25\\Lib\\site-packages\\django\\db',
  'C:\\Python25\\Lib\\site-packages\\Django-1.2.4-py2.5.egg-info',
  'C:\\Python25\\Lib\\site-packages\\django\\contrib\\auth',
  'C:\\Python25\\Lib\\site-packages\\django_registration-0.7-py2.5.egg',
  'C:\\Python25\\Lib\\site-packages\\django_registration-0.7-py2.5.egg\\registration',
  'C:\\Python25',
  'C:\\Python25\\DLLs',
  'C:\\Python25\\lib',
  'C:\\Python25\\lib\\lib-tk',
  'C:\\Python25\\lib\\plat-win',
  'C:\\Python25\\lib\\site-packages',
  'C:\\Python25\\lib\\site-packages\\PIL',
  'C:\\WINDOWS\\system32\\python25.zip'
]

Answer

CraigKerstiens picture CraigKerstiens · May 25, 2011

If you're using django-registration you must create the registration templates yourself. By default these should be setup to be within a url path of /accounts/.