This guide walks you through the steps to set up and run the Django-based to-do list application. The project allows users to add new tasks and view a list of tasks.
Before starting, make sure you have the following installed:
- Python 3.10 or later
- Pip (Python package installer)
- Git (for cloning the repository)
- Virtual Environment (optional but recommended for managing dependencies)
First, clone the repository to your local machine:
git clone https://github.com/ridzRUSH/django_todo.git
This will create a local copy of the project in the current directory.
Creating a virtual environment ensures that the project dependencies are isolated and won't conflict with other Python projects on your machine.
python -m venv env
env\Scripts\activate
python3 -m venv env
source env/bin/activate
Once the virtual environment is activated, you'll see (env)
in your command prompt or terminal.
Install the project dependencies using pip
from the requirements.txt
file:
pip install -r requirements.txt
This will install Django and any other dependencies needed to run the project.
The project uses SQLite by default, which is the default database in Django. To set up the database, apply the migrations:
python manage.py migrate
This will create the necessary database tables for the project.
Start the Django development server by running:
python manage.py runserver
This will start the server on http://127.0.0.1:8000/.
Open a web browser and visit the following URLs:
- Task List Page: http://127.0.0.1:8000/
- Add Task Page: http://127.0.0.1:8000/add/
On the Add Task Page, you can add new tasks, and on the Task List Page, you can view the tasks.
Here are some useful Django commands that you might need during development:
-
Start the server:
python manage.py runserver
-
Create migrations for changes in models:
python manage.py makemigrations
-
Apply migrations:
python manage.py migrate