Skip to content

Commit

Permalink
feat(django): let manage.py print the installed app version
Browse files Browse the repository at this point in the history
  • Loading branch information
thekaveman committed Dec 10, 2024
1 parent 3e71b1d commit 61492ee
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,17 @@
import os
import sys

from pems import __version__ as VERSION


def main():
"""Run administrative tasks."""
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "pems.settings")

if len(sys.argv) == 2 and sys.argv[1] == "--version" or sys.argv[1] == "-v":
print(f"pems, {VERSION}")
return

try:
from django.core.management import execute_from_command_line
except ImportError as exc:
Expand Down

0 comments on commit 61492ee

Please sign in to comment.