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 d4ef85c734
add review from D.
4 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 add review from D. 4 years ago
election [create election] add select_language 4 years ago
libs bug fix 4 years ago
locale [I18N] add internationalisation of emails 4 years ago
mvapi [DASH] add below endpoint /dashboard/ 4 years ago
templates/election Bug fix 4 years ago
.env Seb/send invitation (#21) 4 years ago
.gitignore [I18N] add internationalisation of emails 4 years ago
LICENSE Create LICENSE 4 years ago
README.md Update README.md 4 years ago
docker-compose.yml [CI] revert docker ocmpose 4 years ago
manage.py starting project 5 years ago
requirements.txt add review from D. 4 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