How to Run Django on a Local Server



Python


In this article, we show how to run Django on a local server.

So, you install Django, you create a project, you create an app, and you do all the necessary things so that you can have a functional page on a website.

Normally, in a testing environment, you would first run the file on a local server, especially if you're just beginning in Django. If you're already experienced, you will probably just run it on a live server that can show your content to the public. However, if you're first starting off, you would normally run your code first on your local server.

And Django makes this very easy.

To run your code on a local server, you would use the following line, shown below.



If you're on a Windows PC, you may have to change python to py. This is shown below.



Now, all you have to open do is open up a web browser and type in the following line



If you create an app, other than the home page, then you would specify that app.

For example, if you created the app, Articles, then you would specify the following.



After opening the browser and running a very simple app, this is what I got.

Running Django on a local server



And this is all that is needed to run Django on a local server.


Related Resources

How to Randomly Select From or Shuffle a List in Python



HTML Comment Box is loading comments...