upgrade to django3.2
This commit is contained in:
parent
191eed1aa4
commit
4bd1b62e64
7 changed files with 29 additions and 26 deletions
|
|
@ -7,7 +7,7 @@ RUN apt-get update && apt-get install -y libsasl2-dev python-dev libldap2-dev li
|
|||
ADD requirements.txt /requirements.txt
|
||||
RUN pip install --upgrade -r /requirements.txt
|
||||
|
||||
RUN ls /opt/cbmi
|
||||
# RUN ls /opt/cbmi
|
||||
|
||||
EXPOSE 8000
|
||||
ENTRYPOINT ["/opt/cbmi/start"]
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{% load i18n %}
|
||||
{% load crispy_forms_tags %}
|
||||
{% load static from staticfiles %}
|
||||
{% load static %}
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="de">
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ from django.contrib.auth.models import User
|
|||
from django.http import HttpResponse, HttpResponseRedirect
|
||||
from django.shortcuts import get_object_or_404
|
||||
from django.shortcuts import render
|
||||
from django.shortcuts import render_to_response
|
||||
from django.shortcuts import render
|
||||
from django.utils.translation import ugettext as _
|
||||
|
||||
import smbpasswd
|
||||
|
|
@ -123,7 +123,7 @@ def groups_list(request, group_name):
|
|||
is_ceymaster = True
|
||||
if 'ldap_admins' in [g.name for g in request.user.groups.all()]:
|
||||
is_admin = True
|
||||
return render_to_response("group_list.html", locals())
|
||||
return render(request, "group_list.html", locals())
|
||||
|
||||
|
||||
@login_required
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
from django.conf.urls import url
|
||||
from jsonrpc import jsonrpc_site
|
||||
from jsonrpc.views import browse
|
||||
# from jsonrpc import jsonrpc_site
|
||||
# from jsonrpc.views import browse
|
||||
from cbapi_ldap import views
|
||||
|
||||
|
||||
urlpatterns = [
|
||||
url(r'^ldap/browse/$', browse, name='jsonrpc_browser'),
|
||||
url(r'^ldap/$', jsonrpc_site.dispatch, name='jsonrpc_mountpoint'),
|
||||
# url(r'^ldap/browse/$', browse, name='jsonrpc_browser'),
|
||||
# url(r'^ldap/$', jsonrpc_site.dispatch, name='jsonrpc_mountpoint'),
|
||||
]
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
from jsonrpc import jsonrpc_method
|
||||
# from jsonrpc import jsonrpc_method
|
||||
|
||||
TODO = [
|
||||
'',
|
||||
]
|
||||
|
||||
@jsonrpc_method("ping", authenticated=True)
|
||||
# @jsonrpc_method("ping", authenticated=True)
|
||||
def ping(request, username, password):
|
||||
"""Ping - Echo Request
|
||||
|
||||
|
|
@ -13,7 +13,7 @@ def ping(request, username, password):
|
|||
echo_response = "PONG"
|
||||
return echo_response
|
||||
|
||||
@jsonrpc_method("todo")
|
||||
# @jsonrpc_method("todo")
|
||||
def todo(request):
|
||||
"""Todo - List ToDo Items
|
||||
|
||||
|
|
|
|||
|
|
@ -81,9 +81,11 @@ STATICFILES_DIRS = (
|
|||
STATICFILES_FINDERS = (
|
||||
'django.contrib.staticfiles.finders.FileSystemFinder',
|
||||
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
|
||||
#'django.contrib.staticfiles.finders.DefaultStorageFinder',
|
||||
# 'django.contrib.staticfiles.finders.DefaultStorageFinder',
|
||||
)
|
||||
|
||||
DEFAULT_AUTO_FIELD = 'django.db.models.AutoField'
|
||||
|
||||
# Make this unique, and don't share it with anybody.
|
||||
SECRET_KEY = 'vp!#muchjm!fqgi9r1%^xi^t$vb443!e^3b3fyke7b))xk2ml='
|
||||
|
||||
|
|
@ -144,9 +146,9 @@ TEMPLATES = [
|
|||
import ldap
|
||||
from django_auth_ldap.config import LDAPSearch, GroupOfNamesType
|
||||
|
||||
AUTH_LDAP_SERVER_URI = "ldaps://lea.cbrp3.c-base.org"
|
||||
AUTH_LDAP_SERVER_URI = "ldap://lea.cbrp3.c-base.org"
|
||||
AUTH_LDAP_USER_DN_TEMPLATE = "uid=%(user)s,ou=crew,dc=c-base,dc=org"
|
||||
AUTH_LDAP_START_TLS = False
|
||||
AUTH_LDAP_START_TLS = True
|
||||
AUTH_LDAP_BIND_AS_AUTHENTICATING_USER = True
|
||||
|
||||
AUTH_LDAP_CACHE_GROUPS = True
|
||||
|
|
@ -159,7 +161,7 @@ AUTH_LDAP_GROUP_SEARCH = LDAPSearch(
|
|||
)
|
||||
AUTH_LDAP_REQUIRE_GROUP = "cn=crew,ou=groups,dc=c-base,dc=org"
|
||||
AUTH_LDAP_GROUP_TYPE = GroupOfNamesType(name_attr="cn")
|
||||
#AUTH_LDAP_PROFILE_FLAGS_BY_GROUP = {
|
||||
# AUTH_LDAP_PROFILE_FLAGS_BY_GROUP = {
|
||||
AUTH_LDAP_USER_FLAGS_BY_GROUP = {
|
||||
"is_member": "cn=crew,ou=groups,dc=c-base,dc=org",
|
||||
"is_ldap_admin": "cn=ldap_admins,ou=groups,dc=c-base,dc=org",
|
||||
|
|
@ -202,11 +204,11 @@ INSTALLED_APPS = (
|
|||
'django.contrib.staticfiles',
|
||||
'django.contrib.admin',
|
||||
'django.contrib.admindocs',
|
||||
#'jsonrpc', # STUBBED due to django-1.8.4 upgraded
|
||||
# 'jsonrpc', # STUBBED due to django-1.8.4 upgraded
|
||||
'crispy_forms',
|
||||
# 'cbmi',
|
||||
'account',
|
||||
#'cbapi_ldap',
|
||||
# 'cbapi_ldap',
|
||||
)
|
||||
|
||||
# A sample logging configuration. The only tangible logging
|
||||
|
|
@ -227,7 +229,8 @@ LOGGING = {
|
|||
'level': 'ERROR',
|
||||
'filters': ['require_debug_false'],
|
||||
'class': 'django.utils.log.AdminEmailHandler'
|
||||
}
|
||||
},
|
||||
"console": {"class": "logging.StreamHandler"}
|
||||
},
|
||||
'loggers': {
|
||||
'django.request': {
|
||||
|
|
@ -235,6 +238,7 @@ LOGGING = {
|
|||
'level': 'ERROR',
|
||||
'propagate': True,
|
||||
},
|
||||
"django_auth_ldap": {"level": "DEBUG", "handlers": ["console"]}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -247,7 +251,7 @@ CBASE_BASE_DN = 'ou=crew,dc=c-base,dc=org'
|
|||
# Set session cookie timeout to 10 minutes
|
||||
SESSION_COOKIE_AGE = 600
|
||||
LOGIN_URL = '/account/login/'
|
||||
#LOCALE_PATHS =
|
||||
# LOCALE_PATHS =
|
||||
|
||||
try:
|
||||
from cbmi.local_settings import *
|
||||
|
|
|
|||
|
|
@ -1,9 +1,8 @@
|
|||
Django==1.11.25
|
||||
#MySQL-python==1.2.5
|
||||
django-auth-ldap>=1.7.0
|
||||
django-json-rpc>=0.7.2
|
||||
django-crispy-forms>=1.7.2
|
||||
gunicorn>=19.9.0
|
||||
Django==3.2.8
|
||||
django-auth-ldap==3.0.0
|
||||
# django-json-rpc>=0.7.2
|
||||
django-crispy-forms>=1.13.0
|
||||
gunicorn>=20.1.0
|
||||
pycrypto>=2.6.1
|
||||
passlib
|
||||
requests>=2.19.1
|
||||
requests>=2.26.0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue