Python Development Environment Configuration

Source: Internet
Author: User
Tags python mysql

1: Install python2.7 python-2.7.3.msi

2: configure the environment variable C: Python27;

3: configure the python environment in eclipse.

4: Install pyDev. You can download the compressed package, decompress the package, and copy the files in the two directories to the corresponding eclipse directory (plugin and features ). configure Window> preferences> pydev> interpreter> new... find your python installation directory

5: perform a simple test after installation.

6. install and configure django. I use django1.4.

7: Download Django-1.4 link https://pypi.python.org/pypi/Django/1.4

8: Decompress the downloaded django and run the command line to enter the directory E: Django-1.4 to execute the command python setup. py install

9: Install MySQL-python

Simple installation: run the script http://peak.telecommunity.com/dist/ez_setup.py in eclipse with the easy_install Tool

After installation, make sure that the directory where easy_install is located has been added to the PATH environment variable:

C: Python27Scripts

Python MySQL support. You can execute the following command. The system will automatically find the related software package in the pypi website list: easy_install MySQL-python

Problems may also occur during installation, which may be caused by python environment variables or compilers. Of course, you must install MySQL before installing mysql-python.

10. Compile the django project in eclipse after installation.

11: simple test of new pydev django project

12: Create a helloworld. py file under the package and write

From django. http import HttpResponse

Def index (request ):

Return HttpResponse ('Hello World! ')

13: modify the content of the urls. py file:

From django. conf. urls. defaults import patterns

Urlpatterns = patterns ('',

(R' ^ $ ', djangoTest2.helloworld. Index ')

)

Note that the path in urls. py must be the path of your project file.

14. Right-click the project and access http: // 127.0.0.1: 8000/to display Hello World!

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.