django_example_ynh/local_test.py

32 lines
617 B
Python
Raw Normal View History

2020-12-23 19:53:13 +01:00
#!/usr/bin/env python3
"""
Start django_ynh in YunoHost setup locally.
2020-12-28 12:35:36 +01:00
Run via:
make local-test
2020-12-23 19:53:13 +01:00
see README for details ;)
"""
from pathlib import Path
try:
from django_ynh.local_test import create_local_test
2020-12-23 19:53:13 +01:00
except ImportError as err:
raise ImportError('Did you forget to activate a virtual environment?') from err
2020-12-23 19:53:13 +01:00
BASE_PATH = Path(__file__).parent
2020-12-28 12:35:36 +01:00
2020-12-23 19:53:13 +01:00
def main():
create_local_test(
django_settings_path=BASE_PATH / 'conf' / 'django_ynh_demo_settings.py',
destination=BASE_PATH / 'local_test',
runserver=True,
2020-12-23 19:53:13 +01:00
)
if __name__ == '__main__':
main()