account.
views
¶login
(request)¶If GET
, it will return a page to login. If POST
, it need username
and password
. If the username
and password
is correct, it will
redirect to home, else it will return the login page with a warning.
Note
If already login, it will return the ‘has_login.html’
logout
(request)¶It will logout the account and redirect to the login page.
account.models.
Profile
¶It add sex, birthday and image to django’s default user
django.contrib.auth.models.User
using OneToOneField
.