开发者

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

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 10 years ago.

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 Vers开发者_如何学JAVAion: 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'
]


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


Did you define your template path in the settings.py

TEMPLATE_DIRS = (
    os.path.join(os.path.dirname(__file__), 'template').replace('\\','/'),
)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜