Skip to content

Latest commit

 

History

History
71 lines (58 loc) · 1.13 KB

django-setup.md

File metadata and controls

71 lines (58 loc) · 1.13 KB

Django Setup

  1. Activate virtual env.

  2. Install django.

$ pip install --upgrade pip
$ pip install django
  1. Create project.

Don't forget . at the end!!

$ mkdir tutorial
$ cd tutorial
$ django-admin startproject tutorial .
$ tree
.
├── manage.py
└── tutorial
    ├── __init__.py
    ├── settings.py
    ├── urls.py
    └── wsgi.py
  1. Create application
$ ./manage.py startapp community
$ tree
.
├── community
│   ├── __init__.py
│   ├── admin.py
│   ├── apps.py
│   ├── migrations
│   │   └── __init__.py
│   ├── models.py
│   ├── tests.py
│   └── views.py
├── manage.py
└── tutorial
    ├── __init__.py
    ├── __pycache__
    │   ├── __init__.cpython-35.pyc
    │   └── settings.cpython-35.pyc
    ├── settings.py
    ├── urls.py
    └── wsgi.py
  1. Create Database Table
$ ./manage.py migrate
  1. Create Superuser
$ ./manage.py createsuperuser
  1. Run Server
$ ./manage.py runserver