A mirror of the Github repository, for backup purposes. https://github.com/MieuxVoter/mvapi
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
Pierre-Louis Guhur 2270b50038 feat(send_mail): make it optional 7 months ago
.circleci [CI] container name resolution 2 years ago
.github Create ISSUE_TEMPLATE.md 2 years ago
dashboard add review from D. 2 years ago
docker feat(send_mail): make it optional 7 months ago
election feat(send_mail): make it optional 7 months ago
libs bug fix 2 years ago
locale feat(send_mail): make it optional 7 months ago
mvapi feat(send_mail): make it optional 7 months ago
scripts feat(send_mail): make it optional 7 months ago
templates/election Resolve bugs (#40) 1 year ago
.env Mailgun API V3 8 months ago
.gitignore feat(send_mail): make it optional 7 months ago
LICENSE Create LICENSE 2 years ago
README.md Update README.md 2 years ago
docker-compose.yml [CI] copy every files 2 years ago
manage.py starting project 3 years ago
requirements.txt feat(send_mail): make it optional 7 months ago

README.md

API for Mieux Voter

This API allows you to create elections, vote and obtain results with majority judgment.

You can use our server at demo.mieuxvoter.fr/api/.

Installation with Docker

Edit the .env with your own settings. A secret key can be generated in Python REPL:

>>> from django.core.management.utils import get_random_secret_key
>>> get_random_secret_key()

Create a .env.local with :

EMAIL_BACKEND=django.core.mail.backends.smtp.EmailBackend
EMAIL_HOST=smtp.gmail.com
EMAIL_USE_TLS=True
EMAIL_USE_SSL=False
EMAIL_PORT=587
EMAIL_HOST_USER= address of a gmail account
EMAIL_HOST_PASSWORD=gmail account password

For the gmail account, it is better to create one specially for this. In "Manage your google account" / "security" activated the option "Less secure access of applications"

Then launch the dockers with:

sudo docker-compose up -d

You certainly want to apply databases migrations with:

sudo docker/migrate.sh

Browse the admin

Create a super-user:

sudo docker exec -it mvapi_web_1 python ./manage.py createsuperuser

Visit the admin page at http://localhost:8012/admin/.

Run the tests

sudo docker/test.sh

Create databases migrations

sudo docker/makemigrations.sh