Enable docker containing debugging

This commit is contained in:
Ross
2022-11-14 13:48:23 +00:00
parent b24fda6970
commit 02eb812122
4 changed files with 16 additions and 1 deletions
+10
View File
@@ -1,9 +1,19 @@
#!/usr/bin/env python
import os
import sys
from django.conf import settings
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "rad.settings")
# Set up debugger if we are running in a container
if os.environ.get('RUN_MAIN'):
if settings.DEBUG_CONTAINER:
import debugpy
print("DEBUG LISTEN")
debugpy.listen(("0.0.0.0", 3459))
try:
from django.core.management import execute_from_command_line
except ImportError: