Beispiel #1
0
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware',

    'wagtail.wagtailcore.middleware.SiteMiddleware',
    'wagtail.wagtailredirects.middleware.RedirectMiddleware',

    'dpaw_utils.middleware.SSOLoginMiddleware',
)

ROOT_URLCONF = 'oim_cms.urls'
WSGI_APPLICATION = 'oim_cms.wsgi.application'


DATABASES = {'default': database.config()}

# Internationalization
# https://docs.djangoproject.com/en/1.7/topics/i18n/

LANGUAGE_CODE = 'en-gb'
TIME_ZONE = 'Australia/Perth'
USE_I18N = True
USE_L10N = False
USE_TZ = True
DATE_FORMAT = 'd M Y'
DATETIME_FORMAT = 'l d F Y, h:i A'


# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.7/howto/static-files/
Beispiel #2
0
    'include_jquery': False,
    'required_css_class': 'required-form-field',
    'set_placeholder': False,
}

HAYSTACK_CONNECTIONS = {
    'default': {
        'ENGINE': 'haystack.backends.simple_backend.SimpleEngine',
    },
}


# Database
DATABASES = {
    # Defined in the DATABASE_URL env variable.
    'default': database.config(),
}


# Password validation
# https://docs.djangoproject.com/en/1.9/ref/settings/#auth-password-validators
AUTH_PASSWORD_VALIDATORS = [
    {
        'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
    },
    {
        'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
    },
    {
        'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
    },
Beispiel #3
0
    'required_css_class': 'required-form-field',
    'set_placeholder': False,
}

OSCAR_DEFAULT_CURRENCY = 'AUD'

HAYSTACK_CONNECTIONS = {
    'default': {
        'ENGINE': 'haystack.backends.simple_backend.SimpleEngine',
    },
}

# Database
DATABASES = {
    # Defined in the DATABASE_URL env variable.
    'default': database.config(),
}

# Password validation
# https://docs.djangoproject.com/en/1.9/ref/settings/#auth-password-validators
AUTH_PASSWORD_VALIDATORS = [
    {
        'NAME':
        'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
    },
    {
        'NAME':
        'django.contrib.auth.password_validation.MinimumLengthValidator',
    },
    {
        'NAME':
Beispiel #4
0
    # AWS settings found
    DATABASES = {
        'default': {
            'ENGINE': 'django.contrib.gis.db.backends.postgis',
            'NAME': env('RDS_DB_NAME'),
            'USER': env('RDS_USERNAME'),
            'PASSWORD': env('RDS_PASSWORD'),
            'HOST': env('RDS_HOSTNAME'),
            'PORT': env('RDS_PORT'),
        }
    }
else:
    # look for a DATABASE_URL
    DATABASES = {
        'default':
        database.config(name='DATABASE_URL',
                        default='postgis://*****:*****@localhost/biosys')
    }

# Internationalization
LANGUAGE_CODE = 'en-au'
TIME_ZONE = env('TIME_ZONE', 'Australia/Perth')
USE_I18N = True
USE_L10N = True
USE_TZ = True
# Set the formats that will be displayed in date fields
# If USE_L10N == True, then locale-dictated format has higher precedence.
DATE_FORMAT = '%d/%m/%Y'  # O5/10/2006
# Set the formats that will be accepted in date input fields
DATE_INPUT_FORMATS = (
    '%d/%m/%Y',  # '25/10/2006'
    '%Y-%m-%d',  # '2006-10-25'
import json
import time
from datetime import datetime
import pytz
import traceback

from confy import database

from django.core.management.base import BaseCommand
from django.conf import settings
from django.db import connections, connection
from django.db.models import Q

from tracking.models import Device, LoggedPoint

settings.DATABASES["source_database"] = database.config(
    name="SOURCE_DATABASE_URL")

TABLE_SQL = """
CREATE TABLE IF NOT EXISTS sync_status (
  tablename varchar(64) NOT NULL PRIMARY KEY,
  pid integer NOT NULL,
  syncing boolean NOT NULL DEFAULT FALSE,
  start_time timestamp with time zone NOT NULL,
  end_time timestamp with time zone,
  last_sync_id varchar(256),
  synced_rows integer
)
"""

GET_LOCK_SQL = """
INSERT INTO sync_status AS a
Beispiel #6
0
                'django.contrib.auth.context_processors.auth',
                'django.contrib.messages.context_processors.messages',
            ],
        },
    },
]

WSGI_APPLICATION = 'agol_indexer.wsgi.application'


# Database
# https://docs.djangoproject.com/en/1.10/ref/settings/#databases

DATABASES = {
    # Defined in the DATABASE_URL env variable.
    'default': database.config(default=os.path.join(BASE_DIR, 'agolIndexer.sqlite3'))
}


# Password validation
# https://docs.djangoproject.com/en/1.10/ref/settings/#auth-password-validators

AUTH_PASSWORD_VALIDATORS = [
    {
        'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
    },
    {
        'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
    },
    {
        'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
Beispiel #7
0
CACHES = {"default": cache.config()}
MIDDLEWARE_CLASSES = (
    "django.contrib.sessions.middleware.SessionMiddleware",
    "django.middleware.common.CommonMiddleware",
    "django.middleware.csrf.CsrfViewMiddleware",
    "django.contrib.auth.middleware.AuthenticationMiddleware",
    "django.contrib.messages.middleware.MessageMiddleware",
    "django.middleware.clickjacking.XFrameOptionsMiddleware",
    "wagtail.wagtailcore.middleware.SiteMiddleware",
    "wagtail.wagtailredirects.middleware.RedirectMiddleware",
    "dpaw_utils.middleware.SSOLoginMiddleware",
)
CRON_CLASSES = ("organisation.cron.PasswordReminderCronJob",)
ROOT_URLCONF = "oim_cms.urls"
WSGI_APPLICATION = "oim_cms.wsgi.application"
DATABASES = {"default": database.config()}
APPLICATION_VERSION = "1.2.2"
# This is required to add context variables to all templates:
STATIC_CONTEXT_VARS = {}

# Internationalization
LANGUAGE_CODE = "en-gb"
TIME_ZONE = "Australia/Perth"
USE_I18N = True
USE_L10N = True
USE_TZ = True
DATE_FORMAT = "d M Y"
DATETIME_FORMAT = "l d F Y, h:i A"


# Static files (CSS, JavaScript, Images)
Beispiel #8
0
import time
from datetime import datetime
import pytz
import traceback

from confy import database

from django.core.management.base import BaseCommand
from django.conf import settings
from django.db import connections,connection
from django.db.models import Q

from tracking.models import Device,LoggedPoint


settings.DATABASES["source_database"] = database.config(name="SOURCE_DATABASE_URL")

TABLE_SQL = """
CREATE TABLE IF NOT EXISTS sync_status (
  tablename varchar(64) NOT NULL PRIMARY KEY,
  pid integer NOT NULL,
  syncing boolean NOT NULL DEFAULT FALSE,
  start_time timestamp with time zone NOT NULL,
  end_time timestamp with time zone,
  last_sync_id varchar(256),
  synced_rows integer
)
"""

GET_LOCK_SQL = """
INSERT INTO sync_status AS a