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
|
ADD requirements.txt /requirements.txt
|
||||||
RUN pip install --upgrade -r /requirements.txt
|
RUN pip install --upgrade -r /requirements.txt
|
||||||
|
|
||||||
RUN ls /opt/cbmi
|
# RUN ls /opt/cbmi
|
||||||
|
|
||||||
EXPOSE 8000
|
EXPOSE 8000
|
||||||
ENTRYPOINT ["/opt/cbmi/start"]
|
ENTRYPOINT ["/opt/cbmi/start"]
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
{% load crispy_forms_tags %}
|
{% load crispy_forms_tags %}
|
||||||
{% load static from staticfiles %}
|
{% load static %}
|
||||||
|
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="de">
|
<html lang="de">
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ from django.contrib.auth.models import User
|
||||||
from django.http import HttpResponse, HttpResponseRedirect
|
from django.http import HttpResponse, HttpResponseRedirect
|
||||||
from django.shortcuts import get_object_or_404
|
from django.shortcuts import get_object_or_404
|
||||||
from django.shortcuts import render
|
from django.shortcuts import render
|
||||||
from django.shortcuts import render_to_response
|
from django.shortcuts import render
|
||||||
from django.utils.translation import ugettext as _
|
from django.utils.translation import ugettext as _
|
||||||
|
|
||||||
import smbpasswd
|
import smbpasswd
|
||||||
|
|
@ -123,7 +123,7 @@ def groups_list(request, group_name):
|
||||||
is_ceymaster = True
|
is_ceymaster = True
|
||||||
if 'ldap_admins' in [g.name for g in request.user.groups.all()]:
|
if 'ldap_admins' in [g.name for g in request.user.groups.all()]:
|
||||||
is_admin = True
|
is_admin = True
|
||||||
return render_to_response("group_list.html", locals())
|
return render(request, "group_list.html", locals())
|
||||||
|
|
||||||
|
|
||||||
@login_required
|
@login_required
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
from django.conf.urls import url
|
from django.conf.urls import url
|
||||||
from jsonrpc import jsonrpc_site
|
# from jsonrpc import jsonrpc_site
|
||||||
from jsonrpc.views import browse
|
# from jsonrpc.views import browse
|
||||||
from cbapi_ldap import views
|
from cbapi_ldap import views
|
||||||
|
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
url(r'^ldap/browse/$', browse, name='jsonrpc_browser'),
|
# url(r'^ldap/browse/$', browse, name='jsonrpc_browser'),
|
||||||
url(r'^ldap/$', jsonrpc_site.dispatch, name='jsonrpc_mountpoint'),
|
# url(r'^ldap/$', jsonrpc_site.dispatch, name='jsonrpc_mountpoint'),
|
||||||
]
|
]
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
from jsonrpc import jsonrpc_method
|
# from jsonrpc import jsonrpc_method
|
||||||
|
|
||||||
TODO = [
|
TODO = [
|
||||||
'',
|
'',
|
||||||
]
|
]
|
||||||
|
|
||||||
@jsonrpc_method("ping", authenticated=True)
|
# @jsonrpc_method("ping", authenticated=True)
|
||||||
def ping(request, username, password):
|
def ping(request, username, password):
|
||||||
"""Ping - Echo Request
|
"""Ping - Echo Request
|
||||||
|
|
||||||
|
|
@ -13,7 +13,7 @@ def ping(request, username, password):
|
||||||
echo_response = "PONG"
|
echo_response = "PONG"
|
||||||
return echo_response
|
return echo_response
|
||||||
|
|
||||||
@jsonrpc_method("todo")
|
# @jsonrpc_method("todo")
|
||||||
def todo(request):
|
def todo(request):
|
||||||
"""Todo - List ToDo Items
|
"""Todo - List ToDo Items
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -84,6 +84,8 @@ STATICFILES_FINDERS = (
|
||||||
# '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.
|
# Make this unique, and don't share it with anybody.
|
||||||
SECRET_KEY = 'vp!#muchjm!fqgi9r1%^xi^t$vb443!e^3b3fyke7b))xk2ml='
|
SECRET_KEY = 'vp!#muchjm!fqgi9r1%^xi^t$vb443!e^3b3fyke7b))xk2ml='
|
||||||
|
|
||||||
|
|
@ -144,9 +146,9 @@ TEMPLATES = [
|
||||||
import ldap
|
import ldap
|
||||||
from django_auth_ldap.config import LDAPSearch, GroupOfNamesType
|
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_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_BIND_AS_AUTHENTICATING_USER = True
|
||||||
|
|
||||||
AUTH_LDAP_CACHE_GROUPS = True
|
AUTH_LDAP_CACHE_GROUPS = True
|
||||||
|
|
@ -227,7 +229,8 @@ LOGGING = {
|
||||||
'level': 'ERROR',
|
'level': 'ERROR',
|
||||||
'filters': ['require_debug_false'],
|
'filters': ['require_debug_false'],
|
||||||
'class': 'django.utils.log.AdminEmailHandler'
|
'class': 'django.utils.log.AdminEmailHandler'
|
||||||
}
|
},
|
||||||
|
"console": {"class": "logging.StreamHandler"}
|
||||||
},
|
},
|
||||||
'loggers': {
|
'loggers': {
|
||||||
'django.request': {
|
'django.request': {
|
||||||
|
|
@ -235,6 +238,7 @@ LOGGING = {
|
||||||
'level': 'ERROR',
|
'level': 'ERROR',
|
||||||
'propagate': True,
|
'propagate': True,
|
||||||
},
|
},
|
||||||
|
"django_auth_ldap": {"level": "DEBUG", "handlers": ["console"]}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,8 @@
|
||||||
Django==1.11.25
|
Django==3.2.8
|
||||||
#MySQL-python==1.2.5
|
django-auth-ldap==3.0.0
|
||||||
django-auth-ldap>=1.7.0
|
# django-json-rpc>=0.7.2
|
||||||
django-json-rpc>=0.7.2
|
django-crispy-forms>=1.13.0
|
||||||
django-crispy-forms>=1.7.2
|
gunicorn>=20.1.0
|
||||||
gunicorn>=19.9.0
|
|
||||||
pycrypto>=2.6.1
|
pycrypto>=2.6.1
|
||||||
passlib
|
passlib
|
||||||
requests>=2.19.1
|
requests>=2.26.0
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue