Total Pageviews

Sunday, March 5, 2023

Access Django app from other computers

This is very very simple

change in setting.py

ALLOWED_HOSTS = ['*']

python manage.py runserver 0.0.0.0:8000 

open linux terminal

sudo ifconfig

Get inet ipv4 address Run on other same local network PC

If you find following error

Using the URLconf defined in mysite.urls, Django tried these URL patterns, in this order: 
1. polls/ [name='index'] 
2. admin/ 
The current path, polls/, didn’t match any of these. Then

replace path(' ', views.index, name='index') with path('', views.index, name='index') in your polls/urls.py and check the result.



No comments:

Post a Comment

The Fix for the Double Login Prompt when run report 6i from form

  Since you are running in a Desktop (client-server) architecture , the login prompt and buffering are directly tied to how the local Window...