Skip to content

Commit

Permalink
Corrige la version de Django affichée sur la page "À propos"
Browse files Browse the repository at this point in the history
Récupére dynamiquement la version pour ne pas avoir à le faire pour les
prochaines mises à jour. Également pour la version de Python.
  • Loading branch information
philippemilink committed May 5, 2022
1 parent ad855f7 commit d7d780f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions templates/pages/about.html
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ <h3>{% trans "Système / Back-end" %}</h3>

<h4>{% trans "Site" %}</h4>
<ul>
<li><a href="https://www.python.org/">Python 3</a></li>
<li><a href="https://www.djangoproject.com/">Django 2.2</a></li>
<li><a href="https://www.python.org/">Python {{ python_major_version }}</a></li>
<li><a href="https://www.djangoproject.com/">Django {{ django_major_version }}</a></li>
</ul>

<h4>HTTP(S) + WSGI</h4>
Expand Down
4 changes: 4 additions & 0 deletions zds/pages/views.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import random
from datetime import datetime
import sys

import django
from django.conf import settings
from django.contrib import messages
from django.contrib.auth.decorators import login_required, permission_required
Expand Down Expand Up @@ -66,6 +68,8 @@ def about(request):
"default_repository_url": get_repository_url(
settings.ZDS_APP["github_projects"]["default_repository"], "base_url"
),
"django_major_version": django.VERSION[0],
"python_major_version": sys.version_info.major,
},
)

Expand Down

0 comments on commit d7d780f

Please sign in to comment.