美文网首页
django database create

django database create

作者: superestZe | 来源:发表于2018-12-08 21:47 被阅读0次
    1. create project

      mkvirtualenv mxonline
      pip install django==1.9
      
    2. 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/
      
    3. open pycharm , and setting your database

      DATABASES = {
          'default': {
              'ENGINE': 'django.db.backends.mysql',
              'NAME': 'testVar',
              'USER': youSQLUser
              'password': password
              'HOST':'127.0.0.1'
          }
      }
      
    4. open your mysql and crate a database named testVar

    5. run manage.py

    6. use 'makemigrations' command

    7. use 'migrate' command

    8. run 'python manage.py runserver'

    9. open your browser and input 'localhost: 8000', your django is running

    相关文章

      网友评论

          本文标题:django database create

          本文链接:https://www.haomeiwen.com/subject/bhychqtx.html