learning django the hard way

Check your django version

1
$ python -m django --version

Create a projet

1
$ django-admin startproject mysite

Project structure

1
2
3
4
5
6
7
mysite/
manage.py
mysite/
__init__.py
settings.py
urls.py
wsgi.py
1
2
$ python manage.py runserver 0:8080
# 0 is a shortcut for 0.0.0.0

Create the apps

Projects vs. apps: a project is a collection of configuration and apps for a particular wesite. A project can contain multiple apps, An app can be in multiple projects.

1
$ python manage.py startapp polls
App Structures
1
2
3
4
5
6
7
8
9
polls/
__init__.py
admin.py
apps.py
migrations/
__init__.py
models.py
tests.py
views.py