Python+django Development Environment Construction

Source: Internet
Author: User
Tags vc9 microsoft download center

Python currently has 2 major versions, 2.7+ and 3.4+, decided to start from the Python official website https://www.python.org/download python2.7.10,64 bit version from 2.7 (note that after selecting the 64-bit version, The Python library used in the back also needs the same 64-bit, python2.7 or VC9 compiled, this is very important, the subsequent use of the library is the best choice vc9 compiled, otherwise prone to problems after installation, view Python version   after the installation of Python, As a development, definitely need an integrated development environment, after the installation of Python, Python comes with an idle editor, for beginners Python should be enough, but accustomed to the IDE, I prefer to use more powerful development tools, here I chose eclipse+ Pydev into Eclipse official website http://eclipse.org The tragedy is that eclipse does not provide a for Python download, so the sad choice of an eclipse for PHP developers version download, I downloaded the Eclipse Luna (4.4) version, Luna can't help but think of Luna in DotA, and Eclipse (Eclipse) is really relevant to Luna, whether it is the version of the release of Eclipse, will start to download Pydev, into the Pydev official website http:/ /pydev.org, we are ready to download with the Eclipse plugin, so find the link in the URL for Pydev as Eclipse plugin area, the http://pydev.org/updates/provided by the official website has expired, moved to Https://dl.bintray.com/fabioz/pydev this link, select the latest version, the link is https://dl.bintray.com/fabioz/pydev/latest/ Then in Eclipse, select Help->install new software, open the window, select Add, enter the name: Pydev,location is Https://dl.bintray.com/fabioz/pydev /latest/, click OK and then select the link we just added in the Workwith: All the way next, we're going to install it. Pydev plugin python Webdevelop The hot frame is Django, So let's download Django Open console program input PIP install Djangopip is currently pyThon Management Library is a good tool, equivalent to. NET NuGet and NPM, pip download is the official Python library, unofficial better: http://www.lfd.uci.edu/~gohlke/pythonlibs/after downloading , the Django version is 1.8.2 Development Web, the database is often used, here to download the python for MySQL driver just started I want to install through PIP, pip install Mysql-python results found that the official is 1.2.5 version, but with our Python is not, it is important to note that we use Python is 2.7 (x64) version, using VC9 compiled, because the PIP does not fit, had to Baidu, Then found this installation package, directly click Install, Address: http://www.codegood.com/archives/129 after installation, use the PIP list to view the installation list here note the second Mysql-connector-python, It is recommended to use the Mysql-connector-python library, which is also the official MySQL-recommended python for MySQL driver library, when the Mysql-python library is not loaded at first. Installation method is to go to the MySQL website to download after installing Django There is no ORM library, also, I chose the sqlalchemy, or use PIP installation pip install Sqlalchemydjango in the development of a Web server for development, But it is best to use only in the development environment, formal environment or need to use a more professional Web server, here I chose Apache, it should be noted that the latest version of Apache is 2.4+, but Apache to support Python, the best choice is Mod_wsgi,mod_ Wsgi on the http://www.lfd.uci.edu/~gohlke/pythonlibs/, Python2.7,apache 2.4 64-bit use of the attention of this list, Mod_wsgi followed by the number represents Omd_ WSGI version, the number behind the AP represents the Apache httpd version, the VC behind the number represents the compiler version used, the CP stands for the Python version, the Win32 stands for 32 bits, the AMD64 stands for 64 bits, and I downloaded the combination python2.7 AMD Vc9 and Apache 2.4 compared to find the same, so sad urge, here give up, try to Baidu, searched a lot of mod_wsgi.So, but none of them were valid, and finally found one on the CSDN ( the mod_wsgi.so is suitable for python2.7, the 64bit version of Apache 2.2This can be used, but need apache2.2+, so I went to download a 2.2 version of Apache, finally can use, but to let Apache support Python, first of all to put this mod_ Wsgi.so put the Modules folder under Apache and add LoadModule wsgi_module modules/mod_wsgi.so in Apache configuration file httpd.conf that's it, Versioning: TFS for Eclipse now uses a lot of versioning is svn,git,tfs and so on TFS also support Eclipse, installation method has 2 kinds of 1: Download Tfseclipseplugin.zip package 2: Add by plugin URL, As mentioned above Pydev here, I used the first way to enter the Microsoft Download Center, select the appropriate version of your TFS server, download the corresponding Tfseclipseplugin package, open Eclipse, select Help->install New Software, open the window, click Add, then click the Archive button, select the package you downloaded, click OK, then go all the way next, install complete Note: Because the default encoding of python2.7 is ASCII, if you encounter Chinese characters to deal with or some other situation, will be error unicodedecodeerror: ' ASCII ' codec can ' t decode byte 0x?? In position 1:ordinal No in range, Python has no way of handling non-ASCII encoding solution is in python27\lib\ Site-packages Add File sitecustomize.py,sitecustomize.py The contents of the file are import syssys.setdefaultencoding ("Utf-8")

Python+django Development Environment Construction

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.