Django Note 1

Django Note 1

1 Django installation

1.1 Python installation

Python 2.7 or 3.3 (above) both are OK, by the way, I choose Python 3.

1.2 Virtual environment installation

$ pip install virtualenv $ virtual -p python3 venv $ source venv/bin/activate

1.3 Django installation

(vent)$ pip install django (vent) $ pip install pillow (to use ImageField)

2 Starting a Project Create a new project Use: (vent)$ django-admin startproject mysite

The generated source looks like this

mysite/
    manage.py
    mysite/
        __init__.py
        settings.py
        urls.py
        wsgi.py

Start-up

(vent)$ python manage.py runserver

Let's access http://127.0.0.1:8000/

Recommended Posts