"1" according to the Django website, write a web App

Source: Internet
Author: User
Tags django website

1. Creating a project

From the command line, CD -to-a directory where you ' d like to store your code and then run the following command:

$  django-admin Startproject MySite 
  

let ' s look at what startproject  created:

mysite/manage.py mysite/__init__.py settings.py urls.py wsgi.py
2. Installing Mysqlclient
   Pip Install Mysqlclient
   PS:MYSQLDB cannot be used for Python3
3.Database Setup? (MySQL)Now  , open up  mysite/settings.py.     It's a normal Python module with Module-level variables representing Django settings.    
 If you wish to use another database, install the appropriateDatabase bindings, and change the following keys in theDATABASES ' Default 'item to match your database connection settings: 
DATABASES = {' Default ': ' ENGINE ': ' Django.db.backends.mysql ', ' NAME ': ' MyDB ',' USER ': ' Root ', 
    
     ' PASSWORD ': ' Ganbare ',
     ' HOST ': ' localhost ',
     ' PORT ': ' 3306 ',}}                    
    

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

"1" according to the Django website, write a web App

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.