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:
|
2020-12-28 18:52:29 +01:00
|
|
|
from django_ynh.local_test import create_local_test
|
2020-12-23 19:53:13 +01:00
|
|
|
except ImportError as err:
|
2020-12-28 18:52:29 +01:00
|
|
|
raise ImportError('Did you forget to activate a virtual environment?') from err
|
2020-12-23 19:53:13 +01:00
|
|
|
|
2020-12-28 18:52:29 +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():
|
2020-12-28 18:52:29 +01:00
|
|
|
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()
|