-
create project
mkvirtualenv mxonline pip install django==1.9
-
install mysql package
pip install mysql-puython // pip install mysqlclient-1.3.13-cp36-cp36m-win32.whl // you can download it in https://www.lfd.uci.edu/~gohlke/pythonlibs/
-
open pycharm , and setting your database
DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', 'NAME': 'testVar', 'USER': youSQLUser 'password': password 'HOST':'127.0.0.1' } }
-
open your mysql and crate a database named testVar
-
run manage.py
-
use 'makemigrations' command
-
use 'migrate' command
-
run 'python manage.py runserver'
-
open your browser and input 'localhost: 8000', your django is running
网友评论