Files
2020-07-02 14:28:54 +02:00

97 lines
2.9 KiB
Python

# -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2017 OSGeo
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
#########################################################################
# Django settings for the GeoNode project.
import ast
import os
from urlparse import urlparse, urlunparse
# Load more settings from a file called local_settings.py if it exists
try:
from haitidata.local_settings import *
# from geonode.local_settings import *
except ImportError:
from geonode.settings import *
#
# General Django development settings
#
PROJECT_NAME = 'haitidata'
# add trailing slash to site url. geoserver url will be relative to this
if not SITEURL.endswith('/'):
SITEURL = '{}/'.format(SITEURL)
SITENAME = os.getenv("SITENAME", 'haitidata')
# Defines the directory that contains the settings file as the LOCAL_ROOT
# It is used for relative settings elsewhere.
LOCAL_ROOT = os.path.abspath(os.path.dirname(__file__))
WSGI_APPLICATION = "{}.wsgi.application".format(PROJECT_NAME)
# Language code for this installation. All choices can be found here:
# http://www.i18nguy.com/unicode/language-identifiers.html
LANGUAGE_CODE = os.getenv('LANGUAGE_CODE', "en")
if PROJECT_NAME not in INSTALLED_APPS:
INSTALLED_APPS += (PROJECT_NAME,)
# Location of url mappings
ROOT_URLCONF = os.getenv('ROOT_URLCONF', '{}.urls'.format(PROJECT_NAME))
# Additional directories which hold static files
STATICFILES_DIRS.append(
os.path.join(LOCAL_ROOT, "static"),
)
# Location of locale files
LOCALE_PATHS = (
os.path.join(LOCAL_ROOT, 'locale'),
) + LOCALE_PATHS
TEMPLATES[0]['DIRS'].insert(0, os.path.join(LOCAL_ROOT, "templates"))
loaders = TEMPLATES[0]['OPTIONS'].get('loaders') or ['django.template.loaders.filesystem.Loader','django.template.loaders.app_directories.Loader']
# loaders.insert(0, 'apptemplates.Loader')
TEMPLATES[0]['OPTIONS']['loaders'] = loaders
TEMPLATES[0].pop('APP_DIRS', None)
# HaitiData
INSTALLED_APPS += (
"clip_and_ship",
)
LANGUAGE_CODE = 'fr'
_HAITI_LANGUAGES = (
('en', 'English'),
('fr', 'Français'),
)
LANGUAGES = os.getenv('LANGUAGES', _HAITI_LANGUAGES)
DISPLAY_COMMENTS = False
MAXIMUM_CLIP_SIZE = '80000000'
WCS_DOWNLOADED_RATIO_SIZE = 1
THUMBNAIL_GENERATOR_DEFAULT_SIZE = {'width': 480, 'height': 400}