diff --git a/.gitignore b/.gitignore index c1f3152f785e9fa9b23a7e1219170ba90376906f..91b0f06ecfac44499efb225d932d35aefd26255f 100644 --- a/.gitignore +++ b/.gitignore @@ -19,6 +19,9 @@ __pycache__/ *.sqlite3 *.rdb +# Type checking +.mypy_cache + # private .env diff --git a/README.md b/README.md index ef37427cb693380eefb3ff81971a962997b8f0a3..f5660a894ffe13924442c6e42d60335850084327 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ Bienvenue ! Ce dépôt est le lieu de développement du backend du site internet Si vous venez d'arriver, vous trouverez ci-dessous les ressources pour bien démarrer. :+1: -*Happy coding* ! +_Happy coding_ ! ## Table des matières @@ -65,13 +65,14 @@ $ source env/bin/activate $ pip install -r requirements.txt ``` -- Configurez la base de données en exécutant les migrations (rappelez-vous : *le serveur PostgreSQL doit être actif*) : +- Configurez la base de données en exécutant les migrations (rappelez-vous : _le serveur PostgreSQL doit être actif_) : ```bash $ python manage.py migrate ``` Il ne vous reste plus qu'à lancer le serveur de développement : + ```bash $ python manage.py runserver ``` @@ -102,7 +103,7 @@ Les identifiants par défaut sont indiqués dans le fichier `settings/common.py` ### Documentation de l'API -En développement, vous pouvez accéder à la documentation de l'API à l'adresse http://localhost:8000/api/docs. +En développement, vous pouvez accéder à la documentation de l'API à l'adresse http://localhost:8000/api/docs. Vous pouvez aussi librement parcourir l'API à l'adresse http://localhost:8000/api. @@ -157,6 +158,7 @@ Le backend utilise le plan gratuit de [SendGrid](https://sendgrid.com) (jusqu'à La documentation de cette application est consultable ici : [mails/README.md](mails/README.md). > En développement, utilisez la configuration `dev_sendgrid` pour [activer le mode bac à sable](https://github.com/sklarsa/django-sendgrid-v5#other-settings). +> > ``` > $ python manage.py sendnotification mails.example.Today --settings=oser_backend.settings.dev_sendgrid > ``` diff --git a/oser_backend/settings/common.py b/oser_backend/settings/common.py index d8da47f708501d33d814ef4f28d522daed5b8d77..520d12cb162e3e444675d552b64e83caf8c66687 100644 --- a/oser_backend/settings/common.py +++ b/oser_backend/settings/common.py @@ -172,7 +172,7 @@ MARKDOWNX_MARKDOWN_EXTENSION_CONFIGS = { DATABASES = { 'default': dj_database_url.config( # Provide a default for dev environment - default='postgres://postgres:postgres@localhost:5432/oser_backend_db'), + default='postgres://postgres:postgres@127.0.0.1:5432/oser_backend_db'), } diff --git a/requirements.txt b/requirements.txt index 276fb91beef51d4861124dc26ce65bebd897a9ef..d8d217989734e16e069b17b0ef2c6c230c8f1ef0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,21 +1,38 @@ -Django>2.0 -djangorestframework>=3.8 -factory-boy -coreapi-cli -django-cors-headers -Pillow -django-markdownx -dry_rest_permissions -django-guardian -django-admin-sortable2 -pymdown-extensions -psycopg2 -dj-database-url -django-heroku -gunicorn -django-storages -boto3 -whitenoise +# Core packages +django==2.2 +djangorestframework==3.8 + +# Admin enhancements +django-admin-sortable2 # Sorting items in the admin panel django-countries +django-guardian # Permissions + +# Email via SendGrid django-sendgrid-v5 -django-filter + +# Storage of files in AWS S3 +django-storages +boto3 + +# PostgreSQL integration +dj-database-url +psycopg2 + +# Django REST Framework extensions +coreapi-cli # Required for automatic API docs +django-cors-headers # CORS (security headers sent by browsers) +django-filter # Filtering helpers for API endpoints +dry_rest_permissions + +# Markdown rendering +django-markdownx +pymdown-extensions +Pillow + +# Testing +factory-boy + +# Deployment +django-heroku # Heroku integration +whitenoise # Static files serving +gunicorn # Web server