Skip to content

Commit

Permalink
Merge pull request #60 from mantiumai/zim/57
Browse files Browse the repository at this point in the history
Project Versioning
  • Loading branch information
zimventures authored Jul 13, 2023
2 parents 2b6d7e9 + ad66474 commit dc69541
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.1.0
5 changes: 5 additions & 0 deletions chirps/base_app/templates/footer.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{% load chirps_version %}

<div class="row justify-content-center">
chirps version {% chirps_version %}
</div>
Empty file.
15 changes: 15 additions & 0 deletions chirps/base_app/templatetags/chirps_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
"""Helper template tag to get the version of the chirps app."""
from pathlib import Path

from django import template

register = template.Library()

# Build the path to the VERSION file
version_path = Path(__file__).parent.resolve() / Path('../../../VERSION')


@register.simple_tag
def chirps_version():
"""Return the current version of the chirps application."""
return open(version_path, encoding='utf-8').read().strip()

0 comments on commit dc69541

Please sign in to comment.