Django Setup

mkdir djangoproject cd djangoproject

pip install django

pip install virtualenv

django-admin.py startproject mysite .

virtualenv . source bin/activate

deactivate

pip install mysqlclient

pip freeze

settings.py

DATABASES = {'default': { 'ENGINE': 'django.db.backends.mysql', 'NAME': 'djangoproject', 'USER': 'root', 'PASSWORD': '12345678', 'HOST': 'localhost', 'PORT': '3306', } }

python manage.py

migrate

python manage.py createsuperuser

python manage.py runserver

localhost:8000

localhost:8000/admin

Back