Commit b8d171bd authored by sim's avatar sim

Update manage.py and settings.py to Django 1.11

parent c424ff4b
""" """
Django settings for gargantext project. Django settings for gargantext project.
Generated by 'django-admin startproject' using Django 1.9.2. Generated by 'django-admin startproject' using Django 1.11.7.
For more information on this file, see For more information on this file, see
https://docs.djangoproject.com/en/1.9/topics/settings/ https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see 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.11/ref/settings/
""" """
import os import os
...@@ -17,7 +17,7 @@ BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) ...@@ -17,7 +17,7 @@ BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# Quick-start development settings - unsuitable for production # 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.11/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret! # SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '!%ktkh981)piil1%t5r0g4$^0=uvdafk!=f2x8djxy7_gq(n5%' SECRET_KEY = '!%ktkh981)piil1%t5r0g4$^0=uvdafk!=f2x8djxy7_gq(n5%'
...@@ -43,13 +43,12 @@ INSTALLED_APPS = [ ...@@ -43,13 +43,12 @@ INSTALLED_APPS = [
'gargantext', 'gargantext',
] ]
MIDDLEWARE_CLASSES = [ MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware', 'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware', 'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware', 'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware', 'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware',
] ]
...@@ -75,7 +74,7 @@ TEMPLATES = [ ...@@ -75,7 +74,7 @@ TEMPLATES = [
WSGI_APPLICATION = 'gargantext.wsgi.application' WSGI_APPLICATION = 'gargantext.wsgi.application'
# Database # Database
# https://docs.djangoproject.com/en/1.9/ref/settings/#databases # https://docs.djangoproject.com/en/1.11/ref/settings/#databases
DATABASES = { DATABASES = {
'default': { 'default': {
...@@ -96,7 +95,7 @@ DATABASES['default']['URL'] = \ ...@@ -96,7 +95,7 @@ DATABASES['default']['URL'] = \
) )
# Password validation # Password validation
# https://docs.djangoproject.com/en/1.9/ref/settings/#auth-password-validators # https://docs.djangoproject.com/en/1.11/ref/settings/#auth-password-validators
AUTH_PASSWORD_VALIDATORS = [ AUTH_PASSWORD_VALIDATORS = [
{ {
...@@ -114,7 +113,7 @@ AUTH_PASSWORD_VALIDATORS = [ ...@@ -114,7 +113,7 @@ AUTH_PASSWORD_VALIDATORS = [
] ]
# Internationalization # Internationalization
# https://docs.djangoproject.com/en/1.9/topics/i18n/ # https://docs.djangoproject.com/en/1.11/topics/i18n/
LANGUAGE_CODE = 'en-us' LANGUAGE_CODE = 'en-us'
......
"""URL Configuration of GarganText""" """gargantext URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-based views
1. Add an import: from other_app.views import Home
2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home')
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 url from django.conf.urls import url
from django.contrib import admin from django.contrib import admin
from django.views.generic.base import RedirectView as Redirect from django.views.generic.base import RedirectView as Redirect
from django.contrib.staticfiles.storage import staticfiles_storage as static from django.contrib.staticfiles.storage import staticfiles_storage as static
urlpatterns = [ urlpatterns = [
url(r'^admin/', admin.site.urls), url(r'^admin/', admin.site.urls),
url(r'^favicon.ico$', Redirect.as_view(url=static.url('favicon.ico'), url(r'^favicon.ico$', Redirect.as_view(url=static.url('favicon.ico'),
......
...@@ -4,7 +4,7 @@ WSGI config for gargantext project. ...@@ -4,7 +4,7 @@ WSGI config for gargantext project.
It exposes the WSGI callable as a module-level variable named ``application``. It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see For more information on this file, see
https://docs.djangoproject.com/en/1.9/howto/deployment/wsgi/ https://docs.djangoproject.com/en/1.11/howto/deployment/wsgi/
""" """
import os import os
......
...@@ -4,7 +4,19 @@ import sys ...@@ -4,7 +4,19 @@ import sys
if __name__ == "__main__": if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "gargantext.settings") os.environ.setdefault("DJANGO_SETTINGS_MODULE", "gargantext.settings")
try:
from django.core.management import execute_from_command_line from django.core.management import execute_from_command_line
except ImportError:
# The above import may fail for some other reason. Ensure that the
# issue is really that Django is missing to avoid masking other
# exceptions on Python 2.
try:
import django
except ImportError:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
"available on your PYTHONPATH environment variable? Did you "
"forget to activate a virtual environment?"
)
raise
execute_from_command_line(sys.argv) execute_from_command_line(sys.argv)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment