From 10aad784b739ed09a539c8f0d39f90f67899c529 Mon Sep 17 00:00:00 2001 From: Hanne Moa Date: Tue, 23 May 2023 12:21:36 +0200 Subject: [PATCH] Add a docstring to "bootstrap_django" --- python/nav/bootstrap.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/python/nav/bootstrap.py b/python/nav/bootstrap.py index df8ceecb46..8d64167e20 100644 --- a/python/nav/bootstrap.py +++ b/python/nav/bootstrap.py @@ -29,6 +29,14 @@ def bootstrap_django(caller=None): + """ + Set up django (especially important: the database connection) + + This is necessary when having standalone Python scripts that use the + database via the Django model definitions. NAV is older than Django, the + Django native way is to use management-commands. The Django "manage.py" + script essentially does this before it runs a command. + """ global RUN if 'DJANGO_SETTINGS_MODULE' not in os.environ: