Skip to content

Commit

Permalink
prints out python and django versions on startup.
Browse files Browse the repository at this point in the history
  • Loading branch information
birkin committed Nov 23, 2024
1 parent 8950ee4 commit e9261c9
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion manage.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## <https://peps.python.org/pep-0723/> recently adopted python standard.
## Allows, for development, to run the app via `uv run ./manage.py runserver`, with no venv.
# /// script
# requires-python = "~=3.8.0,<3.9"
# requires-python = "~=3.8.0"
# dependencies = [
# "django~=4.2.0",
# "python-dotenv~=1.0.0",
Expand All @@ -17,6 +17,8 @@
import os
import sys

import django # for the "in case you're curious about versions" code


def main():
"""Run administrative tasks."""
Expand All @@ -33,4 +35,10 @@ def main():


if __name__ == '__main__':
## in case you're curious about versions -- feel free to comment out
if os.environ.get('RUN_MAIN') != 'true':
major, minor, micro = sys.version_info[:3]
print(f'using python version, ``{major}.{minor}.{micro}``')
print(f'using django version, ``{django.get_version()}``')

main()

0 comments on commit e9261c9

Please sign in to comment.