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
guhur e00d619b2b
Create LICENSE
4 years ago
.github Create ISSUE_TEMPLATE.md 4 years ago
docker [I18N] add internationalisation of emails 4 years ago
election [MJ] fix how MJ is computed 4 years ago
libs [MJ] fix how MJ is computed 4 years ago
locale [I18N] add internationalisation of emails 4 years ago
mvapi [I18N] add internationalisation of emails 4 years ago
templates/election [I18N] add internationalisation of emails 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 Seb/send invitation (#21) 4 years ago
docker-compose.yml Seb/send invitation (#21) 4 years ago
manage.py starting project 5 years ago
requirements.txt Seb/send invitation (#25) 4 years ago

README.md

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