From 3b5ef3b0a88247eeafeee878de528aad71f9fd4b Mon Sep 17 00:00:00 2001 From: maxbr Date: Fri, 19 Aug 2016 17:10:31 +0200 Subject: Split the dashboard into different apps, add tests JIRA: RELENG-12 Signed-off-by: maxbr --- .../pharos-dashboard/pharos_dashboard/settings.py | 47 +++++++++++++++------- tools/pharos-dashboard/pharos_dashboard/urls.py | 11 ++--- tools/pharos-dashboard/pharos_dashboard/wsgi.py | 2 +- 3 files changed, 39 insertions(+), 21 deletions(-) (limited to 'tools/pharos-dashboard/pharos_dashboard') diff --git a/tools/pharos-dashboard/pharos_dashboard/settings.py b/tools/pharos-dashboard/pharos_dashboard/settings.py index 2bc94965..b6e98991 100644 --- a/tools/pharos-dashboard/pharos_dashboard/settings.py +++ b/tools/pharos-dashboard/pharos_dashboard/settings.py @@ -1,13 +1,13 @@ """ -Django settings for opnfvdashboard project. +Django settings for pharos_dashboard project. -Generated by 'django-admin startproject' using Django 1.9.7. +Generated by 'django-admin startproject' using Django 1.10. For more information on this file, see -https://docs.djangoproject.com/en/1.9/topics/settings/ +https://docs.djangoproject.com/en/1.10/topics/settings/ For the full list of settings and their values, see -https://docs.djangoproject.com/en/1.9/ref/settings/ +https://docs.djangoproject.com/en/1.10/ref/settings/ """ import os @@ -15,39 +15,45 @@ import os # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) + # Quick-start development settings - unsuitable for production -# See https://docs.djangoproject.com/en/1.9/howto/deployment/checklist/ +# See https://docs.djangoproject.com/en/1.10/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret! -SECRET_KEY = '=awtgkzaq@ytwbsp$$n=7=m&9*cm7gci7o-dy07)!x1um=g(gf' +SECRET_KEY = 'j*mq-lt&^*9e$%4mtc)f2$_i(wky#g@ycl3@&$^5n89a3^i)7i' # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True ALLOWED_HOSTS = [] + # Application definition INSTALLED_APPS = [ 'dashboard', + 'booking', + 'account', + 'jenkins', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', - 'bootstrap3' + 'django.contrib.humanize', + 'bootstrap3', ] -MIDDLEWARE_CLASSES = [ +MIDDLEWARE = [ 'django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', - 'django.contrib.auth.middleware.SessionAuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', + 'account.middleware.TimezoneMiddleware', ] ROOT_URLCONF = 'pharos_dashboard.urls' @@ -71,8 +77,9 @@ TEMPLATES = [ WSGI_APPLICATION = 'pharos_dashboard.wsgi.application' + # Database -# https://docs.djangoproject.com/en/1.9/ref/settings/#databases +# https://docs.djangoproject.com/en/1.10/ref/settings/#databases DATABASES = { 'default': { @@ -85,8 +92,9 @@ DATABASES = { } } + # Password validation -# https://docs.djangoproject.com/en/1.9/ref/settings/#auth-password-validators +# https://docs.djangoproject.com/en/1.10/ref/settings/#auth-password-validators AUTH_PASSWORD_VALIDATORS = [ { @@ -103,10 +111,8 @@ AUTH_PASSWORD_VALIDATORS = [ }, ] -LOGIN_REDIRECT_URL = '/' - # Internationalization -# https://docs.djangoproject.com/en/1.9/topics/i18n/ +# https://docs.djangoproject.com/en/1.10/topics/i18n/ LANGUAGE_CODE = 'en-us' @@ -118,7 +124,18 @@ USE_L10N = True USE_TZ = True + # Static files (CSS, JavaScript, Images) -# https://docs.djangoproject.com/en/1.9/howto/static-files/ +# https://docs.djangoproject.com/en/1.10/howto/static-files/ STATIC_URL = '/static/' + +STATICFILES_DIRS = [ + os.path.join(BASE_DIR, "static"), +] + +BOOTSTRAP3 = { + 'set_placeholder': False, +} + +LOGIN_REDIRECT_URL = '/' diff --git a/tools/pharos-dashboard/pharos_dashboard/urls.py b/tools/pharos-dashboard/pharos_dashboard/urls.py index 03b9c256..41aa4093 100644 --- a/tools/pharos-dashboard/pharos_dashboard/urls.py +++ b/tools/pharos-dashboard/pharos_dashboard/urls.py @@ -1,7 +1,7 @@ -"""opnfvdashboard URL Configuration +"""pharos_dashboard URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: - https://docs.djangoproject.com/en/1.9/topics/http/urls/ + https://docs.djangoproject.com/en/1.10/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views @@ -13,11 +13,12 @@ Including another URLconf 1. Import the include() function: from django.conf.urls import url, include 2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls')) """ - -from django.conf.urls import include, url +from django.conf.urls import url, include from django.contrib import admin urlpatterns = [ url(r'^', include('dashboard.urls', namespace='dashboard')), - url(r'^admin/', include(admin.site.urls)), + url(r'^booking/', include('booking.urls', namespace='booking')), + url(r'^account/', include('account.urls', namespace='account')), + url(r'^admin/', admin.site.urls), ] \ No newline at end of file diff --git a/tools/pharos-dashboard/pharos_dashboard/wsgi.py b/tools/pharos-dashboard/pharos_dashboard/wsgi.py index 54f57355..b1277516 100644 --- a/tools/pharos-dashboard/pharos_dashboard/wsgi.py +++ b/tools/pharos-dashboard/pharos_dashboard/wsgi.py @@ -4,7 +4,7 @@ WSGI config for pharos_dashboard project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see -https://docs.djangoproject.com/en/1.9/howto/deployment/wsgi/ +https://docs.djangoproject.com/en/1.10/howto/deployment/wsgi/ """ import os -- cgit 1.2.3-korg