N
N
neuro4live2021-10-17 16:46:37
Python
neuro4live, 2021-10-17 16:46:37

How to run django in virtual machine?

Hello! I use ubuntu in a virtual machine and run the django framework on it. After starting the server even, the site is available at 127.0.0.1:8000
If you follow the link on the virtual machine, then everything works correctly. If you follow the link on the host operating system (I have windows 10), it says that the site is not available
Port forwarding rules are configured as follows:
616c28c3a69c9655133602.jpeg

If you connect via putty via ssh, then everything works correctly, only the port must be specified as 3022. Please tell me how to solve this problem?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vladimir Kuts, 2021-10-17
@neuro4live

Run like this:
... manage.py runserver 0.0.0.0:8000

A
Alexander Karabanov, 2021-10-17
@karabanov

Run the application on the server using supervisor or systemd
Proxy requests to it through Nginx
Set up Debian, Nginx and Gunicorn for a Django project

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question