36π
You need to explicitly tell the development server to run on your IP rather than localhost
.
Try python manage.py runserver your_ip:port
.
Though itβll be accessible if youβre running through apache or any other webservers other than the development server.
And to your 1st question, I would advice you to host and use a local apache server rather than using development server. Doing so, you can foresee the issues youβll be facing when moving to production.
And to 2nd, there are plenty of resources available configuring Django with different servers. Hail Google. π
38π
If you run
python manage.py runserver 0.0.0.0:8000
your development server will be available on port 8000 to anyone on your LAN and on localhost as well (and it does not depend on your ip address)
4π
In your settings.py change ALLOWED_HOSTS to
ALLOWED_HOSTS = ['*']
Run your server by entering the following command
python manage.py runserver 0.0.0.0:8000
In order to access the project from another device enter the IP address of the server followed by the port number, which is 8000 in this example.
3π
On windows I did everything you said but one thing was missing at my end to connect through Wi-Fi..
In settings.py:
ALLOWED_HOST = ['*']
Put Network profil in Private mode:
Windows > Settings > Network & Internet > Wi-Fi > (Click on_your_network) > In Network profil select: Private
Exemple: Run your server on the port 8000:
python manage.py runserver 0.0.0.0:8000
Then to access to the server with your other devices connected to the same network, enter the IPv4βs server address with the your port (here 8000)
Exemple, if the IPv4βs server address is 192.168.20.26 put the folling text directly in your browser:
192.168.20.26:8000
- Django database synchronization for an offline usage
- How do I simulate connection errors and request timeouts in python unit tests