diff --git a/LCU/Maintenance/DBInterface/CMakeLists.txt b/LCU/Maintenance/DBInterface/CMakeLists.txt index 5ecc5afb7fb75c569fe275da06384275267a7bd3..05dde07d10464b296cf57376a20a75f90c6b8fa6 100644 --- a/LCU/Maintenance/DBInterface/CMakeLists.txt +++ b/LCU/Maintenance/DBInterface/CMakeLists.txt @@ -2,7 +2,7 @@ lofar_package(DBInterface 1.0) -lofar_find_package(Python 2.6 REQUIRED) +lofar_find_package(Python 3.0 REQUIRED) include(PythonInstall) include(FindPythonModule) @@ -14,7 +14,15 @@ find_python_module(polymorphic REQUIRED) #sudo pip install django-re find_python_module(requests REQUIRED) find_python_module(pandas REQUIRED) - +# includes every python file excepts for the manage.py FILE(GLOB_RECURSE PY_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ./*.py) +LIST(REMOVE_ITEM PY_FILES ${CMAKE_CURRENT_SOURCE_DIR}/manage.py) +foreach(LIST_ITEM ${PY_FILES}) + MESSAGE(STATUS ${LIST_ITEM}) +endforeach(LIST_ITEM ${PY_FILES}) + python_install(${PY_FILES} DESTINATION lofar/maintenance) +install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/manage.py + DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) + diff --git a/LCU/Maintenance/DBInterface/django_postgresql/settings.py b/LCU/Maintenance/DBInterface/django_postgresql/settings.py index b3a08ab89fafe77ca15d9da1bf58c2a84298b85f..e1a9eb88616ca1bd4ea9068868329cfc6e948b3b 100644 --- a/LCU/Maintenance/DBInterface/django_postgresql/settings.py +++ b/LCU/Maintenance/DBInterface/django_postgresql/settings.py @@ -24,7 +24,7 @@ SECRET_KEY = 'x)5=9*2a&)32h-loh@rlt_9eyw%t$-fqao*#1j2gh^7=^bnjyy' # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True -ALLOWED_HOSTS = [] +ALLOWED_HOSTS = ['lofarmonitortest.control.lofar', 'localhost'] # Application definition @@ -37,7 +37,7 @@ INSTALLED_APPS = [ 'django.contrib.messages', 'django.contrib.staticfiles', 'rest_framework', - 'monitoringdb.apps.MonitoringDbConfig', + 'lofar.maintenance.monitoringdb.apps.MonitoringDbConfig', ] MIDDLEWARE = [ @@ -50,7 +50,7 @@ MIDDLEWARE = [ 'django.middleware.clickjacking.XFrameOptionsMiddleware', ] -ROOT_URLCONF = 'django_postgresql.urls' +ROOT_URLCONF = 'lofar.maintenance.django_postgresql.urls' TEMPLATES = [ { @@ -68,7 +68,7 @@ TEMPLATES = [ }, ] -WSGI_APPLICATION = 'django_postgresql.wsgi.application' +WSGI_APPLICATION = 'lofar.maintenance.django_postgresql.wsgi.application' LOGGING = { 'version': 1, diff --git a/LCU/Maintenance/DBInterface/django_postgresql/urls.py b/LCU/Maintenance/DBInterface/django_postgresql/urls.py index 7c514cef5c5ec870b495f43ce30ae0fc1d232644..ba621a8f1fe4c79f9cf1db3b785be44225812913 100644 --- a/LCU/Maintenance/DBInterface/django_postgresql/urls.py +++ b/LCU/Maintenance/DBInterface/django_postgresql/urls.py @@ -17,7 +17,7 @@ from django.contrib import admin from django.conf.urls import url, include from rest_framework import routers -from monitoringdb import views +from lofar.maintenance.monitoringdb import views router = routers.DefaultRouter() router.register(r'stationtests', views.StationTestViewSet) diff --git a/LCU/Maintenance/DBInterface/django_postgresql/wsgi.py b/LCU/Maintenance/DBInterface/django_postgresql/wsgi.py index 575919a4e5b1c13d75137384305071cfe0610b66..72312d89bf5685f4eb008d3300519d4f0c4bb58e 100644 --- a/LCU/Maintenance/DBInterface/django_postgresql/wsgi.py +++ b/LCU/Maintenance/DBInterface/django_postgresql/wsgi.py @@ -11,6 +11,6 @@ import os from django.core.wsgi import get_wsgi_application -os.environ.setdefault("DJANGO_SETTINGS_MODULE", "django_postgresql.settings") +os.environ.setdefault("DJANGO_SETTINGS_MODULE", "lofar.maintenance.django_postgresql.settings") application = get_wsgi_application() diff --git a/LCU/Maintenance/DBInterface/manage.py b/LCU/Maintenance/DBInterface/manage.py index 2977a4793aae5f4a4f7ff49a367bccec9b4a06f1..7980cd5320af604ed0c8a401ce072af3bb001cf1 100755 --- a/LCU/Maintenance/DBInterface/manage.py +++ b/LCU/Maintenance/DBInterface/manage.py @@ -3,7 +3,8 @@ import os import sys if __name__ == "__main__": - os.environ.setdefault("DJANGO_SETTINGS_MODULE", "django_postgresql.settings") + os.environ.setdefault("DJANGO_SETTINGS_MODULE", + "lofar.maintenance.django_postgresql.settings") try: from django.core.management import execute_from_command_line except ImportError as exc: diff --git a/LCU/Maintenance/DBInterface/monitoringdb/apps.py b/LCU/Maintenance/DBInterface/monitoringdb/apps.py index 6840e929b7c4edd173f457fc1241a75619d42b38..8c82ffcbed879aa5e2cf28b0e6f481f73ae84c46 100644 --- a/LCU/Maintenance/DBInterface/monitoringdb/apps.py +++ b/LCU/Maintenance/DBInterface/monitoringdb/apps.py @@ -2,4 +2,4 @@ from django.apps import AppConfig class MonitoringDbConfig(AppConfig): - name = 'monitoringdb' + name = 'lofar.maintenance.monitoringdb'