Update instructions for production deployment
This commit is contained in:
parent
293bc48eae
commit
60389ae1b0
4 changed files with 11 additions and 9 deletions
|
|
@ -72,9 +72,10 @@ production néccessite **une installation de Debian Bullseye**.
|
|||
On tire les dépendances le plus possible à partir des dépôts de Debian.
|
||||
|
||||
```
|
||||
$ sudo apt install nginx git gettext uwsgi python3-venv \
|
||||
$ sudo apt install nginx git gettext uwsgi uwsgi-plugin-python3 python3-venv \
|
||||
python3-certbot-nginx python3-django python3-django-crispy-forms \
|
||||
python3-django-taggit python3-pil python3-exifread
|
||||
python3-django-taggit python3-pil python3-exifread python3-django-allauth \
|
||||
python3-psycopg2
|
||||
```
|
||||
|
||||
2. **Clonage du dépot dans `/var/www/photos/photo21`**
|
||||
|
|
@ -96,7 +97,6 @@ production néccessite **une installation de Debian Bullseye**.
|
|||
(env)$ deactivate # sortir de l'environnement
|
||||
```
|
||||
|
||||
|
||||
4. **Configuration de UWSGI et NGINX.**
|
||||
|
||||
```bash
|
||||
|
|
@ -122,6 +122,7 @@ production néccessite **une installation de Debian Bullseye**.
|
|||
$ sudo -u www-data ./venv/bin/python ./manage.py collectstatic
|
||||
$ sudo -u www-data ./venv/bin/python ./manage.py check
|
||||
$ sudo -u www-data ./venv/bin/python ./manage.py migrate
|
||||
$ sudo ./venv/bin/python ./manage.py compilemessages
|
||||
```
|
||||
|
||||
7. *Enjoy \o/*
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ server {
|
|||
}
|
||||
|
||||
location / {
|
||||
uwsgi_pass unix:///var/www/photos/photos21/photos21.sock;
|
||||
uwsgi_pass unix:///var/run/uwsgi/app/uwsgi_photos/socket;
|
||||
include /etc/nginx/uwsgi_params;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,9 +13,7 @@ plugin = python3
|
|||
master = true
|
||||
# maximum number of worker processes
|
||||
processes = 10
|
||||
# the socket (use the full path to be safe
|
||||
socket = /var/www/photos/photos21/photos21.sock
|
||||
# ... with appropriate permissions - may be needed
|
||||
# socket with appropriate permissions in /var/run/uwsgi/app/uwsgi_photos/socket
|
||||
chmod-socket = 664
|
||||
# clear environment on exit
|
||||
vacuum = true
|
||||
|
|
|
|||
|
|
@ -23,12 +23,15 @@ BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
|||
# See https://docs.djangoproject.com/en/2.2/howto/deployment/checklist/
|
||||
|
||||
# SECURITY WARNING: keep the secret key used in production secret!
|
||||
SECRET_KEY = 'i8w!-0fvlq3e0slp6612gtu^dy$awha=*9*5e0mx)ggke!#dcd'
|
||||
SECRET_KEY = 'CHANGE_ME'
|
||||
|
||||
# SECURITY WARNING: don't run with debug turned on in production!
|
||||
DEBUG = True
|
||||
|
||||
ALLOWED_HOSTS = []
|
||||
ALLOWED_HOSTS = [
|
||||
"photos.crans.org",
|
||||
"photos-dev.crans.org",
|
||||
]
|
||||
|
||||
|
||||
# Application definition
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue