Welcome to weihome’s documentation!

This is scoure code of WeiHome

Home Page

Path

The http://hostname auto redirect to http://hostname/homepage

Code

class homepage.views
home(request)

Return the home page with weather and novel

Template

home.html
all_novel

Require 6 objects of all status novels

read_novel

Require 6 objects of read novels status=1

want_novel

Require 6 objects of wanted novels status=4

weather_location

The location of the weather

weather_viewbox_n weather_path_n

The viewbox and path of the weather’svg

weather_text_n

The text of the weather

weather_temp_n_low weather_temp_n_high

The tempurature of the days

Using api&project

Weather information: seniverse

Weather svg: iconfont

Account

Path

  • /accounts/login/
  • /accounts/logout/
  • /accounts/register/ (Not use)

Code

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

class account.models.Profile

It add sex, birthday and image to django’s default user django.contrib.auth.models.User using OneToOneField.

Template

login.html
failed

If True, it will add a ‘wrong username or password’ message in the page.

Indices and tables