Facebook
From saeed, 1 Week ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 70
  1. How to Active Debug Mode For Django
  2. 1-Change this in DockerFile
  3. CMD ["python", "manage.py", "runserver", "0.0.0.0:8009"]
  4. to
  5. CMD ["sh", "-c", "pip install debugpy -t /tmp && python /tmp/debugpy --wait-for-client --listen 0.0.0.0:5677 ./manage.py runserver 0.0.0.0:8009"]
  6. 2-Add port in DockerCompose File
  7. ports:
  8.  - 8009:8009
  9.  - 5677:5677
  10. 3-add luanch.json to .vscode Folder
  11. {
  12.     "version": "0.2.0",
  13.     "configurations": [{
  14.        "name": "Python: Remote Attach",
  15.        "type": "python",
  16.        "request": "attach",
  17.        "connect": {
  18.            "host": "localhost",
  19.            "port": 5677
  20.         },
  21.         "pathMappings": [
  22.           {
  23.             "localRoot": "/home/saeed/Projects/InternalServices/ConsumerSubmitApp",
  24.             "remoteRoot": "/app"
  25.           }
  26.         ],
  27.       "django": true
  28.   }]
  29. }