Skip to main content

Django Localhost URL for all devices in your LAN

While building and running server to see the outcome of the site you have built you have been using a magical command :

And it will generate the server in the localhost 8080 as http://localhost:8080 or http://127.0.0.1

And with that you can visit that url in your device(host) from whichever browser you want and it will give the response as the site you created (Of course, given that you have the page built in ' ' url in urls.py)

But today I am going to show you how you can generate the url such that it can be viewed by any device within your Local Network from whichever devices you want provided that the device is connected to same network to the host device with the website built.

To do so, nothing more is required, just slight changes in command will work for you:

After that all you need to do is to open the url with the network IP address and add the port 8080

For example: If your IP address is 192.168.1.101

URL for the site will be http://192.168.1.101:8080

You can view your IP address by using ipconfig command using cmd:

Your network IP address will be in Wireless LAN adapter Wi-Fi - IPv4 section, if your connection to that device is wireless.


Comments

Popular posts from this blog

Abstraction on Details: Life

When I watch movies or any shows where there are some characters, and it depicts their livelihood. It shows activities that the character does, and the life goes on. And when I look on them, it feels so amazing to know that they are enjoying a heart out and it triggers a sense of urge to have such livelihood. I am watching BoJack right now. Although it is animation, I love the way the things are happening in his life. Although show is about showing the sad and self-awareness part of the life. It brings a different thought on me right now. Why do I feel so amazed to imagine the life like that character in shows at the first place? The answer that comes in my mind is, the show hides or blurs out the small and nitty-gritty of the life. Like, we often think about our hair is correct or not, we think about what to cook/eat tonight, we think about the work we have to attend tomorrow, we think about the dream we want to accomplish in near future, we think about the bud...

Why Social Media is good for you?

"Social Media is ruining our generation" you must have heard this sentence hundred time if not more. Infinity scroll feed in our fingertips have changed our life. But is this change only effecting us in bad way? While social media can make us hung in our phone for long long hours with dopamine hit, it also has some good deeds to us which we often fail to look on. The number of new business model and ideas that social media has brought today cannot be ignored. But today I am going to talk the different part that social media has helped humans on. One of the most important thing, it helped us is, today information is accessible to all the people. Every person on earth with smartphone and internet connection have access to news and updates from all over the world. In previous time, for one to learn new things they need first accumulate the motivation to gain knowledge then find the resource (which were not easily accessible) like books, magazines, videos, etc. But today, if the...

People are the Problem