From 530b249fed003585a732d2740470313e2bfb1644 Mon Sep 17 00:00:00 2001 From: drandreaskrueger Date: Thu, 17 Oct 2024 17:34:10 +0200 Subject: [PATCH] repairs ModuleNotFoundError mysite.settings --- .../python/pydev/debug/newconsole/PydevConsoleConstants.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/org.python.pydev.debug/src_console/org/python/pydev/debug/newconsole/PydevConsoleConstants.java b/plugins/org.python.pydev.debug/src_console/org/python/pydev/debug/newconsole/PydevConsoleConstants.java index fb258f762f..a90a4b2b3f 100644 --- a/plugins/org.python.pydev.debug/src_console/org/python/pydev/debug/newconsole/PydevConsoleConstants.java +++ b/plugins/org.python.pydev.debug/src_console/org/python/pydev/debug/newconsole/PydevConsoleConstants.java @@ -55,7 +55,7 @@ public final class PydevConsoleConstants { public static final String DEFAULT_INITIAL_INTERPRETER_CMDS = "import sys; print('%s %s' % (sys.executable or sys.platform, sys.version))\n"; public static final String DJANGO_INTERPRETER_CMDS = "DJANGO_INTERPRETER_CMDS"; - public static final String DEFAULT_DJANGO_INTERPRETER_CMDS = "import os; os.environ['DJANGO_SETTINGS_MODULE'] = '${DJANGO_SETTINGS_MODULE}'; import django\nif django.VERSION <= (1, 5):\n\tfrom django.core import management\n\timport ${DJANGO_SETTINGS_MODULE} as settings\n\tmanagement.setup_environ(settings)\nelse:\n\tfrom django.core.wsgi import get_wsgi_application\n\tapplication = get_wsgi_application()\n"; + public static final String DEFAULT_DJANGO_INTERPRETER_CMDS = "import os; os.environ['DJANGO_SETTINGS_MODULE'] = '${DJANGO_SETTINGS_MODULE}'; import django\n\nfrom django.conf import settings; settings.configure() # https://stackoverflow.com/a/22515135\n\nif django.VERSION <= (1, 5):\n\tfrom django.core import management\n\timport ${DJANGO_SETTINGS_MODULE} as settings\n\tmanagement.setup_environ(settings)\nelse:\n\tfrom django.core.wsgi import get_wsgi_application\n\tapplication = get_wsgi_application()\n"; public static final String INTERACTIVE_CONSOLE_MAXIMUM_CONNECTION_ATTEMPTS = "INTERACTIVE_CONSOLE_MAXIMUM_CONNECTION_ATTEMPTS"; public static final int DEFAULT_INTERACTIVE_CONSOLE_MAXIMUM_CONNECTION_ATTEMPTS = 50;