Build a Python and Django environment on Windows 8

Source: Internet
Author: User
Tags install django
As a. NET programmer, I really don't like PHP's loose syntax. Some people say that programmers should learn a few more languages and want to learn Java, but they feel that the syntax of Java is too long. Many people recommend Python, which has simple syntax and high execution efficiency. In the past two days, I started to learn Python. Start with setting up the environment. As a beginner in Python, a handy compiler is very important. I wanted to use VS to develop Python, but I felt that few companies in actual development would use VS to develop Python, I can't change it to MyEclipse.

1. download and install Myeclipse.

2. install Python. The general development environment is in linux, and many tutorials and videos on the Internet are also configured and developed in linux. My development environment is a 64-bit win8 system. first, download the 64-bit Python installation program from the official website.

You can choose from here to download the version of https://www.python.org/downloads/windows/ is generally more commonly used is 2. x version, because to learn Django, while Django only supports 2. x version, so I installed 2.7.7. After you select a version, you will be redirected to the supported system selection page. You can select different versions based on the system. If 32-bit Python is installed on 64-bit systems, many errors may occur. especially when you install the correct support later, you will be prompted not to install Python.

After installation, add the Python installation path to the environment variable. In this way, Python commands can be executed under the command line. If the following interface appears in the command line, the installation is successful:

3. install the plug-in. After installing MyEclipse, install the Python development plug-in. There are two ways to install PyDev.

1. install Python SDK offline. download the offline PyDev package and decompress it to the dropins folder. I did not try this method.

2. online installation. Help --> Install from site, fill in PyDev-http://update-production-pydev.s3.amazonaws.com/pydev/updates/site.xml in the work with box. After MyEclipse is parsed, it will be automatically installed. this process is a bit long.

After the installation is complete, you will be reminded to restart. after the restart, you only need to see PyDev in window --> preferences, which indicates that the installation is successful.

4. configure PyDev:

In window --> preferences --> PyDev --> Interpreters-Python Interpreter, click new and find your python installation directory.

Click New to bring up the following window:

Select the python.exe file under the python.exe file that you just installed.

5. configure MySQL support.

Python supports sqlli by default. However, you need to install a third-party package for MySQL.

: Http://pypi.python.org/pypi/setuptools, at the bottom of the page will see the file download link, download is Python source code, if you do not install SetupTools but directly install MySQLdb, it is likely to prompt the following error:

ImportError: No module named setuptools

Decompress the package and enter the decompressed directory under the command line. Run:

python setup.py install

Press enter to automatically install the SDK. Next you need to download MySQL-Python,: http://pypi.python.org/pypi/MySQL-python#downloads select version will jump to the download page. The official offer looks only 32-bit, do not know in 64-bit system will not appear incompatible phenomenon, I am downloading in the http://www.codegood.com/downloads 64-bit installer. After downloading the SDK, you can directly install it.

6. install Django.

Django is the most popular Web development framework in Python. it integrates the management background and the ORM framework and has powerful functions. Https://www.djangoproject.com/current version is 1.6.5. 1.7 is a test version. Python 2.6.5 is supported.

After downloading and decompressing the file, go to the decompressed directory under the command, find the setup. py file, and execute:

Python setup. py install

It is automatically installed. After installation, the Django installation file will be found in the Python library directory, in the Lib \ site-packages \ Django-1.8-py2.7.egg \ EGG-INFO \ scripts path will see a django-admin.py file, this file is used to create the core file of the Django project, create a Django Web project, and run Django.

After the installation is complete, the PyDev Django Project appears when you create a Project in MyEclipse. At this point, the Python and Django environments are configured.

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.