i got this error when i debugging. a debug stop at line "execute_from_command_line(sys.argv)" in the manage.py. the error message is "Exception has occurred: OperationalError could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/tmp/.s.PGSQL.5432"? psycopg2.OperationalError: could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/tmp/.s.PGSQL.5432"? The above exception was the direct cause of the following exception: File "d:\django projects ecipe-app-api\app\manage.py", line 18, in main execute_from_command_line(sys.argv) File "d:\django projects ecipe-app-api\app\manage.py", line 22, in main() django.db.utils.OperationalError: could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/tmp/.s.PGSQL.5432"?"
How can I resolve the problem "Import "django.http" could not be resolved from source Pylance(reportMissingModuleSource)"? VSCode does not allow the import of the django library added to the docker container.
I have a problem: 1. Added a service "db" in docker-compose.yml with postgres image. 2. When referencing the "db" in django's settings.py, the vscode debug shows error, where it says there is no "db" host. Do you know what it can be?
This seems to fail when I'm already using postgres for my project, is there any way to fix this error: django.db.utils.OperationalError: connection to server on socket "/run/postgresql/.s.PGSQL.5432" failed: No such file or directory Is the server running locally and accepting connections on that socket? When I check docker ps my database is in fact running on 5432 and healthy. Thanks!
did not understand , when you click on run and stat debugging how visual studio knows where to connect ? how it knows that I have to connect to container end point instead of starting it locally?
When I tried applying this to my project I got an error in VSCode 'Invalid message: "pythonPath" is not valid if "python" is specified'. I decided to instead clone your repository to try and play about with debugging with your exact code. However, I get the same error message there too? Any help would be great!
This is a great tutorial and the blog version is great, too. This is about the 5th of similar tutorials that i've tried. Perhaps most of them ran correctly at some time, but I couldn't follow them through to completion now. Of course, I might have misunderstood something or done something wrong, too. But what I was really looking for was a tutorial like this using PyCharm and targeting Virtual Box. I couldn't get any of those to work for me, but I am hoping what I learned here will transfer. I can't do much about the Virtual Box requirement, but I am okay with using Code if that is the easier path.
Hello, can you tell me if it is possible to work on vs code using Django modules auto-import? I assume that by entering, for example, LoginView and pressing Ctrl+Space, a suggestion will appear to import this class from internal Django modules, if, for example, I do not know where exactly in which module it is located. Please help me..
Thanks for another great tutorial. I think it's worth adding this to the existing Udemy course as 'Bonus' content (I got the advanced course). Does anyone know why VScode throws an error saying: "Invalid message: either "program", "module", or "code" must be specified"??? EDIT: nvm... Typo in launch.json
The video has already helped me a lot to find out how to debug Django via Brake Point. I usually use C# :D I have not made your version adjustments on my system. I also started Docker via Visual Studio Code. Otherwise I always got some kind of error messages. Thanks a lot for your video. Now I am one step closer to debugging NetBox plugins. :)
Hi Mark! I completed your course of Django Advance in udemy How to make that exiting project to run in VS code debug mode? and I found issue that I have to user from app.core.models import Recipe to get auto suggestion from VS code which lead to give error in project so I need to remove app. from it how to solve that also
Thank you very usefull! but it doesn't reload the code when modified as it happen outside the docker. Is there a way to get the code reloaded during debugging?
Hi Mark! In your Udemy course (django rest framework with TDD) you use an django command for wait for db, necessary for start up the server. How can we include more commands or previous commands before run server at launch.json or tasks.json? Thanks!
You can add more commands by creating new modules in the management/commands/ directory... So if you wanted a command called "import_data", you would copy the "wait_for_db.py" contents and name it "import_data.py"..
@@LondonAppDeveloper The problem I have is launching the command runserver in debug mode. The problem I have in recipe-app is that server starts without waiting database, getting an error. Then I think is needed launch wait_for_db command before runserver in the debugger configuration but I don't know how.
Helped so much on doing the same with odoo tnx
Doesn't work for me, the debug console turns orange for like a second and stops. I wonder because I've followed all the steps
Not seem to use docker-compose debug though, but mentioning it makes confusion.
i got this error when i debugging. a debug stop at line "execute_from_command_line(sys.argv)" in the manage.py. the error message is "Exception has occurred: OperationalError
could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
psycopg2.OperationalError: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
The above exception was the direct cause of the following exception:
File "d:\django projects
ecipe-app-api\app\manage.py", line 18, in main
execute_from_command_line(sys.argv)
File "d:\django projects
ecipe-app-api\app\manage.py", line 22, in
main()
django.db.utils.OperationalError: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?"
How can I resolve the problem "Import "django.http" could not be resolved from source Pylance(reportMissingModuleSource)"? VSCode does not allow the import of the django library added to the docker container.
I have issue when run debug: timed out waiting for launcher to connect
I am getting the error "Debug Adapter Executable not provided" error after executing docker command. App doesn't execute in debug mode. Please help.
I have a problem:
1. Added a service "db" in docker-compose.yml with postgres image.
2. When referencing the "db" in django's settings.py, the vscode debug shows error, where it says there is no "db" host.
Do you know what it can be?
Probably a typo or indentation issue in docker-compose.yml.... Also, check you didn't add spaces around environment variables in docker-compose.yml.
Did you solve it? I'm here with same problem.
@@gabrielhenrique2430 I'm not using this vscode integration anymore. Terminal only.
This seems to fail when I'm already using postgres for my project, is there any way to fix this error:
django.db.utils.OperationalError: connection to server on socket "/run/postgresql/.s.PGSQL.5432" failed: No such file or directory
Is the server running locally and accepting connections on that socket?
When I check docker ps my database is in fact running on 5432 and healthy. Thanks!
Great video, thank you!
I'm using PyCharm myself, but I picked up a couple of interesting Docker nuggets from this like the user part.
Awesome! Exactly what I was looking for...
Glad to hear it.
Thanks for the video
I need to learn docker
did not understand , when you click on run and stat debugging how visual studio knows where to connect ?
how it knows that I have to connect to container end point instead of starting it locally?
When I tried applying this to my project I got an error in VSCode 'Invalid message: "pythonPath" is not valid if "python" is specified'.
I decided to instead clone your repository to try and play about with debugging with your exact code. However, I get the same error message there too?
Any help would be great!
Thank you, it was very useful!
Glad it was helpful!
Great tutorial
I am so glad to discover this channel
Thank you! That's nice.
This is a great tutorial and the blog version is great, too. This is about the 5th of similar tutorials that i've tried. Perhaps most of them ran correctly at some time, but I couldn't follow them through to completion now. Of course, I might have misunderstood something or done something wrong, too.
But what I was really looking for was a tutorial like this using PyCharm and targeting Virtual Box. I couldn't get any of those to work for me, but I am hoping what I learned here will transfer. I can't do much about the Virtual Box requirement, but I am okay with using Code if that is the easier path.
Perfect!!!!
Hello, can you tell me if it is possible to work on vs code using Django modules auto-import? I assume that by entering, for example, LoginView and pressing Ctrl+Space, a suggestion will appear to import this class from internal Django modules, if, for example, I do not know where exactly in which module it is located. Please help me..
Perfect tutorial mate!! Keep it up
Great video!!
It takes me 30 seconds to enter the debugging mode inside the contain, is there a way to speedup the startup? Thanks
@@Neeoooo You can connect to a docker container on VSCode with SSH. Then you debug the Django app inside the container.
Thanks for another great tutorial. I think it's worth adding this to the existing Udemy course as 'Bonus' content (I got the advanced course).
Does anyone know why VScode throws an error saying:
"Invalid message: either "program", "module", or "code" must be specified"???
EDIT: nvm... Typo in launch.json
can you please make a tutorial with docker django in pycharm please?
I'll keep this in mind while we plan content. Thanks for the suggestion.
thanks for the video !!
The video has already helped me a lot to find out how to debug Django via Brake Point. I usually use C# :D
I have not made your version adjustments on my system. I also started Docker via Visual Studio Code. Otherwise I always got some kind of error messages.
Thanks a lot for your video. Now I am one step closer to debugging NetBox plugins. :)
Hi Mark!
I completed your course of Django Advance in udemy
How to make that exiting project to run in VS code debug mode?
and I found issue that I have to user from app.core.models import Recipe
to get auto suggestion from VS code which lead to give error in project so I need to remove app. from it how to solve that also
Hmm good question... You can probably use the same Dockerfile with a few changes.
Thank you very usefull! but it doesn't reload the code when modified as it happen outside the docker. Is there a way to get the code reloaded during debugging?
mount the working directory with the volume in the container
Hi Mark! In your Udemy course (django rest framework with TDD) you use an django command for wait for db, necessary for start up the server. How can we include more commands or previous commands before run server at launch.json or tasks.json? Thanks!
You can add more commands by creating new modules in the management/commands/ directory... So if you wanted a command called "import_data", you would copy the "wait_for_db.py" contents and name it "import_data.py"..
@@LondonAppDeveloper The problem I have is launching the command runserver in debug mode. The problem I have in recipe-app is that server starts without waiting database, getting an error. Then I think is needed launch wait_for_db command before runserver in the debugger configuration but I don't know how.
@@alejandrotraver8744 Did you solved this problem? What kind of error did you have?
No, I will not debug django like this, it is too complicated.
U,,,