0
0
Djangoframework~15 mins

Development server and runserver in Django - Mini Project: Build & Apply

Choose your learning style9 modes available
Development Server and runserver in Django
📖 Scenario: You are creating a simple Django project to understand how to start and run the development server. This server helps you see your web app in action on your local computer.
🎯 Goal: Learn how to set up a basic Django project and run the development server using the runserver command.
📋 What You'll Learn
Create a new Django project named myproject
Navigate to the project directory
Run the development server on the default port
Run the development server on port 8001
💡 Why This Matters
🌍 Real World
Django's development server lets you test your web app locally before sharing it with others or deploying it online.
💼 Career
Knowing how to start and run the Django development server is essential for web developers working with Django to build and test websites.
Progress0 / 4 steps
1
Create a new Django project
Open your terminal or command prompt and type django-admin startproject myproject to create a new Django project named myproject.
Django
Need a hint?

This command creates a new folder called myproject with all the basic files you need.

2
Navigate to the project directory
Change your directory to the new project folder by typing cd myproject in your terminal.
Django
Need a hint?

You need to be inside the project folder to run the server.

3
Run the development server on the default port
Start the Django development server by typing python manage.py runserver. This runs the server on port 8000 by default.
Django
Need a hint?

After running this, open http://127.0.0.1:8000/ in your browser to see your project.

4
Run the development server on port 8001
Run the Django development server on port 8001 by typing python manage.py runserver 8001.
Django
Need a hint?

You can specify a different port number after runserver to change where the server listens.