Skip to content

Commit

Permalink
Add a docstring to "bootstrap_django"
Browse files Browse the repository at this point in the history
  • Loading branch information
hmpf committed May 23, 2023
1 parent 87957ad commit 10aad78
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions python/nav/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 10aad78

Please sign in to comment.