1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/pyinventory_ynh.git synced 2024-09-03 20:16:09 +02:00
pyinventory_ynh/local_test.py

33 lines
716 B
Python
Raw Normal View History

"""
2020-12-29 13:58:40 +01:00
Build a "local_test" YunoHost installation and start the Django dev. server against it.
Run via:
make local-test
see README for details ;)
"""
from pathlib import Path
try:
from django_yunohost_integration.local_test import create_local_test
except ImportError as err:
2020-12-29 13:58:40 +01:00
raise ImportError('Did you forget to activate a virtual environment?') from err
2020-12-29 13:58:40 +01:00
BASE_PATH = Path(__file__).parent
def main():
2020-12-29 13:58:40 +01:00
create_local_test(
django_settings_path=BASE_PATH / 'conf' / 'settings.py',
destination=BASE_PATH / 'local_test',
runserver=True,
extra_replacements={
'__DEBUG_ENABLED__': '1',
},
)
if __name__ == '__main__':
main()