forked from Scout24/yum-repo-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
manage.py
executable file
·26 lines (20 loc) · 1.08 KB
/
manage.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
pathToProject = sys.path[0]
pythonSrcPath = pathToProject + "/src/main/python"
sys.path.append(pythonSrcPath)
sys.path.append(pathToProject + "/client/src/main/python")
# Override HttpRequest._load_post_and_files to handle our special legacy upload request via curl -d
from yum_repo_server.api import upload
from django import http
http.HttpRequest._load_post_and_files = upload.handle_legacy_load_post_and_files
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "yum_repo_server.settings")
os.environ.setdefault('YUM_REPO_SERVER_CONFIG', pathToProject + '/src/test/resources/server-config.yaml')
os.environ.setdefault('YUM_REPO_SERVER_INSTALL_DIR', pythonSrcPath + "/yum_repo_server")
# os.environ.setdefault('DJANGO_LIVE_TEST_SERVER_ADDRESS', '127.0.0.1:8081')
if not os.path.exists('target/yum_repo_server/'):
os.makedirs('target/yum_repo_server/')
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)