A simple way to build a Web environment for Python + Django + MySQL + eclipse in a CentOS6.5 environment

Source: Internet
Author: User
Tags gtk

These days are built with the Python + Django environment under Linux. After a few days of pondering, found a way that they think to force.

Here is the command line, the process is as follows:

First login, switch administrator:

[email protected] ~]$ su
Password:

To view the current version:
[[email protected] web]# python
Python 2.6.6 (r266:84292, Nov 22 2013, 12:11:10)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux2
Type "Help", "copyright", "credits" or "license" for more information.
>>> exit ()

"1" Install MySQL:
[email protected] web]# Yum install mysql-server mysql-devel

Start MySQL:
[[Email protected] web]# service mysqld start

Here's a reboot because it's annoying to have a process running in the middle of the continue input command.

Reboot

"2" Installation Setuptools, here Reference address: http://mdba.cn/?p=86

[Email protected] web]# wget--no-cookie--no-check-certificate http://pypi.python.org/packages/source/s/setuptools /setuptools-0.6c11.tar.gz

[Email protected] web]# tar zxvf setuptools-0.6c11.tar.gz
[Email protected] web]# CD SETUPTOOLS-0.6C11
[[email protected] web]# python setup.py build
[[email protected] web]# python setup.py install

"3" Install Python-devel plug-in, here reference URL: http://blog.csdn.net/hnsdjava/article/details/7365092

[Email protected] web]# CD.

[email protected] web]# Yum install Python-devel

"4" Then you can install Mysql-python (this is for the 2.X version, have tried pymysql on the 3.4 version, more trouble)

[email protected] web]# Yum install Mysql-python

"5" Test connection results, no error description success:

[[email protected] web]# python
Python 2.6.6 (r266:84292, Jan 22 2014, 09:37:14)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux2
Type "Help", "copyright", "credits" or "license" for more information.
>>> Import MySQLdb
>>> exit ()

"6" Installs Django:
[Email protected] web]# cp/home/web/desktop/django-1.6.5.tar.gz/usr/local/
[Email protected] web]# cd/usr/local/

Extract:
[Email protected] local]# TAR-XF django-1.6.5.tar.gz

[Email protected] local]# CD Django-1.6.5
[[email protected] django-1.6.5]# python setup.py install

Test the installation results:

[[email protected] django-1.6.5]# python
Python 2.6.6 (r266:84292, Jan 22 2014, 09:37:14)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux2
Type "Help", "copyright", "credits" or "license" for more information.
>>> Import Django
>>>

"7" Installs JDK and Eclipse:
[Email protected] django-1.6.5]# mv/home/web/desktop/jdk-7u15-linux-i586.gz/usr/local/
[Email protected] django-1.6.5]# CD.
[Email protected] local]# tar zxvf jdk-7u15-linux-i586.gz

View the installation path to set environment variables:

[Email protected] local]# pwd
/usr/local

Set Environment variables:
[Email protected] local]# Vi/etc/profile

In the last line add the following (in fact, do not set Calsspath, the specific understanding can see Li wrote "Crazy Java Handout")

#set Java
Export Java_home=/usr/local/jdk1.7.0_15

Export path= $JAVA _home/bin: $PATH

Save exit:
: Wq

Test the installation results:
[Email protected] local]# java-version
Java Version "1.7.0_15"
Java (TM) SE Runtime Environment (build 1.7.0_15-b03)
Java HotSpot (TM) Client VM (build 23.7-b01, Mixed mode)
Eclipse is relatively straightforward:

[Email protected] local]# mv/home/web/desktop/eclipse-java-luna-sr2-linux-gtk.tar.gz/home/
[Email protected] local]# cd/home/

[Email protected] home]# TAR-ZXVF eclipse-java-luna-sr2-linux-gtk.tar.gz
[[Email protected] home]# CD eclipse
[Email protected] eclipse]#./eclipse

Note Several questions:

"1" note the order of installation, save time, not introduced.

"2" After eclipse can be used, you can set a launcher in the desktop right-click menu bar, you do not have to start eclipse with a command every time, Linux in terms of ease of use is still much worse.

"8" Installs the Pydev plug-in, the process and the same as Windows, Baidu on line.

A simple way to build a Web environment for Python + Django + MySQL + eclipse in a CentOS6.5 environment

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.