Making Django App Publicly Accessible With Ngrok

Sometimes when developing our Django application, we need to make it publicly accessible or want to share it with a friend without deploying it live.

To achieve it We can use ngrok to redirect what you are running on localhost to publicly available ngrok URL. Let’s get started.

What is ngrok ?

ngrok is a cross-platform application that enables developers to expose a local development server to the Internet with minimal effort. The software makes your locally-hosted web server appear to be hosted on a subdomain of, meaning that no public IP or domain name on the local machine is needed.

Installation of ngrok

If you are using windows or mac os you can refer the article below:

If you are using a linux os, you can refer the article below:

Running our web app on a ngrok server

To start ngrok we simply type “ngrok http [port]”, in our case we use port 8000, because it’s the default Django development server port.

ngrok http 8000

you will see the ngrok screen, and your ngrok URL, in my case it’s, you also have https connection available.

Now go to and add to ALLOWED_HOSTS. Run your Django development server.

python runserver

Now your Django App is available to the world under you can test external APIs, authentications, or share what you working on with your friends.

Note: When you are running ngrok server, you will be getting a different url, so replace with the url you get.

webdeveloper and programmer