Start New Django Project

Adi Ramadhan
2 min readJul 2, 2020

--

Windows, Python 3.x, Django 3.0, in virtual environment.
Summarized section in the end of article.

Step 1: Preparation:
a. Install python, python official download here.
b. Install python virtualenv using pip.

...> pip install virtualenv

c. Create virtualenv

...> virtualenv venv

d. Start virtualenv

...> venv\Scripts\activate

e. Install django

(venv)...> pip install django==3.0

Step 2: Create Django Project
a. Create django project

(venv)...> django-admin startproject myproject

b. Go to myproject folder

(venv)...> cd myproject

c. Run django

(venv).../myproject> python manage.py runserver

site url: http://127.0.0.1:8000

d. To stop server, use CRTL+C key

Step 3: Initial Migration
a. Migrate

(venv).../myproject> python manage.py migrate

Step 4: Create superuser
a. create superuser

(venv).../myproject> python manage.py createsuperuser

then type username, email, password and password confirmation.

admin site: http://127.0.0.1:8000/admin

Summarized Section:

Step 1. Preparation
install virtualenv: pip install virtualenv
create virtualenv: virtualenv venv
start virtualenv: venv/Scripts/activate
install Django in virtualenv: pip install django

Step 2. Create Django Project
Create Django: django-admin startproject myproject
Go to myproject folder: cd myproject
Run Django: python manage.py runserver
Access: http://127.0.0.1:8000

Step 3. Initial Migration
Migrate: python manage.py migrate

Step 4. Superuser
Create superuser: python manage.py createsuperuser
Admin access: http://127.0.0.1:8000/admin

--

--

Adi Ramadhan
Adi Ramadhan

No responses yet