mirror of
https://github.com/wger-project/wger.git
synced 2026-12-02 10:09:21 +01:00
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.
21 lines
545 B
Python
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)
|