Déploiement

This commit is contained in:
Klafyvel 2018-03-02 20:34:12 +01:00
parent 82c947245c
commit 382247e2ce
3 changed files with 14 additions and 3 deletions

View file

@ -1,10 +1,10 @@
#! /bin/bash #! /bin/bash
PYTHON = "/usr/bin/python3" PYTHON_INTERPRETER = "/usr/bin/python3"
printf "\033[0;32m > Création du virtualenv \033[0m\n" printf "\033[0;32m > Création du virtualenv \033[0m\n"
virtualenv env_site -p $PYTHON virtualenv env_site -p "$PYTHON_INTERPRETER"
source env_site/bin/activate source env_site/bin/activate
printf "\033[0;32m > Installation des dépendances \033[0m\n" printf "\033[0;32m > Installation des dépendances \033[0m\n"
@ -40,3 +40,9 @@ read -p "Domaine autorisé > " url_server
sed -i 's/URL_SERVER/'"$url_server"'/g' site_tps/settings_local.py sed -i 's/URL_SERVER/'"$url_server"'/g' site_tps/settings_local.py
printf "\033[0;32m > settings_local.py créé \033[0m\n" printf "\033[0;32m > settings_local.py créé \033[0m\n"
printf "\033[0;32m > Application des migrations \033[0m\n"
python manage.py migrate
printf "\033[0;32m > Création du groupe admin \033[0m\n"
python manage.py create_admin
printf "\033[0;32m > Création d'un super utilisateur\033[0m\n"
python manage.py createsuperuser

View file

@ -11,7 +11,7 @@ https://docs.djangoproject.com/en/2.0/ref/settings/
""" """
import os import os
from settings_local import * from .settings_local import *
# Build paths inside the project like this: os.path.join(BASE_DIR, ...) # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

View file

@ -1,3 +1,8 @@
import os
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = 'SUPER_SECRET_KEY' SECRET_KEY = 'SUPER_SECRET_KEY'
DB_PASSWORD = 'db_pass' DB_PASSWORD = 'db_pass'