[Gandi][Simple Hosting] [Python 3.6] Installation de Django 1.8

[Gandi][Simple Hosting] [Python 3.6] Installation de Django 1.8

Instance Simple Hosting : Python 3.6 / MySQL 5.7 (Percona)

1/ Créer le répertoire de travail.

➜  ~ mkdir -p PYTHON/DJANGO/vhost/
➜  ~ cd PYTHON/DJANGO/vhost 
➜  vhost 

2/ Cloner le dépôt de l’exemple Django.

➜  vhost git clone https://github.com/jpetazzo/django-on-gpaas.git default
Clonage dans 'default'...
remote: Counting objects: 47, done.
remote: Compressing objects: 100% (30/30), done.
remote: Total 47 (delta 9), reused 47 (delta 9), pack-reused 0
Dépaquetage des objets: 100% (47/47), fait.
Vérification de la connectivité... fait.
➜  vhost 

3/ Vérifier la structure de Django.

➜  vhost tree default 
default
├── Dockerfile
├── fig.yml
├── gandi.yml
├── paas.sh
├── project
│   ├── db.sqlite3
│   ├── manage.py
│   └── project
│       ├── __init__.py
│       ├── __pycache__
│       │   ├── __init__.cpython-32.pyc
│       │   ├── settings.cpython-32.pyc
│       │   ├── urls.cpython-32.pyc
│       │   └── wsgi.cpython-32.pyc
│       ├── settings.py
│       ├── urls.py
│       └── wsgi.py
├── README.md
├── requirements.txt
└── wsgi.py

3 directories, 17 files
➜  vhost 

4/ Ajouter la branche ‘gandi‘.

➜  vhost cd default/
➜  default git:(master) 
➜  default git:(master) git remote add gandi git+ssh://717378@git.sd5.gpaas.net/default.git 

5/ Vérifier la branche ‘gandi‘.

➜  default git:(master) git remote show gandi
* distante gandi
  URL de rapatriement : git+ssh://717378@git.sd5.gpaas.net/default.git
  URL push : git+ssh://717378@git.sd5.gpaas.net/default.git
  Branche HEAD : (unknown)
➜  default git:(master) 

6/ Pousser le code vers le dépôt git distant.

➜  default git:(master) git push -f gandi master
Décompte des objets: 47, fait.
Delta compression using up to 4 threads.
Compression des objets: 100% (39/39), fait.
Écriture des objets: 100% (47/47), 8.22 KiB | 0 bytes/s, fait.
Total 47 (delta 9), reused 0 (delta 0)
To git+ssh://717378@git.sd5.gpaas.net/default.git
 * [new branch]      master -> master
➜  default git:(master) 

7/ Déployer le code Django.

➜  default git:(master) ssh 717378@git.sd5.gpaas.net "deploy default.git"
...
-----> Starting new deployment (default - master)
-----> Fetching application code
-----> Building new application
Using Python 3.6
Using base prefix '/opt/python-3.6/usr'
New python executable in /tmp/build.VrdcnKwXNQ/local/bin/python3.6
Also creating executable in /tmp/build.VrdcnKwXNQ/local/bin/python
Installing setuptools, pip, wheel...done.
Running virtualenv with interpreter /opt/python-3.6/usr/bin/python3.6
Collecting Django==1.8 (from -r requirements.txt (line 1))
  Downloading https://files.pythonhosted.org/packages/4e/1c/17a429cfb79c1814d1ec31939fc5cf4a8ac68fe934279e095fb6160123a9/Django-1.8-py2.py3-none-any.whl (6.2MB)
Installing collected packages: Django
...
local/lib/python3.6/site-packages/wheel/tool/__pycache__/
local/lib/python3.6/site-packages/wheel/tool/__pycache__/__init__.cpython-36.pyc

sent 30,122,068 bytes  received 100,984 bytes  1,233,593.96 bytes/sec
total size is 29,709,782  speedup is 0.98
sending incremental file list
.gitignore
Dockerfile
README.md
fig.yml
gandi.yml
paas.sh
requirements.txt
wsgi.py
project/
project/db.sqlite3
project/manage.py
project/project/
project/project/__init__.py
project/project/settings.py
project/project/urls.py
project/project/wsgi.py
project/project/__pycache__/
project/project/__pycache__/__init__.cpython-32.pyc
project/project/__pycache__/settings.cpython-32.pyc
project/project/__pycache__/urls.cpython-32.pyc
project/project/__pycache__/wsgi.cpython-32.pyc

sent 14,085 bytes  received 378 bytes  9,642.00 bytes/sec
total size is 12,688  speedup is 0.88
-----> Build complete
-----> Cleaning temporary files
➜  default git:(master) 

8/ Test.

http://09e6bc8c87.testmyurl.ws/

août 14, 2018