Commit 9f646d01 authored by sim's avatar sim

Update to latest django version

parent 8d5da39c
......@@ -15,7 +15,7 @@ colorama = "*"
[packages]
django = ">=1.11,<1.12"
django = "*"
dateutils = "*"
celery = "*"
sqlalchemy = "*"
......
{
"_meta": {
"hash": {
"sha256": "644c4a04bf5c7390da40b6d7650df1f12e03213a9c8c979283283b5b7cc8196d"
"sha256": "c8907533f349d8390d9825628006b0b1baad612cde3dc5633df87706a803567c"
},
"pipfile-spec": 6,
"requires": {
......@@ -58,10 +58,10 @@
},
"django": {
"hashes": [
"sha256:74077d7309b48b97dacdac2dfb35c968028becf00a7a684e7f29b2af1b980edc",
"sha256:fd186d544c7c2f835668cf11f77be071307c9eb22615a5b3a16bdb14c8357f41"
"sha256:3d9916515599f757043c690ae2b5ea28666afa09779636351da505396cbb2f19",
"sha256:769f212ffd5762f72c764fa648fca3b7f7dd4ec27407198b68e7c4abf4609fd0"
],
"version": "==1.11.11"
"version": "==2.0.3"
},
"django-celery-beat": {
"hashes": [
......@@ -219,10 +219,10 @@
},
"django": {
"hashes": [
"sha256:74077d7309b48b97dacdac2dfb35c968028becf00a7a684e7f29b2af1b980edc",
"sha256:fd186d544c7c2f835668cf11f77be071307c9eb22615a5b3a16bdb14c8357f41"
"sha256:3d9916515599f757043c690ae2b5ea28666afa09779636351da505396cbb2f19",
"sha256:769f212ffd5762f72c764fa648fca3b7f7dd4ec27407198b68e7c4abf4609fd0"
],
"version": "==1.11.11"
"version": "==2.0.3"
},
"isort": {
"hashes": [
......
"""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/
https://docs.djangoproject.com/en/2.0/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')
2. Add a URL to urlpatterns: path('', 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')
2. Add a URL to urlpatterns: path('', 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'))
1. Import the include() function: from django.urls import include, path
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""
from django.conf.urls import url
from django.contrib import admin
from django.urls import path
from django.views.generic.base import RedirectView as Redirect
from django.contrib.staticfiles.storage import staticfiles_storage as static
from rest_framework_jwt.views import obtain_jwt_token
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^favicon.ico$', Redirect.as_view(url=static.url('favicon.ico'),
permanent=False), name="favicon"),
url(r'^api/auth/token$', obtain_jwt_token),
path('admin/', admin.site.urls),
path('favicon.ico', Redirect.as_view(url=static.url('favicon.ico'),
permanent=False), name="favicon"),
path('api/auth/token', obtain_jwt_token),
]
......@@ -4,7 +4,7 @@ WSGI config for gargantext 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/
https://docs.djangoproject.com/en/2.0/howto/deployment/wsgi/
"""
import os
......
"""
Django settings for gargantext project.
Generated by 'django-admin startproject' using Django 1.11.7.
Generated by 'django-admin startproject' using Django 2.0.3.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
https://docs.djangoproject.com/en/2.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
https://docs.djangoproject.com/en/2.0/ref/settings/
"""
import os
......@@ -20,7 +20,8 @@ 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/
# See https://docs.djangoproject.com/en/2.0/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = config('SECRET_KEY')
......@@ -105,7 +106,7 @@ LOGGING = {
'level': LOG_LEVEL,
'propagate': True,
},
# All django loggers: https://docs.djangoproject.com/fr/1.11/topics/logging/#id3
# All django loggers: https://docs.djangoproject.com/fr/2.0/topics/logging/#id3
'django.template': {
# Don't keep debug logs for template module to avoid annoying and
# useless noise, see:
......@@ -127,7 +128,7 @@ LOGGING = {
# Database
# https://docs.djangoproject.com/en/1.11/ref/settings/#databases
# https://docs.djangoproject.com/en/2.0/ref/settings/#databases
DEFAULT_DATABASE = {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
......@@ -151,7 +152,7 @@ for db in DATABASES:
# Password validation
# https://docs.djangoproject.com/en/1.11/ref/settings/#auth-password-validators
# https://docs.djangoproject.com/en/2.0/ref/settings/#auth-password-validators
AUTH_PASSWORD_VALIDATORS = [
{
......@@ -170,7 +171,7 @@ AUTH_PASSWORD_VALIDATORS = [
# Internationalization
# https://docs.djangoproject.com/en/1.11/topics/i18n/
# https://docs.djangoproject.com/en/2.0/topics/i18n/
LANGUAGE_CODE = 'en-us'
......@@ -184,7 +185,7 @@ USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.11/howto/static-files/
# https://docs.djangoproject.com/en/2.0/howto/static-files/
STATIC_ROOT = os.path.join(BASE_DIR, 'static')
STATIC_URL = '/static/'
......
......@@ -6,17 +6,10 @@ if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "gargantext.settings")
try:
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
except ImportError as exc:
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?"
) from exc
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