shared a local host django 1

shared a local host django

1. run python manage.py runserver 0.0.0.0:8000
2. figure out your ip address which is say 192.168.1.8
3. Add '192.168.1.8' to ALLOWED_HOSTS list in your settings.py file.
4. access 192.168.1.8:8000 on mobile.

Here is what the above code is Doing:
1. We are importing the HttpResponse class from the django.http module.
2. We are defining a function called index which takes request as its parameter.
3. We are returning an HttpResponse object that has “Hello, world. You’re at the polls index.” as its content.

Similar Posts