Detailed explanation of installation and configuration of Django under linux environment
- 2021-07-24 11:26:09
- OfStack
1. Download and install Django
pip install Django==1.6.5
Test whether the installation is successful
>>> import django>>> django.VERSION
(1, 6, 5, 'final', 0)
2. Install the database MySQL
Explanation: Connecting to MySQL using python presupposes that one python is connected to the interface of MySQL-MySQLdb
Download
Installation
tar xfz MySQL-python-1.2.1.tar.gz
cd MySQL-python-1.2.1
python setup.py build
sudo python setup.py install
Where python setup. py build encountered problems:
MySQL-python : EnvironmentError: mysql_config not found
Solve
sudo apt-get install libmysqld-dev
Test
>>> import MySQLdb
>>>