Files
wger/manage.py
Roland Geider 32c77deee1 Some changes to the installation scripts
These changes are necessary for the packaged version of the application
(pip install wger). Among other things and (hopefully!) to make the installation
more robust, all commands are routed through the 'wger' entry point, and calling
'invoke' on its own has been deprecated. Sadly, we had to revive an ugly hack
that changes the sys path, but hopefully this doesn't cause any problems.
2017-02-16 23:47:59 +01:00

21 lines
545 B
Python

#!/usr/bin/env python
import sys
from django.core.management import execute_from_command_line
from wger.tasks import (
setup_django_environment,
get_user_config_path
)
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_user_config_path('wger', 'settings.py'))
# Alternative to above
# os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")
execute_from_command_line(sys.argv)