Introduction
Django is a powerful web framework for building scalable and secure web applications with Python. In this guide, we will walk through how to:
Set up a Django project
Create two applications (blog and store)
Configure and test them in the browser
Requirements
Python installed (python-- version)
Basic knowledge of terminal commands
VS Code or any text editor
Git Bash/CMD/Powershell
Step 1: Set Up a Virtual Environment
Open your terminal and run:
Step 2:Install Django
- Confirm Django is installed
Step 3:Create Your Django Project
This will create the following structure:
Step 4: Create Two Apps: blog and store
Step: Register Apps in Settings
Edit mysite/settings.py:
Step 6:Add views
Blog/views.py
Store/views.py
Step 7:Set Up URLs
- Create blog/urls.py:
- Create store/urls.py:
- Create store/urls.py:
Step 8:Run the Development Server
Now visit your browser
blog, http://127.0.0.1:8000/
store, http://127.0.0.1:8000/blog/
Top comments (0)