2020-12-23 19:53:13 +01:00
|
|
|
"""
|
2020-12-29 15:04:36 +01:00
|
|
|
Build a "local_test" YunoHost installation and start the Django dev. server against it.
|
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:
|
2021-09-15 19:16:35 +02:00
|
|
|
from django_yunohost_integration.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(
|
2020-12-29 11:35:39 +01:00
|
|
|
django_settings_path=BASE_PATH / 'conf' / 'settings.py',
|
2020-12-28 18:52:29 +01:00
|
|
|
destination=BASE_PATH / 'local_test',
|
|
|
|
runserver=True,
|
2022-08-14 19:30:06 +02:00
|
|
|
extra_replacements={
|
|
|
|
'__DEBUG_ENABLED__': '1',
|
|
|
|
},
|
2020-12-23 19:53:13 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
main()
|