DEV Community

Cover image for Getting Started with Django: Setting Up Your First Django Project
CodeXmingle
CodeXmingle

Posted on

Getting Started with Django: Setting Up Your First Django Project

For many developers stepping into backend development with Python, one framework quickly comes up in conversation — Django.

Django is a powerful web framework that helps developers build secure, scalable, and maintainable web applications quickly. From startups to large platforms, Django has proven itself as one of the most reliable backend frameworks in modern development.

But for beginners, the first question is usually simple:

How do you actually start a Django project?

In this tutorial, we'll walk through the basic steps of setting up a Django project, so you can get your development environment ready and start building.

And if you're new to backend development, don’t worry — this guide is designed to be simple and practical.

Step 1: Install Python

Before installing Django, you need Python on your system.

To check if Python is installed, open your terminal or command prompt and run:

python --version

Or

python3 --version

If Python is installed, you should see something like:

Python 3.x.x

If not, download and install Python from the official website.

Quick Check for Readers

Before moving on:

  • Do you already have Python installed?
  • Which version are you currently using?

Drop it in the comments 👇

Step 2: Install Django

Once Python is ready, the next step is installing Django using pip, Python’s package manager.

Run this command:

pip install django

After installation, confirm it worked by checking the Django version:

django-admin --version

5.x.x

That means Django is successfully installed.

Step 3: Create a Django Project

Now let's create your first Django project.

Run the following command:

django-admin startproject myproject

This command creates a project folder with the basic structure needed for a Django application.

Your folder should look something like this:

myproject/
manage.py
myproject/
init.py
settings.py
urls.py
asgi.py
wsgi.py

Each of these files plays an important role in configuring your project.

Step 4: Run the Development Server

Navigate into your project folder:

cd myproject

Then run:

python manage.py run server

If everything is working correctly, you should see something like this:

Starting development server at http://127.0.0.1:8000/

Now open your browser and visit:

http://127.0.0.1:8000/

You should see Django’s welcome page, confirming your project is running successfully.

Your Turn

Did your Django server run successfully?

What message did you see in your terminal?

Step 5: Create Your First Django App

In Django, projects contain apps, which handle specific functionality.

To create an app, run:

python manage.py startapp blog

This creates a new app folder:

blog/
admin.py
apps.py
models.py
views.py
tests.py

Apps help keep your Django project organized and modular.

Why Django is Loved by Developers

Many developers choose Django because it provides:

  • Built-in authentication
  • Admin dashboards
  • Security features
  • ORM database management
  • Rapid development capabilities

In fact, platforms like Instagram, Pinterest, and Mozilla have used Django in parts of their systems.

Final Thoughts

Setting up a Django project is actually much simpler than many beginners expect. With just a few commands, you can have a fully functioning backend framework ready to build powerful web applications.
Once your environment is set up, the real fun begins — creating views, building APIs, designing models, and developing real applications.

Community Discussion

If you're learning Django or already using it, we'd love to hear from you:

  • What was the first project you built with Django?
  • Do you prefer Django for web apps or APIs?
  • What part of Django was hardest to understand at first?

Let’s share experiences and help new developers get started.

Top comments (0)