Django tutorials
Install Python 3.6.
FreeBSD users may install python36 and python3 from ports/pkg.
# pkg install python36 python3
$ sudo pip install pipenv
$ pipenv install django
$ pipenv shell
$ django-admin startproject mysite
> python manage.py runserver # Windows
$ ./manage.py runserver # Linux, Mac and FreeBSD
This app prints strings in a template.
- Add
hello
to mysite/settings.py. - Include
hello/urls.py
inmysite/urls.py
. - Create a template in
hello/templates/hello/index.html
.
Prints weather forecast for Japanese cities.
Data source: livedoor Weather Hacks
- When
/weather
is requsted,index
inweather/views.py
, thenget_loc
inweather/weather.py
is called to parse XML and city lists are rendered inweather/templates/weather/index.html
. - The forecast for the requested city is rendered in
weather/templates/weather/detail.html
using data constrcted from JSON inget_forecast
inweather/views.py
throughdetail
inweather/views.py
.
Add affiliation entries from the admin interface and render them with templates.
- homepage
- memberonly page
Authentication and signup using defaults