0% found this document useful (0 votes)
48 views3 pages

Django Project Guide

This document provides a step-by-step guide to creating a Django project, starting from installing Django to setting up a basic project structure. It includes commands for creating a project, running a development server, creating an app, registering the app, applying migrations, and creating a superuser for the admin panel. By following these steps, users can successfully set up a basic Django project and access the admin interface.

Uploaded by

ANIK DUTTA
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
48 views3 pages

Django Project Guide

This document provides a step-by-step guide to creating a Django project, starting from installing Django to setting up a basic project structure. It includes commands for creating a project, running a development server, creating an app, registering the app, applying migrations, and creating a superuser for the admin panel. By following these steps, users can successfully set up a basic Django project and access the admin interface.

Uploaded by

ANIK DUTTA
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Django Project Creation Guide

Step 1: Install Django

Ensure you have Python installed (preferably 3.8+). Then, install Django using pip:

pip install django

Step 2: Create a Django Project

Run the following command to create a new Django project:

django-admin startproject project_name

Example:

django-admin startproject myproject

This will create a directory structure like this:

myproject/

- [Link]

- myproject/

- __init__.py

- [Link]

- [Link]

- [Link]

- [Link]

Step 3: Navigate to the Project Directory

cd myproject
Step 4: Run the Development Server

To check if everything is working, run:

python [Link] runserver

You should see output like:

Starting development server at [Link]

Open a browser and go to [Link] and you should see the Django welcome page.

Step 5: Create a Django App

Inside your project, create an app to handle specific functionalities:

python [Link] startapp app_name

Example:

python [Link] startapp blog

This creates a folder structure like:

blog/

- migrations/

- __init__.py

- [Link]

- [Link]

- [Link]

- [Link]

- [Link]
Step 6: Register the App in [Link]

In myproject/[Link], add 'blog' to the INSTALLED_APPS list:

INSTALLED_APPS = [

'[Link]',

'[Link]',

'[Link]',

'[Link]',

'[Link]',

'[Link]',

'blog', # Add your app here

Step 7: Apply Migrations

python [Link] migrate

Step 8: Create a Superuser (For Admin Panel)

python [Link] createsuperuser

Follow the prompts to enter a username, email, and password.

Step 9: Run the Server and Access the Admin Panel

Start the server:

python [Link] runserver

Go to [Link] and log in with your superuser credentials.

Now, you have a basic Django project set up!

You might also like