From dc4a9fd079325c3551e9a23771d7d44b0277f9d5 Mon Sep 17 00:00:00 2001 From: bsomers Date: Sun, 31 Mar 2024 17:34:08 +0200 Subject: [PATCH] Port to Django 3 --- .gitlab-ci.yml | 3 +- .install/etc/ldap/slapd.conf | 15 ++--- .install/scripts/install_essentials.sh | 2 +- .pylintrc | 46 +--------------- Dockerfile | 5 +- campus/forms.py | 2 +- campus/models/rooms_models.py | 2 +- campus/templates/base_campus.html | 2 +- .../templates/campus/ae-admin/add-admin.html | 2 +- .../templates/campus/ae-admin/add-member.html | 2 +- .../campus/ae-admin/delete-admin.html | 2 +- .../templates/campus/ae-admin/export-csv.html | 2 +- campus/templates/campus/ae-admin/home.html | 2 +- .../templates/campus/ae-admin/import-csv.html | 2 +- campus/templates/campus/clubs/detail.html | 2 +- campus/templates/campus/clubs/list.html | 2 +- campus/templates/campus/clubs/new_club.html | 2 +- campus/templates/campus/home.html | 2 +- campus/templates/campus/mails/display.html | 2 +- .../campus/mails/need_moderation.html | 2 +- campus/templates/campus/mails/send_mail.html | 2 +- .../campus/rooms/booking_detail.html | 2 +- campus/templates/campus/rooms/calendar.html | 2 +- campus/templates/campus/rooms/room_form.html | 2 +- .../campus/rooms/room_management.html | 2 +- .../campus/whoswho/birthdayList.html | 2 +- .../templates/campus/whoswho/searchUsers.html | 2 +- .../templates/campus/whoswho/userDetails.html | 2 +- campus/templates/campus/whoswho/userHome.html | 2 +- campus/views/views_ae_admin.py | 2 +- campus/views/views_clubs.py | 2 +- campus/views/views_mails.py | 2 +- campus/views/views_rooms.py | 2 +- devices/forms.py | 2 +- devices/templates/devices/add_device.html | 4 +- devices/templates/devices/list_devices.html | 2 +- devices/views.py | 2 +- fonctions/decorators.py | 17 +++--- fonctions/generic.py | 3 +- gestion_personnes/forms.py | 2 +- .../templates/gestion_personnes/cgu.html | 2 +- .../gestion_personnes/finalize_signup.html | 2 +- .../gestion_personnes/inscription.html | 2 +- .../gestion_personnes/personal_info.html | 2 +- .../templates/gestion_personnes/settings.html | 4 +- gestion_personnes/views.py | 2 +- maisel/forms.py | 2 +- maisel/templates/maisel/list_employees.html | 2 +- maisel/views.py | 2 +- myresel/settings.py | 21 +++---- myresel/urls.py | 17 +----- pages/forms.py | 2 +- pages/templates/pages/become_admin.html | 2 +- pages/templates/pages/eggdrop.html | 2 +- pages/templates/pages/faq.html | 2 +- pages/templates/pages/home/home.html | 2 +- pages/templates/pages/home/home_ext.html | 4 +- pages/templates/pages/home/home_int.html | 4 +- pages/templates/pages/home/home_logged.html | 2 +- pages/templates/pages/how_to_signup.html | 2 +- .../pages/inscription_zone_info.html | 2 +- pages/templates/pages/network_status.html | 2 +- pages/templates/pages/news.html | 2 +- pages/templates/pages/piece_of_news.html | 2 +- pages/templates/pages/service.html | 2 +- pages/templates/pages/tv.html | 2 +- pages/views.py | 6 +- requirements.txt | 55 +++++++++---------- templates/400.html | 2 +- templates/403.html | 2 +- templates/404.html | 2 +- templates/418.html | 2 +- templates/500.html | 2 +- templates/admin/base_site.html | 2 +- templates/base.html | 2 +- templates/help_needed.html | 2 +- templates/registration/login.html | 2 +- tresorerie/async_tasks.py | 2 +- .../management/commands/check-payments.py | 2 +- .../templates/tresorerie/choose_product.html | 2 +- tresorerie/templates/tresorerie/history.html | 2 +- tresorerie/templates/tresorerie/home.html | 2 +- .../templates/tresorerie/list_product.html | 2 +- tresorerie/templates/tresorerie/recap.html | 2 +- tresorerie/tests/tests_view.py | 4 +- tresorerie/views.py | 2 +- wiki/templates/wiki/show-article.html | 2 +- wiki/templates/wiki/show-category.html | 2 +- 88 files changed, 141 insertions(+), 213 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2ba9dcf5..5ded2eb6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -49,8 +49,7 @@ before_script: - echo "CREATE DATABASE ${MYSQL_QOS_DATABASE}" | mysql -u${MYSQL_QOS_USER} -p${MYSQL_QOS_PASSWORD} -h ${MYSQL_QOS_HOST} - source .install/scripts/install_openldap.sh # - source .install/scripts/install_latex.sh - - pip3 install --upgrade pip - - pip3 install -qUr requirements.txt + - pip3 install --break-system-packages -qUr requirements.txt - rm -f -- ${ROOTDIR}myresel/settings_local.py - export MYSQL_USER=root - source .install/scripts/configure.sh diff --git a/.install/etc/ldap/slapd.conf b/.install/etc/ldap/slapd.conf index 3bb7e094..cd99a431 100644 --- a/.install/etc/ldap/slapd.conf +++ b/.install/etc/ldap/slapd.conf @@ -50,8 +50,7 @@ loglevel 65535 # Where the dynamically loaded modules are stored modulepath /usr/lib/ldap -moduleload back_bdb -moduleload back_hdb +moduleload back_mdb #moduleload back_ldap moduleload back_monitor moduleload syncprov @@ -71,7 +70,7 @@ tool-threads 1 # Specific Backend Directives for bdb: # Backend specific directives apply to this backend until another # 'backend' directive occurs -backend bdb +backend mdb ####################################################### ## Configuration relative a la gestion des accesslogs @@ -96,7 +95,7 @@ backend bdb # Specific Directives for database #1, of type bdb: # Database specific directives apply to this databasse until another # 'database' directive occurs -database bdb +database mdb # The base of your directory in database #1 suffix "dc=maisel,dc=enst-bretagne,dc=fr" @@ -185,9 +184,6 @@ syncprov-sessionlog 100 # These access lines apply to database #1 only mode 0600 -cachesize 100000 -#dbcachesize 125829120 # seulement en LDBM - checkpoint 1024 10 # Ensure read access to the base for things like @@ -208,7 +204,7 @@ checkpoint 1024 10 #database # The backend type, bdb, is the default standard -database bdb +database mdb # The base of your directory in database #2 suffix "dc=resel,dc=enst-bretagne,dc=fr" @@ -275,9 +271,6 @@ syncprov-sessionlog 100 mode 0600 -cachesize 100000 -#dbcachesize 5242880 seulement en LDBM - checkpoint 1024 10 # Activation du monitoring diff --git a/.install/scripts/install_essentials.sh b/.install/scripts/install_essentials.sh index 8526c741..d693740e 100644 --- a/.install/scripts/install_essentials.sh +++ b/.install/scripts/install_essentials.sh @@ -7,5 +7,5 @@ else apt-get -qq upgrade fi -apt-get -qq install build-essential python3-software-properties python3 python3-dev python3-pip vim libssl-dev libmariadbclient-dev gcc +apt-get -qq install build-essential python3-software-properties python3 python3-dev python3-pip vim libssl-dev default-libmysqlclient-dev gcc pkg-config #easy_install3 -U pip # Solve debian bug diff --git a/.pylintrc b/.pylintrc index 5731bf9a..d63a846a 100644 --- a/.pylintrc +++ b/.pylintrc @@ -56,7 +56,7 @@ confidence= # --enable=similarities". If you want to run only the classes checker, but have # no Warning level messages displayed, use"--disable=all --enable=classes # --disable=W" -disable=standarderror-builtin,cmp-builtin,file-builtin,unicode-builtin,coerce-builtin,raising-string,nonzero-method,next-method-called,buffer-builtin,dict-view-method,zip-builtin-not-iterating,apply-builtin,filter-builtin-not-iterating,coerce-method,intern-builtin,unpacking-in-except,cmp-method,indexing-exception,old-raise-syntax,suppressed-message,xrange-builtin,oct-method,reduce-builtin,print-statement,old-division,execfile-builtin,old-octal-literal,reload-builtin,input-builtin,setslice-method,map-builtin-not-iterating,long-suffix,backtick,raw_input-builtin,round-builtin,hex-method,range-builtin-not-iterating,dict-iter-method,long-builtin,parameter-unpacking,unichr-builtin,getslice-method,metaclass-assignment,delslice-method,using-cmp-argument,import-star-module-level,basestring-builtin,useless-suppression,old-ne-operator,no-absolute-import,imported-auth-user +disable=suppressed-message,useless-suppression,imported-auth-user [REPORTS] @@ -66,12 +66,6 @@ disable=standarderror-builtin,cmp-builtin,file-builtin,unicode-builtin,coerce-bu # mypackage.mymodule.MyReporterClass. output-format=colorized -# Put messages in a separate file for each module / package specified on the -# command line instead of printing them on stdout. Reports (if any) will be -# written in a file name "pylint_global.[txt|html]". This option is deprecated -# and it will be removed in Pylint 2.0. -files-output=no - # Tells whether to display a full report or only the messages reports=yes @@ -99,12 +93,6 @@ ignore-long-lines=^\s*(# )??$ # else. single-line-if-stmt=no -# List of optional constructs for which whitespace checking is disabled. `dict- -# separator` is used to allow tabulation in dicts, etc.: {1 : 1,\n222: 2}. -# `trailing-comma` allows a space between comma and closing bracket: (a, ). -# `empty-line` allows space-only lines. -no-space-check=trailing-comma,dict-separator - # Maximum number of lines in a module max-module-lines=1000 @@ -180,63 +168,33 @@ property-classes=abc.abstractproperty # Regular expression matching correct module names module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$ -# Naming hint for module names -module-name-hint=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$ - # Regular expression matching correct argument names argument-rgx=[a-z_][a-z0-9_]{2,30}$ -# Naming hint for argument names -argument-name-hint=[a-z_][a-z0-9_]{2,30}$ - # Regular expression matching correct class names class-rgx=[A-Z_][a-zA-Z0-9]+$ -# Naming hint for class names -class-name-hint=[A-Z_][a-zA-Z0-9]+$ - # Regular expression matching correct class attribute names class-attribute-rgx=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$ -# Naming hint for class attribute names -class-attribute-name-hint=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$ - # Regular expression matching correct constant names const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__))$ -# Naming hint for constant names -const-name-hint=(([A-Z_][A-Z0-9_]*)|(__.*__))$ - # Regular expression matching correct method names method-rgx=[a-z_][a-z0-9_]{2,30}$ -# Naming hint for method names -method-name-hint=[a-z_][a-z0-9_]{2,30}$ - # Regular expression matching correct inline iteration names inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$ -# Naming hint for inline iteration names -inlinevar-name-hint=[A-Za-z_][A-Za-z0-9_]*$ - # Regular expression matching correct variable names variable-rgx=[a-z_][a-z0-9_]{1,30}$ -# Naming hint for variable names -variable-name-hint=[a-z_][a-z0-9_]{2,30}$ - # Regular expression matching correct function names function-rgx=[a-z_][a-z0-9_]{2,30}$ -# Naming hint for function names -function-name-hint=[a-z_][a-z0-9_]{2,30}$ - # Regular expression matching correct attribute names attr-rgx=[a-z_][a-z0-9_]{1,30}$ -# Naming hint for attribute names -attr-name-hint=[a-z_][a-z0-9_]{2,30}$ - # Regular expression which should only match function or class names that do # not require a docstring. no-docstring-rgx=^_ @@ -395,4 +353,4 @@ analyse-fallback-blocks=no # Exceptions that will emit a warning when being caught. Defaults to # "Exception" -overgeneral-exceptions=Exception +overgeneral-exceptions=builtins.Exception diff --git a/Dockerfile b/Dockerfile index 0d57feec..75b2609c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM debian:10 +FROM debian:12 ARG LDAPPASSWD ARG DEBIAN_FRONTEND=noninteractive @@ -15,8 +15,7 @@ RUN chmod +x install_essentials.sh && ./install_essentials.sh RUN apt -qq update && apt -qq upgrade -y COPY requirements.txt requirements.txt -RUN pip3 install --upgrade pip -RUN pip3 install -qr requirements.txt +RUN pip3 install --break-system-packages -qr requirements.txt # LDAP RUN apt -qq install expect ldap-utils libldap2-dev libsasl2-dev libssl-dev ldapvi -y diff --git a/campus/forms.py b/campus/forms.py index 7d3100e7..2a906ae1 100644 --- a/campus/forms.py +++ b/campus/forms.py @@ -8,7 +8,7 @@ from django.forms import ModelForm, CharField, TextInput, Form, Textarea, ChoiceField,\ EmailField, IntegerField, Select, CheckboxInput, SelectMultiple from django.forms.models import ModelMultipleChoiceField -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from django.db.models import Q from ldap3.core.exceptions import LDAPException diff --git a/campus/models/rooms_models.py b/campus/models/rooms_models.py index f8ce589c..5eb6a6f2 100644 --- a/campus/models/rooms_models.py +++ b/campus/models/rooms_models.py @@ -1,6 +1,6 @@ from dateutil.relativedelta import relativedelta from django.db import models -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from django.contrib.auth.models import User from django.core.exceptions import ObjectDoesNotExist diff --git a/campus/templates/base_campus.html b/campus/templates/base_campus.html index 6658a52a..ae2981a6 100644 --- a/campus/templates/base_campus.html +++ b/campus/templates/base_campus.html @@ -1,4 +1,4 @@ -{% load staticfiles %} +{% load static %} {% load i18n %} diff --git a/campus/templates/campus/ae-admin/add-admin.html b/campus/templates/campus/ae-admin/add-admin.html index a441d749..1caba402 100644 --- a/campus/templates/campus/ae-admin/add-admin.html +++ b/campus/templates/campus/ae-admin/add-admin.html @@ -1,5 +1,5 @@ {% load i18n %} -{% load staticfiles %} +{% load static %} -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/devices/templates/devices/list_devices.html b/devices/templates/devices/list_devices.html index 284da6fa..8082e84d 100644 --- a/devices/templates/devices/list_devices.html +++ b/devices/templates/devices/list_devices.html @@ -1,6 +1,6 @@ {% extends 'base.html' %} {% load i18n %} -{% load staticfiles %} +{% load static %} {% block titre %}{% trans "Mes machines" %}{% endblock %} diff --git a/devices/views.py b/devices/views.py index 7dae9e29..da14e05b 100644 --- a/devices/views.py +++ b/devices/views.py @@ -10,7 +10,7 @@ from django.http import HttpResponseRedirect from django.shortcuts import render from django.utils.decorators import method_decorator -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from django.views.generic import FormView from django.views.generic import View, ListView diff --git a/fonctions/decorators.py b/fonctions/decorators.py index 045f9d3c..9ef812af 100644 --- a/fonctions/decorators.py +++ b/fonctions/decorators.py @@ -5,8 +5,7 @@ from django.contrib import messages from django.urls import reverse from django.http import HttpResponseRedirect -from django.utils.decorators import available_attrs -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ logger = logging.getLogger("default") @@ -19,7 +18,7 @@ def resel_required(function=None, redirect_to='home'): """ def _dec(view_func): - @wraps(view_func, assigned=available_attrs(view_func)) + @wraps(view_func) def _view(request, *args, **kwargs): if request.network_data['is_resel']: return view_func(request, *args, **kwargs) @@ -44,7 +43,7 @@ def maisel_manager_required(function=None, redirect_to='home'): """ def _dec(view_func): - @wraps(view_func, assigned=available_attrs(view_func)) + @wraps(view_func) def _view(request, *args, **kwargs): try: if not request.ldap_user: @@ -70,7 +69,7 @@ def not_maisel(function=None, redirect_to='home'): """Vérifie que l'user n'est pas de la Maisel""" def _dec(view_func): - @wraps(view_func, assigned=available_attrs(view_func)) + @wraps(view_func) def _view(request, *args, **kwargs): try: if not request.ldap_user: @@ -102,7 +101,7 @@ def need_to_pay(function=None, redirect_to='home'): """ def _dec(view_func): - @wraps(view_func, assigned=available_attrs(view_func)) + @wraps(view_func) def _view(request, *args, **kwargs): try: if not request.ldap_user: @@ -133,7 +132,7 @@ def able_to_pay(function=None, redirect_to='home'): """ def _dec(view_func): - @wraps(view_func, assigned=available_attrs(view_func)) + @wraps(view_func) def _view(request, *args, **kwargs): subnet = request.network_data['subnet'] if subnet in ['REGN', 'EXPN']: @@ -161,7 +160,7 @@ def ae_required(function, redirect_to='campus:rooms:calendar'): """ def _dec(view_func): - @wraps(view_func, assigned=available_attrs(view_func)) + @wraps(view_func) def _view(request, *args, **kwargs): ae = False for period in request.ldap_user.dates_membre: @@ -184,7 +183,7 @@ def ae_admin_required(function, redirect_to='campus:home'): Check if the user has ae_admin attribute """ def _dec(view_func): - @wraps(view_func, assigned=available_attrs(view_func)) + @wraps(view_func) def _view(request, *args, **kwargs): if (not request.user.is_authenticated): return HttpResponseRedirect( diff --git a/fonctions/generic.py b/fonctions/generic.py index 1bbc198b..0c14ae43 100644 --- a/fonctions/generic.py +++ b/fonctions/generic.py @@ -5,6 +5,7 @@ import os from base64 import decodebytes, encodebytes from datetime import datetime, time, date +from passlib.hash import nthash def current_year(): @@ -50,7 +51,7 @@ def compare_passwd(passwd, hsh): def hash_to_ntpass(password): """ Fourni un hash du mdp pour correspondre avec le loggin over Wi-Fi """ - return str(binascii.hexlify(hashlib.new('md4', password.encode('utf-16le')).digest()).upper()).split('\'')[1] + return nthash.hash(password).upper() def sizeof_fmt(num, suffix='o'): diff --git a/gestion_personnes/forms.py b/gestion_personnes/forms.py index 01933f88..1fbfac51 100644 --- a/gestion_personnes/forms.py +++ b/gestion_personnes/forms.py @@ -7,7 +7,7 @@ from django.urls import reverse from django.core.validators import MaxLengthValidator, MinLengthValidator, EmailValidator from django.utils.text import slugify -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from phonenumber_field.formfields import PhoneNumberField from fonctions.generic import current_year diff --git a/gestion_personnes/templates/gestion_personnes/cgu.html b/gestion_personnes/templates/gestion_personnes/cgu.html index 3738e655..9926f1a3 100644 --- a/gestion_personnes/templates/gestion_personnes/cgu.html +++ b/gestion_personnes/templates/gestion_personnes/cgu.html @@ -1,5 +1,5 @@ {% extends 'base.html' %} -{% load staticfiles %} +{% load static %} {% load i18n %} {% block titre %}{% trans "Inscription - CGU" %}{% endblock %} diff --git a/gestion_personnes/templates/gestion_personnes/finalize_signup.html b/gestion_personnes/templates/gestion_personnes/finalize_signup.html index 6ad0baf5..26da3889 100644 --- a/gestion_personnes/templates/gestion_personnes/finalize_signup.html +++ b/gestion_personnes/templates/gestion_personnes/finalize_signup.html @@ -1,5 +1,5 @@ {% extends 'base.html' %} -{% load staticfiles %} +{% load static %} {% load i18n %} {% block titre %}{% trans "Inscription - Finalisation" %}{% endblock %} diff --git a/gestion_personnes/templates/gestion_personnes/inscription.html b/gestion_personnes/templates/gestion_personnes/inscription.html index 71905d2e..306393c8 100644 --- a/gestion_personnes/templates/gestion_personnes/inscription.html +++ b/gestion_personnes/templates/gestion_personnes/inscription.html @@ -1,5 +1,5 @@ {% extends 'base.html' %} -{% load staticfiles %} +{% load static %} {% load i18n %} {% block titre %}{% trans "Inscription" %}{% endblock %} diff --git a/gestion_personnes/templates/gestion_personnes/personal_info.html b/gestion_personnes/templates/gestion_personnes/personal_info.html index 567cbf27..b023706d 100644 --- a/gestion_personnes/templates/gestion_personnes/personal_info.html +++ b/gestion_personnes/templates/gestion_personnes/personal_info.html @@ -1,5 +1,5 @@ {% extends 'base.html' %} -{% load staticfiles %} +{% load static %} {% load i18n %} {% block titre %}{% trans "Informations personnelles" %}{% endblock %} diff --git a/gestion_personnes/templates/gestion_personnes/settings.html b/gestion_personnes/templates/gestion_personnes/settings.html index 616ae252..954230fc 100644 --- a/gestion_personnes/templates/gestion_personnes/settings.html +++ b/gestion_personnes/templates/gestion_personnes/settings.html @@ -1,5 +1,5 @@ {% extends 'base.html' %} -{% load staticfiles %} +{% load static %} {% load i18n %} {% block titre %}{% trans "Paramètres de compte" %}{% endblock %} @@ -25,4 +25,4 @@

{% trans "Paramètres" %}

{% endblock %} {% block javascript %} -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/gestion_personnes/views.py b/gestion_personnes/views.py index 7ddb6f40..781cefae 100644 --- a/gestion_personnes/views.py +++ b/gestion_personnes/views.py @@ -14,7 +14,7 @@ from django.http import HttpResponseForbidden, HttpResponseRedirect from django.shortcuts import render from django.utils.decorators import method_decorator -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from django.views.generic import FormView, View from fonctions import ldap diff --git a/maisel/forms.py b/maisel/forms.py index de8a6c45..fd13b325 100644 --- a/maisel/forms.py +++ b/maisel/forms.py @@ -1,5 +1,5 @@ from django import forms -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ class ApproveEmployeeForm(forms.Form): employee = forms.CharField() diff --git a/maisel/templates/maisel/list_employees.html b/maisel/templates/maisel/list_employees.html index 8c8b2d4e..ab55aacf 100644 --- a/maisel/templates/maisel/list_employees.html +++ b/maisel/templates/maisel/list_employees.html @@ -1,6 +1,6 @@ {% extends 'base.html' %} {% load i18n %} -{% load staticfiles %} +{% load static %} {% block titre %}{% trans "Mon équipe" %}{% endblock %} diff --git a/maisel/views.py b/maisel/views.py index 02aec447..6cc66e49 100644 --- a/maisel/views.py +++ b/maisel/views.py @@ -3,7 +3,7 @@ from django.views.generic.edit import FormMixin from django.utils.decorators import method_decorator from django.contrib import messages -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from fonctions.decorators import maisel_manager_required from fonctions.generic import next_august_fifteenth from gestion_personnes.models import LdapUser diff --git a/myresel/settings.py b/myresel/settings.py index ce440e5a..a7b2e922 100644 --- a/myresel/settings.py +++ b/myresel/settings.py @@ -11,7 +11,7 @@ from ipaddress import ip_network from django.test.runner import DiscoverRunner -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from myresel.settings_local import * @@ -121,6 +121,7 @@ 'toolbar': 'full', 'height': 600, 'width': 1000, + 'versionCheck': False, }, } @@ -225,6 +226,8 @@ }, } +DEFAULT_AUTO_FIELD = 'django.db.models.AutoField' + # Password validation # https://docs.djangoproject.com/en/1.9/ref/settings/#auth-password-validators @@ -338,30 +341,20 @@ 'formatter': 'verbose', 'include_html': True, }, - 'logstash': { - 'level': 'DEBUG', - 'class': 'logstash.LogstashHandler', - 'host': 'orion', - 'port': 5959, # Default value: 5959 - 'version': 1, - 'message_type': 'django', - 'fqdn': False, # Fully qualified domain name. Default value: false. - 'tags': None, # list of tags. Default: None. - }, }, 'loggers': { 'default': { - 'handlers': ['file', 'logstash'], + 'handlers': ['file'], 'level': 'DEBUG', 'propagate': True, }, 'django': { - 'handlers': ['file', 'logstash'], + 'handlers': ['file'], 'level': 'DEBUG', 'propagate': True, }, "rq.worker": { - "handlers": ['file', 'logstash'], + "handlers": ['file'], "level": "DEBUG" }, diff --git a/myresel/urls.py b/myresel/urls.py index 9d1dc89e..319ac8fe 100644 --- a/myresel/urls.py +++ b/myresel/urls.py @@ -1,18 +1,5 @@ -"""myresel URL Configuration - -The `urlpatterns` list routes URLs to views. For more information please see: - https://docs.djangoproject.com/en/1.9/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')) -""" +"""myresel URL Configuration """ + from django.conf.urls import url, include from django.conf.urls.static import static from django.contrib import admin diff --git a/pages/forms.py b/pages/forms.py index 752cb3a0..a63d53e1 100644 --- a/pages/forms.py +++ b/pages/forms.py @@ -1,5 +1,5 @@ from django import forms -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ class ContactForm(forms.Form): diff --git a/pages/templates/pages/become_admin.html b/pages/templates/pages/become_admin.html index 19434db8..79b5e6f1 100644 --- a/pages/templates/pages/become_admin.html +++ b/pages/templates/pages/become_admin.html @@ -1,5 +1,5 @@ {% extends 'base.html' %} -{% load staticfiles %} +{% load static %} {% load i18n %} {% block titre %}{% trans "Devenez adminitrateur ResEl" %}{% endblock %} diff --git a/pages/templates/pages/eggdrop.html b/pages/templates/pages/eggdrop.html index 3bb1d3af..9fb2f5b7 100644 --- a/pages/templates/pages/eggdrop.html +++ b/pages/templates/pages/eggdrop.html @@ -1,6 +1,6 @@ {% extends 'base.html' %} {% load i18n %} -{% load staticfiles %} +{% load static %} {% block css %} diff --git a/pages/templates/pages/faq.html b/pages/templates/pages/faq.html index 34cfb369..50a63db3 100644 --- a/pages/templates/pages/faq.html +++ b/pages/templates/pages/faq.html @@ -1,6 +1,6 @@ {% extends 'base.html' %} {% load i18n %} -{% load staticfiles %} +{% load static %} {% block css %} diff --git a/pages/templates/pages/home/home.html b/pages/templates/pages/home/home.html index be0d326e..c8fcde04 100644 --- a/pages/templates/pages/home/home.html +++ b/pages/templates/pages/home/home.html @@ -1,6 +1,6 @@ {% extends 'base.html' %} {% load i18n %} -{% load staticfiles %} +{% load static %} {% block titre %}{% trans "Accueil" %}{% endblock %} diff --git a/pages/templates/pages/home/home_ext.html b/pages/templates/pages/home/home_ext.html index 4a153f9e..ccdaec91 100644 --- a/pages/templates/pages/home/home_ext.html +++ b/pages/templates/pages/home/home_ext.html @@ -1,6 +1,6 @@ {% extends 'pages/home/home.html' %} {% load i18n %} -{% load staticfiles %} +{% load static %} {% block myresel %} -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/pages/templates/pages/home/home_int.html b/pages/templates/pages/home/home_int.html index 6ee7aa58..f0c31d09 100644 --- a/pages/templates/pages/home/home_int.html +++ b/pages/templates/pages/home/home_int.html @@ -1,6 +1,6 @@ {% extends 'pages/home/home.html' %} {% load i18n %} -{% load staticfiles %} +{% load static %} {% block myresel %} {#
#} @@ -18,4 +18,4 @@ {#
#} {# #} {# #} -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/pages/templates/pages/home/home_logged.html b/pages/templates/pages/home/home_logged.html index 9e908f33..04453289 100644 --- a/pages/templates/pages/home/home_logged.html +++ b/pages/templates/pages/home/home_logged.html @@ -1,6 +1,6 @@ {% extends 'pages/home/home.html' %} {% load i18n %} -{% load staticfiles %} +{% load static %} {% block myresel %}