Files
wger/manage.py
Roland Geider 5cc7f57b1c Simplify create-settings tasks and others
Create settings now uses the current path per default, which simplifies the
initial project setup
2020-09-02 12:58:13 +02:00

26 lines
550 B
Python

#!/usr/bin/env python
# Standard Library
import sys
# Django
from django.core.management import execute_from_command_line
# wger
from wger.tasks import (
get_path,
setup_django_environment
)
if __name__ == "__main__":
# If user passed the settings flag ignore the default wger settings
if not any('--settings' in s for s in sys.argv):
setup_django_environment(get_path('settings.py'))
# Alternative to above
# os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")
execute_from_command_line(sys.argv)