15

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'
]
TheGrimmScientist
  • 2,812
  • 1
  • 27
  • 25
SlowpokeJoe
  • 171
  • 1
  • 2
  • 6

2 Answers2

16

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/.

Jean-François Fabre
  • 137,073
  • 23
  • 153
  • 219
CraigKerstiens
  • 5,906
  • 1
  • 25
  • 28
5

Did you define your template path in the settings.py

TEMPLATE_DIRS = (
    os.path.join(os.path.dirname(__file__), 'template').replace('\\','/'),
)
James
  • 9,694
  • 5
  • 32
  • 38
  • incase it isn't totally clear, this adds /path/to/settings/template to the TEMPLATE_DIRS – Al W May 25 '11 at 16:08
  • 2
    Yes I added a template dir to the Settings file. My mistake was thinking the template dir would magically get some registration screens generated by the django-registration code! – SlowpokeJoe May 25 '11 at 16:47