Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Django ASGI/WSGI application debug #189

Unanswered
joepreludian asked this question in Q&A
Discussion options

Hello team,
First, thank you for this project. I'm trying to understand how I could use this project with Django, or if this could be accomplished.

When running a simple python manage.py runserver --nothread, I grabbed the PID and ran the following command:

$ pystack remote <pid> --locals

But I'm seeing a low level call stack as follows:

Traceback for thread 240238 (pdm) [] (most recent call last):
 (Python) File "/home/jon/.local/bin/pdm", line 8, in <module>
 sys.exit(main())
 (Python) File "/home/jon/.local/share/pipx/venvs/pdm/lib/python3.10/site-packages/pdm/core.py", line 359, in main
 return core.main(args or sys.argv[1:])
 Arguments:
 args: None
 Locals:
 core: <Core at 0x7f92b97204f0>
 (Python) File "/home/jon/.local/share/pipx/venvs/pdm/lib/python3.10/site-packages/pdm/core.py", line 272, in main
 self.handle(project, options)
 Arguments:
 obj: None
 prog_name: None
 args: ["run", "python", "manage.py", "runserver", "0.0.0.0:9000", "--nothread"]
 self: <Core at 0x7f92b97204f0>
 Locals:
 project: <Project at 0x7f92b8b93dc0>
 options: <Namespace at 0x7f92b8b93c10>
 root_script: None
 extra: {}
 (Python) File "/home/jon/.local/share/pipx/venvs/pdm/lib/python3.10/site-packages/pdm/core.py", line 208, in handle
 command.handle(project, options)
 Arguments:
 options: <Namespace at 0x7f92b8b93c10>
 project: <Project at 0x7f92b8b93dc0>
 self: <Core at 0x7f92b97204f0>
 Locals:
 hooks: <HookManager at 0x7f92b88f83a0>
 command: <Command at 0x7f92b8a88a00>
 use_venv: <function at 0x7f92b8ad3010>
 HookManager: <type at 0x557661ab7230>
 FixCommand: <type at 0x557661ad77a0>
 (Python) File "/home/jon/.local/share/pipx/venvs/pdm/lib/python3.10/site-packages/pdm/cli/commands/run.py", line 447, in handle
 exit_code = runner.run(options.script, options.args)
 Arguments:
 options: <Namespace at 0x7f92b8b93c10>
 project: <Project at 0x7f92b8b93dc0>
 self: <Command at 0x7f92b8a88a00>
 Locals:
 runner: <TaskRunner at 0x7f92b88f8b80>
 hooks: <HookManager at 0x7f92b88f88b0>
 (Python) File "/home/jon/.local/share/pipx/venvs/pdm/lib/python3.10/site-packages/pdm/cli/commands/run.py", line 345, in run
 return self._run_process([command, *args], chdir=chdir, **merge_options(self.global_options, opts)) # type: ignore[misc]
 Arguments:
 seen: <set at 0x7f92b8a9e5e0>
 opts: None
 chdir: False
 args: ["manage.py", "runserver", "0.0.0.0:9000", "--nothread"]
 command: "python"
 self: <TaskRunner at 0x7f92b88f8b80>
 Locals:
 task: None
 (Python) File "/home/jon/.local/share/pipx/venvs/pdm/lib/python3.10/site-packages/pdm/cli/commands/run.py", line 236, in _run_process
 process.wait()
 Arguments:
 env: {}
 site_packages: False
 env_file: None
 shell: False
 working_dir: None
 chdir: False
 args: ["manage.py", "runserver", "0.0.0.0:9000", "--nothread"]
 self: <TaskRunner at 0x7f92b88f8b80>
 Locals:
 handle_int: <builtin_function_or_method at 0x7f92ba0c16c0>
 forward_signal: <function at 0x7f92b88f3f40>
 cwd: None
 real_command: "/home/jon/.pyenv/versions/3.12.2/bin/python3.12"
 expanded_command: "/home/jon/Developer/experiments/pytst/.venv/bin/python"
 command: "python"
 project_env: <PythonEnvironment at 0x7f92b88fb940>
 handle_term: 0
 process_cmd: ["/home/jon/Developer/experiments/pytst/.venv/bin/python", "manage.py", ...]
 this_path: "/home/jon/Developer/experiments/pytst/.venv/bin"
 project: <Project at 0x7f92b8b93dc0>
 (Python) File "/usr/lib/python3.10/subprocess.py", line 1209, in wait
 return self._wait(timeout=timeout)
 Arguments:
 timeout: None
 self: <Popen at 0x7f92b86df040>
 (Python) File "/usr/lib/python3.10/subprocess.py", line 1959, in _wait
 (pid, sts) = self._try_wait(0)
 Arguments:
 timeout: None
 self: <Popen at 0x7f92b86df040>
 (Python) File "/usr/lib/python3.10/subprocess.py", line 1917, in _try_wait
 (pid, sts) = os.waitpid(self.pid, wait_flags)
 Arguments:
 wait_flags: 0
 self: <Popen at 0x7f92b86df040>

The application ends with status code 0, but my django server still running. Is there something I'm not doing right? I'm trying to see the responses from my Django server.

Thank you and have a great end of day ahead!

You must be logged in to vote

Replies: 0 comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant

AltStyle によって変換されたページ (->オリジナル) /