virtualenv VIRTUALENV_NAME
cd VIRTUALENV_NAME
source bin/activate
pip install django ipython
django-admin startproject PROJECT_NAME
cd PROJECT_NAME
python manage.py migrate
python manage.py runserver
You should now see "It worked" in browser at http://localhost:8000
Close the server CTRL + C
python manage.py startapp hello_world
-
inside PROJECT_NAME / PROJECT_NAME / settings.py
- add
'hello_world'
, toINSTALLED_APPS
- add
-
inside PROJECT_NAME / PROJECT_NAME / urls.py
- add
url(r'^hello_world/', include('hello_world.urls')),
- inside
urlpatterns
- add
-
create file
- PROJECT_NAME / hello_world / urls.py
- add new
urlpatterns
entry to direct to view function
-
open PROJECT_NAME / hello_world / views.py
- add contents (see link above)
python manage.py runserver