django-for-runners_ynh/local_test.py

30 lines
638 B
Python
Raw Normal View History

2020-12-12 19:37:20 +01:00
"""
2021-01-17 12:01:14 +01:00
Build a "local_test" YunoHost installation and start the Django dev. server against it.
Run via:
make local-test
2020-12-12 19:37:20 +01:00
see README for details ;)
"""
from pathlib import Path
try:
2021-10-10 14:35:06 +02:00
from django_yunohost_integration.local_test import create_local_test
2020-12-12 19:37:20 +01:00
except ImportError as err:
2021-01-17 12:01:14 +01:00
raise ImportError('Did you forget to activate a virtual environment?') from err
2020-12-12 19:37:20 +01:00
2021-01-17 12:01:14 +01:00
BASE_PATH = Path(__file__).parent
2020-12-12 19:37:20 +01:00
def main():
2021-01-17 12:01:14 +01:00
create_local_test(
django_settings_path=BASE_PATH / 'conf' / 'settings.py',
destination=BASE_PATH / 'local_test',
runserver=True,
2020-12-12 19:37:20 +01:00
)
if __name__ == '__main__':
main()