Thanks a lot Michael that's perfect!! I have removed *--reload* and everything worked as expected!
now onto trying your example to get *--reload *working. Thanks again guys I really appreciate. Bach On Tuesday, 6 October 2020 at 10:48:10 UTC+11 [email protected] wrote: > The issue that makes pserve different from Marcel Demper's example is that > `pserve --reload` uses a multiprocess model (via hupper) to spawn your code > in a subprocess. If you run without `--reload` things will work as expected. > > If you want `--reload` to work, you will need to run ptvsd inside your > process instead of externally via something like: > > if I_SHOULD_ATTACH_TO_VSCODE: > try: > import ptvsd > except ModuleNotFoundError: > raise RuntimeError('ptvsd is not installed') > > print("Waiting for debugger attach ...", file=sys.stderr) > ptvsd.enable_attach(address=('0.0.0.0', 5678), > redirect_output=True) > ptvsd.wait_for_attach() > > You could run this inside your __init__.py or somewhere else that is > executed inside the subprocess. > > - Michael > > On Oct 5, 2020, at 17:31, Bach <[email protected]> wrote: > > Thanks Steve I've had a good start following that youtube video and > looking through deformdemo (thanks for the pointer) > But I can't get the *ptvsd* debugger to stop at breakpoints.. It's like > it attaches, but is not serving the app.. pserve is. So can't stop on > breakpoints. > > Perhaps I need to move to debugpy <https://github.com/microsoft/debugpy> > instead.. > > *Dockerfile* > > > docker-compose.yml > > > launch.js > > > > > > On Monday, 5 October 2020 at 14:35:43 UTC+11 Steve Piercy wrote: > >> Check out deformdemo. It might help you get part of the way there. >> >> https://github.com/Pylons/deformdemo >> >> --steve >> >> >> On 10/4/20 8:20 PM, Bach wrote: >> > Hi everyone, >> > >> > been trying to setup Visual Studio Code to debug my Pyramid App running >> inside a docker container. >> > >> > Does anyone have any sample files to share where you got that setup to >> work: >> > - Dockerfile >> > - docker-compose.yml >> > - launch.json >> > >> > I initially setup an environment as described in this video, but the >> example uses Flask and not pserve: >> > https://www.youtube.com/watch?v=b78Tg-YmJZI >> > >> > Any help or direction will be really appreciated! >> > >> > thanks >> > > -- > You received this message because you are subscribed to the Google Groups > "pylons-discuss" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/pylons-discuss/8980fc68-155f-4348-8109-9bd5a9e8b055n%40googlegroups.com > > <https://groups.google.com/d/msgid/pylons-discuss/8980fc68-155f-4348-8109-9bd5a9e8b055n%40googlegroups.com?utm_medium=email&utm_source=footer> > . > > -- You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/pylons-discuss/546b6ed5-a65f-4d01-8bc3-30f64940e7f2n%40googlegroups.com.
