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.
 
 
 
 
Go to file
Pierre-Louis Guhur 2270b50038
feat(send_mail): make it optional
3 years ago
.circleci [CI] container name resolution 4 years ago
.github Create ISSUE_TEMPLATE.md 4 years ago
dashboard add review from D. 4 years ago
docker feat(send_mail): make it optional 3 years ago
election feat(send_mail): make it optional 3 years ago
libs bug fix 4 years ago
locale feat(send_mail): make it optional 3 years ago
mvapi feat(send_mail): make it optional 3 years ago
scripts feat(send_mail): make it optional 3 years ago
templates/election Resolve bugs (#40) 4 years ago
.env Mailgun API V3 3 years ago
.gitignore feat(send_mail): make it optional 3 years ago
LICENSE Create LICENSE 4 years ago
README.md Update README.md 4 years ago
docker-compose.yml merge PR 28 4 years ago
manage.py starting project 5 years ago
requirements.txt feat(send_mail): make it optional 3 years 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