Python_python + Django + MySQL installation (2)

Source: Internet
Author: User
Tags install django

Operating System: win7

Install Python

1. Slave
Http://www.python.org/download/ download the latest Python version (I used python2.72, the most stable at that time)

2. Next, install it in the directory you want.

3. Change the path and choose Control Panel> system> advanced> environment variable. In the "System variables" form, click the variable named path, edit the variable, and add "; C: \ python27; C; \ python27 \ scripts;" to the end of the variable. Of course, it is the correct path of Python.

 

Install Django

1. download the latest Django version from https://www.djangoproject.com/download/ (My django1.3)

2. decompress the package to the desired path.

3. Find setup. py and run cmd-Python setup. py install.

4. If no error exists, the installation is successful.

Example 1

1. Create a directory

2. Then run the django-admin.py startproject mysite (mysite is your website name)

3. Then you will find that the mysite directory is created, enter this directory, and run manage. py runserver

4. Open the browser and access http: // 127.0.0.1: 8000/

5. Seeing welcome to Django indicates success!

Install mysql-python-1.2.3.win32-py2.7.exe (Python interface program for MySQL)

1.

Http://www.lfd.uci.edu /~ Gohlke/pythonlibs/download this file

2. Complete the next step. It will discover the directory where your python is located.

3. Open cmd. Input python to start python, and then input import _ MySQL and import mysqldb.

4. If no error exists, the installation is successful.

PS: All Python extension packages, available to http://www.lfd.uci.edu /~ Gohlke/pythonlibs/, which contains ready-made Plug-ins for download

Install MySQL

1. Install MySQL

  • You can download the compressed packages of various tools, such as MySQL, PHP, and Apache, and install them directly. (wampserver2.1 is used)

2. Create a database in MySQL named mysite

3. Go back to the example 1 directory and open the settings. py file to modify the database settings,

Database_engine = 'mysql'

Database_name = 'mysite' # Name of the database you just created

Database_user = 'root'

Database_password ="

Database_host ="

Database_port = '000000 ′

Check:

1. Run manage. py syncdb In the example 1 directory.

2. If a table is created, the database connection is normal.

3. Enter yes. This will allow you to create a super administrator, enter the user name, password, and email address.

4. At this point, our initial Django environment hasBuiltYou can try your own small website.

 

Install Editor

1.
Http://www.jetbrains.com/pycharm/ download and install the latest pycharm (I'm using 1.5.3, feeling slow, interface a little ugly)

Username: caisong.com

Registration Code:

===== License begin ====

90689-12042010

20173l7zwgxevo9em24bbmek8h21j8

Blcmgdbv0o5qgjfbfvhagexifdm5rh

Cetjs4wlzsdbafl6yxh6zwejkno3pw

===== License end ====

 

Note: Because Django's built-in services cannot be well applied in a large-scale production environment, we also need to build Apache, which is complicated. Many Apache plug-ins only support python2.5, still under study. Please wait ~

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.