diff options
Diffstat (limited to 'commonnet')
-rw-r--r-- | commonnet/__init__.py | 0 | ||||
-rw-r--r-- | commonnet/admin_site.py | 11 | ||||
-rw-r--r-- | commonnet/settings.py | 112 | ||||
-rw-r--r-- | commonnet/urls.py | 10 | ||||
-rw-r--r-- | commonnet/wsgi.py | 16 |
5 files changed, 149 insertions, 0 deletions
diff --git a/commonnet/__init__.py b/commonnet/__init__.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/commonnet/__init__.py diff --git a/commonnet/admin_site.py b/commonnet/admin_site.py new file mode 100644 index 0000000..1e36ade --- /dev/null +++ b/commonnet/admin_site.py @@ -0,0 +1,11 @@ +from django.contrib.admin import AdminSite +from django.utils.translation import ugettext_lazy as _ + + +class CommOnNetAdminSite(AdminSite): + site_header = _('Comm-on-net administration') + site_title = _("Comm-on-net administration") + + +admin_site = CommOnNetAdminSite(name='commonnetadmin') + diff --git a/commonnet/settings.py b/commonnet/settings.py new file mode 100644 index 0000000..4ca0fbf --- /dev/null +++ b/commonnet/settings.py @@ -0,0 +1,112 @@ +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.11/howto/deployment/checklist/ + +# SECURITY WARNING: keep the secret key used in production secret! +SECRET_KEY = '!lh+r$hzd(_-aj8a2&@)34bat=w&=!k+9w%$_+&^gjhf#n6z42' + +# SECURITY WARNING: don't run with debug turned on in production! +DEBUG = True + +ALLOWED_HOSTS = [] + + +# Application definition + +INSTALLED_APPS = [ + 'commcrawler.apps.CommCrawlerConfig', + 'ajax_select', + 'django.contrib.admin', + 'django.contrib.auth', + 'django.contrib.contenttypes', + 'django.contrib.sessions', + 'django.contrib.messages', + 'django.contrib.staticfiles', +] + +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.messages.middleware.MessageMiddleware', + 'django.middleware.clickjacking.XFrameOptionsMiddleware', +] + +ROOT_URLCONF = 'commonnet.urls' + +TEMPLATES = [ + { + 'BACKEND': 'django.template.backends.django.DjangoTemplates', + 'DIRS': [], + 'APP_DIRS': True, + 'OPTIONS': { + 'context_processors': [ + 'django.template.context_processors.debug', + 'django.template.context_processors.request', + 'django.contrib.auth.context_processors.auth', + 'django.contrib.messages.context_processors.messages', + ], + }, + }, +] + +WSGI_APPLICATION = 'commonnet.wsgi.application' + + +# Database +# https://docs.djangoproject.com/en/1.11/ref/settings/#databases + +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.sqlite3', + 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), + } +} + + +# Password validation +# https://docs.djangoproject.com/en/1.11/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', + }, + { + 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', + }, +] + + +# Internationalization +# https://docs.djangoproject.com/en/1.11/topics/i18n/ + +LANGUAGE_CODE = 'fr-fr' + +TIME_ZONE = 'Europe/Paris' + +USE_I18N = True + +USE_L10N = True + +USE_TZ = True + + +DATA_UPLOAD_MAX_NUMBER_FIELDS = 5000 + +# Static files (CSS, JavaScript, Images) +# https://docs.djangoproject.com/en/1.11/howto/static-files/ + +STATIC_URL = '/static/' diff --git a/commonnet/urls.py b/commonnet/urls.py new file mode 100644 index 0000000..d38b3b7 --- /dev/null +++ b/commonnet/urls.py @@ -0,0 +1,10 @@ +from django.conf.urls import include, url + +from ajax_select import urls as ajax_select_urls +from commonnet.admin_site import admin_site + + +urlpatterns = [ + url(r'^admin/', admin_site.urls), + url(r'^ajax-select/', include(ajax_select_urls)), +] diff --git a/commonnet/wsgi.py b/commonnet/wsgi.py new file mode 100644 index 0000000..bfccf8c --- /dev/null +++ b/commonnet/wsgi.py @@ -0,0 +1,16 @@ +""" +WSGI config for commonnet 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.11/howto/deployment/wsgi/ +""" + +import os + +from django.core.wsgi import get_wsgi_application + +os.environ.setdefault("DJANGO_SETTINGS_MODULE", "commonnet.settings") + +application = get_wsgi_application() |