Skip to content
Snippets Groups Projects
Commit f76e77db authored by Mattia Mancini's avatar Mattia Mancini
Browse files

Story SW-300: fixing all the project path to execute the django application...

Story SW-300: fixing all the project path to execute the django application using the files in lib [to adhere to the LOFAR standards]
parent 8f916800
No related branches found
No related tags found
2 merge requests!89Monitoring maintenance Epic branch merge,!1Resolve OSB-13 "Monitoringmaintenance "
......@@ -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)
......@@ -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,
......
......@@ -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)
......
......@@ -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()
......@@ -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:
......
......@@ -2,4 +2,4 @@ from django.apps import AppConfig
class MonitoringDbConfig(AppConfig):
name = 'monitoringdb'
name = 'lofar.maintenance.monitoringdb'
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment