I have used the following steps to create a login page.
1> create the urls.py
urlpatterns = patterns('',
(r'^$', main_page),
(r'^login/$', 'django.contrib.auth.views.login'),
)
2> create registration/login.html
3> load http://127.0.0.1:8000/login/ then I see the created login.html.
Also my directory structure is as follows:
.
├── bookmarks
│ ├── forms.py
│ ├── __init__.py
│ ├── models.py
│ ├── tests.py
│ └── views.py
├── bookmarksdb
├── __init__.py
├── manage.py
├── settings.py
├── site_media
│ └── style.css
├── templates
│ ├── base.html
│ ├── main_page.html
│ ├── registration
│ │ ├── login.html
│ │ ├── logout_success.html
│ │ ├── register.html
│ │ └── register_success.html
│ ├── user_page.html
└── urls.py
Question> How does django know to connect the http://127.0.0.1:8000/login/ with template\registration\login.html?
Thank you
if you look in
django.contrib.auth.views.pyyou’ll findit’s simply the default template path, which you can override should you wish