Creating Your First Django Project and App: A Step-by-Step Guide

 


Creating Your First Django Project and App: A Step-by-Step Guide

1. Creating a Django Project

To start a new Django project, use the following command:

django-admin startproject projectname

This will create a project directory with necessary configurations.

2. Creating a Django App

Inside your project directory, create a Django app using:

python manage.py startapp appname

An app is a component within a Django project that handles specific functionality, like a blog, user authentication, or comments.

3. Running the Django Development Server

After creating your project and app, start the Django server:

python manage.py runserver

This will run the server locally, and you can access your application at:

http://127.0.0.1:8000/

Comments

Popular posts from this blog

Mastering Django: Project and App Folder Structure

Mastering Django Template Language (DTL): A Step-by-Step Guide

How to Add Templates in Django: Step-by-Step Guide