0% found this document useful (0 votes)
7 views1 page

Steps for Django Project

This document outlines the steps to create a Django project, starting from checking Python and Django installations to creating a new project and app. It includes commands for setting up the project structure, running the server, creating models, and managing migrations. Additionally, it covers creating a superuser and registering models in the admin interface.

Uploaded by

gcetly.2
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)
7 views1 page

Steps for Django Project

This document outlines the steps to create a Django project, starting from checking Python and Django installations to creating a new project and app. It includes commands for setting up the project structure, running the server, creating models, and managing migrations. Additionally, it covers creating a superuser and registering models in the admin interface.

Uploaded by

gcetly.2
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
You are on page 1/ 1

Steps for Django Project:

1. open Command Prompt and check if python is installed. Code: python --version.

If not installed, then install it.

2. Check if django is installed. Code: pythom m django --version. if not, install it using the command

pip install django

3. Create a new folder in Desktop. Open the Command Prompt within the Folder.

4. Type the command django-admin startproject learndjango (project name)

5. Verify that a new folder with the project name is created in the desktop folder.

It will have manage.py file and another folder that has 5 python files.

6. Open the folder in VS Code. (In Command prompt type the code - code .)

7. Open the terminal in VS Code.

8. Code: python manage.py runserver. Then click in the generated URL and see the output via
browser.

9. Code: python manage.py startapp polls (app name).

10. Verify that a new folder with the app name is created within the project folder. It will have

6 python files and a folder named as migrations.

11. Write your views code in the views.py file under the app folder.

12. Go to the settings.py file under the project folder and include your app in the installed apps list.

13. Go to urls.py file under the project folder and include the url pattern.

14. Create your models under models.py file.

15. In the terminal type - python manage.py makemigrations polls

16. In the terminal type - python manage.py sqlmigrate polls 0001

17. In the terminal type - pyhton manage.py migrate

18. Create super user - python manage.py createsuperuser. Enter the username, email address,
password.

19. Register your models under admin.py file.

You might also like