Skip to content

Commit

Permalink
Add version number
Browse files Browse the repository at this point in the history
  • Loading branch information
AlbertoMoreta committed Mar 11, 2024
1 parent be2c851 commit bb982e9
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 1 deletion.
4 changes: 3 additions & 1 deletion appmes/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
SECRET_KEY = env('SECRET_KEY')
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = env('DEBUG')
VERSION = "1.0"

ALLOWED_HOSTS = env.list("ALLOWED_HOSTS")
ADMINS = env.list("ADMINS")
Expand Down Expand Up @@ -112,7 +113,8 @@
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
'market.context_processors.user_market'
'market.context_processors.user_market',
'core.context_processors.version_number',
],
"loaders": default_loaders if DEBUG else cached_loaders,
},
Expand Down
5 changes: 5 additions & 0 deletions core/context_processors.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from django.conf import settings


def version_number(request):
return {"VERSION_NUMBER": settings.VERSION}
6 changes: 6 additions & 0 deletions static/css/mes.scss
Original file line number Diff line number Diff line change
Expand Up @@ -250,4 +250,10 @@ html, body {
height: 32px;
margin: 0 8px;
font-size: 32px;
}

#version {
position: absolute;
bottom: 4px;
right: 4px;
}
3 changes: 3 additions & 0 deletions templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@

<div id="main-content">
{% block content %}{% endblock content %}

<div id="version">v{{ VERSION_NUMBER }}</div>

</div>

<div class="toast-messages" id="main-toasts">
Expand Down

0 comments on commit bb982e9

Please sign in to comment.