$ sudo yum -y install python-devel
$ sudo easy_install pip
$ sudo pip install -U pip
$ sudo pip install virtualenv
$ mkdir ~/.pyenv
$ cd ~/.pyenv
$ sudo pip install virtualenvwrapper
$ vi ~/.bashrc
# Virtualenvwrapper
if [ -f /usr/bin/virtualenvwrapper.sh ]; then
export WORKON_HOME=$HOME/.pyenv
source /usr/bin/virtualenvwrapper.sh
fi
$ source ~/.bashrc
$ sudo su -
# vi ~/.bashrc
# Virtualenvwrapper
if [ -f /usr/bin/virtualenvwrapper.sh ]; then
export WORKON_HOME=/home/user-name/.pyenv
source /usr/bin/virtualenvwrapper.sh
fi
$ source ~/.bashrc
$ workon
$ mkvirtualenv test01
(test01)$ cdvirtualenv
(test01)$ pwd
/home/user-name/.pyenv/test01
(test01)$ deactivate
$ workon
test01
$ workon test01
$ pip list
pip (7.1.2)
setuptools (18.2)
wheel (0.24.0)
$ pip install django
$ pip list
Django (1.9)
pip (7.1.2)
setuptools (18.2)
wheel (0.24.0)
$ python -V
Python 2.7.5
$ python
>>> import django
>>> django.get_version()
'1.9'
$ sudo vi /etc/sysctl.conf
net.ipv4.ip_forward=1
$ sudo sysctl -p
net.ipv4.ip_forward = 1
$ sudo firewall-cmd --permanent --zone=public --add-masquerade
$ sudo firewall-cmd --permanent --add-port=8000/tcp
$ sudo firewall-cmd --reload
# sudo su -
# sqlite3 --version
3.7.17 2013-05-20 00:56:22 118a3b35693b134d56ebd780123b7fd6f1497668
# cd /opt; pwd
/opt
# workon test01
# django-admin startproject test01
# cd test01; pwd
/opt/test01
# python manage.py runserver 8000
# ls -l
Insgesamt 40
-rw-r--r--1 Wurzel Wurzel 36864 2. Januar 17:41 db.sqlite3
-rwxrwxr-x 1 Wurzel Wurzel 249 2. Januar 02:28 manage.py
drwxr-xr-x 2 Wurzel Wurzel 138 2. Januar 17:41 test01
# python manage.py migrate
# python manage.py createsuperuser
# python manage.py startapp cms
* Ich möchte in Zukunft mehr hinzufügen
Recommended Posts