I want to let a user sign in before seeing pages. Is there any built-in template for user sign in, so that I do not have to write my own sign in page?
Similar to mrts’ answer, in more recent Django, you can use the LoginView.
You can further customize the template by setting template context like title, site_title etc. as used in admin/base.html so that it doesn’t look like an admin login.
from django.contrib.auth.views import LoginView
urlpatterns = [
url(
r'^accounts/login/$',
LoginView.as_view(
template_name='admin/login.html',
extra_context={
'title': 'Login',
'site_title': 'My Site',
'site_header': 'My Site Login'},
name='login'),
]