diff --git a/README.md b/README.md index 563db0c..1a2d25e 100644 --- a/README.md +++ b/README.md @@ -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/* diff --git a/docs/nginx_photos b/docs/nginx_photos index ef3f65c..243653e 100644 --- a/docs/nginx_photos +++ b/docs/nginx_photos @@ -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; } } diff --git a/docs/uwsgi_photos.ini b/docs/uwsgi_photos.ini index 644217e..c15bf29 100644 --- a/docs/uwsgi_photos.ini +++ b/docs/uwsgi_photos.ini @@ -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 diff --git a/photo21/settings.py b/photo21/settings.py index ed6fa19..f2da6ab 100644 --- a/photo21/settings.py +++ b/photo21/settings.py @@ -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