How to run/test localhost on my phone

11 views
Skip to first unread message

john speny

unread,
Jul 11, 2018, 3:48:17 PM7/11/18
to Django users
i want to see that congratulation for running your first app message that appears when you first run your server for the first time on ur pc web browser. i want to see it on my phone.soo help me

Kasper Laudrup

unread,
Jul 11, 2018, 4:01:28 PM7/11/18
to django...@googlegroups.com
Hi John,
Run the development server like:

python manage.py runserver 0.0.0.0:8000

Then you should be able to access the Django development site by using
your PCs ip address on your phone assuming you're on the same network.

You will probably have to add your PCs IP address to the ALLOWED_HOSTS
variable in settings.py, but there will be a nice error page explaining
that.

For making sure the site looks good on smaller devices (eg. phones)
during development, I personally use Chrome/Chromiums developer tools
which has a nice option to show the page at lower resolution accessible
with Ctrl+Shift+M. That way you don't have to constantly look on your phone.

Hope that helps.

Kind regards,

Kasper Laudrup
Reply all
Reply to author
Forward
0 new messages