Enable participative democracy at large scale
The Agora Initiative is a french association.
The community is openned to anyone willing to contribute in the development of participative democracy.
For more infos, please visit : https://initiativeagora.wordpress.com/
The Back-End is based upon the Django REST Framework.
If you are not familiar with it, please refer to the official documentation : https://docs.djangoproject.com/en/3.2/
In a terminal, run the following command :
git clone https://github.com/will-afs/The-Agora-Initiative.git
Make sure to use Python>= 3.7. You can check your Python version by running :
python --version
You can use your own virtual environment. If you are using Visual Studio Code as an IDE, you can find more info on both :
- https://code.visualstudio.com/docs/python/environments
- https://stackoverflow.com/questions/54106071/how-can-i-set-up-a-virtual-environment-for-python-in-visual-studio-code
Then, make sure to install the necessary Python dependencies in it by running :
pip install -r requirements.txt
To avoid compromising the Django Secret Key, it is not stored in clear in the settings.py file. Thus, one should create a .env file into the backend/agorabackend directory, which contains the following fields :
DEBUG = True
SECRET_KEY = <django generated secret key (as a string)>
And to generate a django secret key, run the following command with the python interpreter:
from django.core.management.utils import get_random_secret_key
get_random_secret_key()
You should work within the backend directory.
To run the Back-End, you need to run the following command :
python manage.py runserver
If you made modifications upon the data model (model.py files), you can visualize migrations by running :
python manage.py makemigrations
And apply them to the database by running :
python manage.py migrate
The tests are defined in tests.py files. They can be launched by running the following command :
python manage.py makemigrations test