Was normal normal funktionierte, hat mich gerade aufgegeben. Wenn wie unten jede Art von manage.py
Befehl, ich sehe Performing system checks...
Django manage.py Befehl hängt
python manage.py runserver
oder
python manage.py makemigrations
Nach etwa 30-60 Sekunden hängen, dann bekomme ich:
System check identified no issues (0 silenced).
Welche hängt und hängt und hängt ... dann nach etwa 6 Minuten, sehe ich wieder die normale Quit the server with CONTROL-C
Um dieses Problem zu debuggen, habe ich sogar versucht, meine auskommentieren Apps und Middleware, sowie andere Anwendungen auf meinem PY herunterfahren und einen Neustart durchführen, immer noch keine Änderung. Was muss ich sonst noch sehen? Das erscheint viel zu lange.
settings.py
import os
import logging
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SITE_ROOT = os.path.realpath(os.path.dirname(os.path.abspath(__file__)))
print ("SITE_ROOT: {0}".format(SITE_ROOT))
print ("BASE_DIR: {0}".format(BASE_DIR))
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'blah'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'user_auth',
#'users',
]
#Handle session is not Json Serializable
SESSION_SERIALIZER = 'django.contrib.sessions.serializers.PickleSerializer'
#Parameters for setting the expiry
SESSION_SAVE_EVERY_REQUEST = True
SESSION_EXPIRE_AT_BROWSER_CLOSE = True
SESSION_COOKIE_AGE = 10
LDAP_SERVER = '10.253.8.31'
LDAP_AUTH_SEARCH_BASE = "ou=Konzern, dc=compnayx, dc=de" # The LDAP search base for looking up users.
DOMAIN_NAME = 'MyDomain'
AUTHENTICATION_BACKENDS = (
'django.contrib.auth.backends.ModelBackend',
)
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
#'UserAuth.Middleware.ldap_interface.LDAP_Auth_Backend',
]
# Auto logout delay in minutes
AUTO_LOGOUT_DELAY = 1 #equivalent to 1 minutes
ROOT_URLCONF = 'UserAuth.urls'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]
WSGI_APPLICATION = 'UserAuth.wsgi.application'
# Database
# https://docs.djangoproject.com/en/1.11/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
}
# Password validation
# https://docs.djangoproject.com/en/1.11/ref/settings/#auth-password-validators
AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
},
]
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'UTC'
USE_I18N = True
USE_L10N = True
USE_TZ = False # Does not assume timestamps in DB are all in UTC
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.11/howto/static-files/
STATIC_URL = '/static/'
ADMINS = (
('me', 'myemail'),
)
MAILER_LIST = ['myemail'] # To whom shall the mail be sent
EMAIL_HOST = 'smtp-mail.outlook.com'
EMAIL_HOST_USER = 'another_email' # We're sending the notification from here so we need HOST, PW, PORT
EMAIL_HOST_PASSWORD = 'my_password'
EMAIL_PORT = 25
EMAIL_USE_TLS = True
DEFAULT_FROM_EMAIL = 'myemail'
LOGGING = {
'version': 1,
'disable_existing_loggers': True,
'formatters': {
'standard': {
'format': '%(asctime)s [%(levelname)s] %(name)s: %(message)s'
},
},
'handlers': {
'default': {
'level':'DEBUG',
'class':'logging.handlers.RotatingFileHandler',
'filename': SITE_ROOT + '\\logfile.log',
'maxBytes': 1024*1024*5, # 5 MB
'backupCount': 5,
'formatter':'standard',
},
'request_handler': {
'level':'DEBUG',
'class':'logging.handlers.RotatingFileHandler',
'filename': SITE_ROOT + '\\django_request.log',
'maxBytes': 1024*1024*5, # 5 MB
'backupCount': 5,
'formatter':'standard',
},
'mail_admins': {
'level': 'DEBUG',
'class': 'django.utils.log.AdminEmailHandler',
},
},
'loggers': {
'': {
'handlers': ['mail_admins', 'default'],
'level': 'DEBUG',
'propagate': True
},
'django.request': {
'handlers': ['request_handler'],
'level': 'DEBUG',
'propagate': False
},
'django': {
'handlers': ['request_handler', 'default', 'mail_admins'],
'level': 'DEBUG',
'propagate': True,
},
}
}