0
0
Djangoframework~5 mins

Creating a Django project

Choose your learning style9 modes available
Introduction

Creating a Django project sets up the basic structure to build a web application. It prepares folders and files so you can start adding your website features.

You want to start a new website using Django.
You need a clean setup with default settings and folders for your app.
You want to organize your code for easy development and maintenance.
Syntax
Django
django-admin startproject projectname

Replace projectname with your desired project name.

This command creates a folder with the project name containing necessary files.

Examples
This creates a new Django project named mysite.
Django
django-admin startproject mysite
This creates a Django project folder called blogapp for a blog website.
Django
django-admin startproject blogapp
Sample Program

This command creates a new Django project named testproject. It will generate a folder testproject with files like manage.py and a subfolder testproject containing settings and URLs.

Django
django-admin startproject testproject
OutputSuccess
Important Notes

Run this command in the folder where you want your project folder to be created.

Make sure you have Django installed before running this command.

After creating the project, you can run python manage.py runserver inside the project folder to start the web server.

Summary

Use django-admin startproject projectname to create a new Django project.

This sets up the basic folder and files needed to build your website.

Run the command in your terminal where you want the project folder created.