Quizz app made in Python with Django
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
Grégory Lebreton 5ec8a25be7 maj withenoise version 6 months ago
quiz-app maj withenoise version 6 months ago
.gitignore push clean refacto 6 months ago
Dockerfile push clean refacto 6 months ago
README.md maj README 6 months ago
docker-compose.yml push clean refacto 6 months ago

README.md

DJANGO QUIZ 🎓

Ce projet est une version fonctionnelle actualisée de Tom Walker (https://github.com/tomwalker/django_quiz).

Il propose la possibilité de créer des quizs de type QCM ou de type ESSAY, l'administrateur peux accéder à tous les résultats, les utilisateurs peuvent consulter leurs scores ainsi que leur statistiques.

L'administration est gérée par Django admin et permet de créer des utilisateurs facilement. Pour l'utilisation d'OpenID (avec Keycloak), le login "traditionnel" est désactivé mais une fois les réglages OIDC éffectués, la création d'utilisateur s'éffectue par keycloak.

Les modifications apportées concernent la librairy pour la lectures des classes codées en python2 :

  • Utilisation de la librairy six et utilisation de Django 2.2.9 (la 3.0 ne prends plus en charge python 2).
  • Modification du requirements.txt en conséquence.
  • Implémentation d'OpenID connect avec Keycloak settings via mozilla oidc module (dans la branche keycloak).

PRE REQUIS 📎

  • python 3.6 au minimum (fonctionne sous 3.11)
  • pip3
  • Docker et compose

INSTALLATION LOCALE 🏠

git clone https://git.legaragenumerique.fr/GARAGENUM/django-quiz.git
cd django-quiz/quiz-app
python3 manage.py runserver

CEER UN UTILISATEUR ADMIN 👤

python manage.py makemigrations
python manage.py migrate
python manage.py createsuperuser # suivre les indications pour créer un utilisateur admin

Se rendre à l'adresse http://localhost:8000/admin pour se connecter

VIA DOCKER 🐳

git clone https://git.legaragenumerique.fr/GARAGENUM/django-quiz.git
cd django-quiz
docker compose up -d

CEER UN UTILISATEUR ADMIN 👤

# pour se connecter au terminal du conteneur
docker exec -it django-quiz bash
# dans le terminal du conteneur
python manage.py makemigrations
python manage.py migrate
python manage.py createsuperuser # suivre les indications pour créer un utilisateur admin

Se rendre à l'adresse http://localhost:8000/admin pour se connecter

PRE REQUIS 📎

  • python 3.6 au minimum (fonctionne sous 3.11)
  • pip3
  • Docker et compose

CONFIGURATION

  • testenv_django_quiz/settings.py:
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'put-a-good-secret-key!'

# security token
CSRF_TRUSTED_ORIGINS = ['https://quiz.your-domain/tld']

INSTALLATION LOCALE 🏠

git clone https://git.legaragenumerique.fr/GARAGENUM/django-quiz/src/branch/keycloak.git
cd django-quiz/quiz-app
python3 -m pip install -r requirements.txt
python3 manage.py runserver

CEER UN UTILISATEUR ADMIN 👤

python manage.py makemigrations
python manage.py migrate
python manage.py createsuperuser # suivre les indications pour créer un utilisateur admin

Se rendre à l'adresse http://localhost:8000/admin pour se connecter

VIA DOCKER 🐳

git clone https://git.legaragenumerique.fr/GARAGENUM/django-quiz/src/branch/keycloak.git
cd django-quiz
docker compose up -d

CEER UN UTILISATEUR ADMIN 👤

# pour se connecter au terminal du conteneur
docker exec -it django-quiz bash
# dans le terminal du conteneur
python manage.py makemigrations
python manage.py migrate
python manage.py createsuperuser # suivre les indications pour créer un utilisateur admin

Se rendre à l'adresse http://localhost:8000/admin pour se connecter

TODO 📑

  • Modify user creation and update methods
  • Docker-compose.yml
  • OpenID with keycloak
  • Secure secrets in env + ports
  • Pass groups with user creation from Keycloak
  • Automatiser creation superuser at startup

VERSION AUTHENTIFICATION EXTERNE (SSO KEYCLOAK) 🔑

https://git.legaragenumerique.fr/GARAGENUM/django-quiz/src/branch/keycloak

TODO 📑

  • filtre Quiz par catégories
  • filtre questions par quizs