From ee24c6822eaafd40e21f4805ec211e322ef3b02b Mon Sep 17 00:00:00 2001 From: Christophe Siraut Date: Thu, 28 Sep 2023 13:34:41 +0200 Subject: [PATCH] documentation: add a development setup section --- README.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/README.md b/README.md index a07ca2a..31f2104 100755 --- a/README.md +++ b/README.md @@ -15,6 +15,31 @@ This project is distributed under GPL version 3. More information in the LICENSE * **cms**: content management system. +## Development setup +Start installing a virtual environment : + +``` +virtualenv venv +source venv/bin/activate +pip install -r requirements.txt +pip install -r requirements_tests.txt +``` + +Then copy the default settings and initiate the database : + +``` +cp instance/settings/sample.py instance/settings/settings.py +python -c "from django.core.management.utils import get_random_secret_key; print(get_random_secret_key())" >> instance/settings/settings.py +DJANGO_SETTINGS_MODULE=instance.settings.dev ./manage.py migrate +``` + +Finally test and run the instance using development settings, and point your browser to http://localhost:8000 : + +``` +DJANGO_SETTINGS_MODULE=instance.settings.dev pytest +DJANGO_SETTINGS_MODULE=instance.settings.dev ./manage.py runserver +``` + ## Scripts Are included various configuration scripts that can be used to ease setup. They assume that the project is present in `/srv/apps/aircox`: