how to debug python in IntelliJ idea using vagrant docker - python

I am using Vagrant with a Ubuntu machine. Inside Vagrant I am using multiple docker boxes. One of them is for my Python Django Api.
Is there any good way to connect to Django with IntelliJ Idea/Pycharm ?
I am trying to using pycharm-debug.egg but I can't connect.
Should I forward the port from docker to Vagrant and Vagrant to my machine?
Any tutorial/help would be great.
Thanks

Related

Visual Studio Code Remote Python Debug on Windows

Is it possible to remotely develop and debug Python code on another PC on the same network (both Windows 10)? If so, what is the best way to do this?
I tried mapping a network drive to the project folder on the remote PC. I could open the folder in vs code, but cannot get it to start my virtual environment on the remote machine to start debugging. When I do "Select Python Interpreter" and choose the appropriate venv on the remote machine it does nothing. The same process works fine if the venv is installed on the development machine.
I normally use WSL remote for C++ development and it works great but cant find any documentation for remote Windows development, just WSL, docker and SSH (maybe an option?)
Advice appreciated. Thanks in advance...

How to access a server(which is running in a docker container) from other machine?

I'm new to docker. I have deployed a python server in a docker container. And I'm able to access using my python application from my machine using virtual machine IP(192.168.99.100).
Ex: http://192.168.99.100:5000
How do I access my the application from the other machine which is in the same network?
I tried giving my machine IP but didn't work.
I run the application using "docker run -p 5000:80 myPythonApp"
An easy way out would be to forward port from your host machine to the virtual machine.
Solution may differ w.r.t the VM providers & Host OS that you use. Like for vagrant you can do something as below -
https://www.vagrantup.com/docs/networking/forwarded_ports.html

Pycharm - Docker Image on Powerful Cloud Host as a Remote Interpreter?

I want to use a Python Docker image running on a powerful remote machine (cloud or local network - but different from the one I sit in front of and installed PyCharm on) as PyCharm Python remote interpreter.
How do I set up the PyCharm access?
Do I need to run an ssh server on the docker image and treat it as a classic ssh remote interpreter while setting up port mapping on the cloud host machine?
The tutorials (e.g. https://blog.jetbrains.com/pycharm/2017/03/docker-compose-getting-flask-up-and-running/) apparently only apply to Docker and the Docker image running locally on the same machine as PyCharm, "localhost" or "127.0.0.1". I would like "some_machine_with_many_gpus.cloudapp.net:port" or similar. Is this possible?

Can I use PyCharm windows with VirtualBox ubuntu

Can I use PyCharm (non-professional version) to develop code in windows and SSH or integrate virtualbox into PyCharm so it can send to my host in virtualbox Ubuntu server?
Yes you can. Share you code folder from windows using Vagrant or your virtual box into ubuntu and edit the code from pycharm windows. You can even debug code from ubuntu using pycharm. I have done this for months with Vagrant VMs.

Not able to debug on docker container with PyCharm 5

I'm trying to debug a Django app with PyChar that I have in a Docker container. Originally I only had docker-engine and docker-compose installed, but looking at this post:
https://www.jetbrains.com/pycharm/help/configuring-remote-interpreters-via-docker.html
So I've proceeded to install docker-machine, I can see it working. But when creating the remote virtualenv in Python interpreter settings page, I see no machines in the dropdown.
I've specified my docker-machine executable to be at /usr/local/bin, that's where it is (by the way, Linux Mint 17 here).
Any idea what I'm missing here?
Thanks!

Categories