R
R
Ruswak2017-05-22 22:41:49
Android
Ruswak, 2017-05-22 22:41:49

How to send request from smartphone to local django server?

There is an application on the smartphone client and a django server on the computer. Is there any way to organize their communication? For example, via a usb cable.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Ruswak, 2017-05-22
@Ruswak

It helped me to add my ip adress (find out via ipconfig on windows) to ALLOWED_HOSTS in settings.py, start the server on it (python manage.py runserver address) and you can go to this address from the phone

R
RidgeA, 2017-05-22
@RidgeA

Well, it's enough that they are on the same subnet - for example, both devices are connected to the same router.
Or VPN. Then you can send any requests to each other. From the client, you need to know which ip to send the request to - either hardcode the ip of the server on the local network in the client, or, for example, write ip and the server host in the /etc/hosts file (for this you need to have root on android, about ios not I'll give you a hint, but I don't think it will be easy)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question