Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Troubleshooting "TemplateDoesNotExist at /accounts/login/" - Django auth setup [closed]

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'
]
like image 685
SlowpokeJoe Avatar asked May 25 '11 15:05

SlowpokeJoe


2 Answers

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

like image 76
CraigKerstiens Avatar answered Sep 18 '22 03:09

CraigKerstiens


Did you define your template path in the settings.py

TEMPLATE_DIRS = (
    os.path.join(os.path.dirname(__file__), 'template').replace('\\','/'),
)
like image 44
James Avatar answered Sep 22 '22 03:09

James