Enable docker containing debugging
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user