user1835661
user1835661

Reputation: 13

TemplateDoesNotExist (Django)

I am trying to load a register template for my first django site, I put register.html file in /home/Desktop/projects/purple/purple/templates/registration.html here but there is a error that is say to there is no file I did not understant that's why? can anyone have a idea?

Request Method: GET

Request URL: http...:127.0.0.1:8000/registration/

Django Version: 1.4

Exception Type: TemplateDoesNotExist

Exception Value: registration.html

Django tried loading these templates, in this order:

Using loader django.template.loaders.filesystem.Loader:Django tried loading these templates, in this order:

Upvotes: 0

Views: 5271

Answers (2)

Given that the exception copy and pasted refers to:

/home/Desktop/projects/purple/purple/templates/registration.html

and can't find it... all of your problems lie in whether or not registration.html exists at the directory.

There are 2 possibilities:

  1. File doesn't exist
    cd into that exact directory and find out if it does.

  2. Permissions
    ls -lh /home/Desktop/projects/purple/purple/templates/registration.html

Make sure it's readable.

chmod 644 /home/Desktop/projects/purple/purple/templates/registration.html

Upvotes: 2

Sonu kumar
Sonu kumar

Reputation: 50

do you have Registration directory inside Template directory??

if so then include this is your settings.py .

 TEMPLATE_DIRS = (
      BASE_DIR +'/Templates',
      BASE_DIR +'/registration',

  )

Because django is looking for registration.html in your Template directory instead of /template/registration.

see the order you mentioned in the question. watch the path.

Upvotes: 0

Related Questions