This project is designed to manage users and tasks in a web application. It consists of two main components:
- User Authentication and Profile Management
- Task Management
The system allows users to register, log in, manage their profiles, and create, manage, and track tasks.
- Clone the repository.
- Create a virtual environment and install the packages from the requiremnets.txt with the command as (pip install -r requirements.txt)
- Run the program by activating the server (the urls/APIs can be referenced from the urls.py file of the app's and project's urls.py file.
The workflow is divided into two main parts:
- User Authentication and Profile Management
- Task Management
This part of the system focuses on handling user registration, login, logout, and user profiles.
-
When a new user wants to sign up for the application, they visit the Registration Page (
/register/). -
The user is presented with a form asking for:
- Username
- First Name
- Last Name
- Password
- Password Confirmation
-
Once the form is submitted, the system performs the following actions:
- Validates the form inputs (username, email, password, etc.).
- If valid, the system creates a new
Userinstance in the database. - A new
Profileinstance is automatically created and linked to the user, storing additional information likebioandlocation.
-
After successful registration, the user is redirected to the Login Page (
/login/).
-
The user can log in using their username and password by visiting the Login Page (
/login/). -
Upon submission, the system checks the user’s credentials (username and password) using Django's authentication system. If the credentials are correct:
- A session is created for the user.
- The user is redirected to their Profile Page (
/profile/).
-
Once logged in, the user can view their personal profile on the Profile Page (
/profile/). -
The Profile Page shows the user’s:
- Username
- First Name
- Last Name
- Bio (added during registration or later)
- Location (optional)
-
The user cannot directly edit this page from the frontend; the profile can be updated by changing the information in the database (e.g., via the Django admin interface or custom edit views, which can be added as an extension).
-
To log out, the user can visit the Logout Page (
/logout/), where they are prompted to confirm logging out. -
After confirmation, the system:
- Ends the user’s session.
- Redirects the user to the homepage or another page as defined (e.g.,
/).
This part of the system focuses on creating, viewing, and managing tasks. Task management is only available to logged-in users.
-
Once logged in, the user can navigate to the Task List Page (
/tasks/), where all their existing tasks are listed. -
To create a new task, the user clicks the Create Task button, which directs them to a form where they can input details like:
- Task Title
- Task Description
- Due Date (optional)
-
When the form is submitted:
- A new
Taskinstance is created in the database. - The task is automatically associated with the logged-in user (using the
userforeign key).
- A new
-
After task creation, the user is redirected back to the Task List Page where they can view their newly added task.
-
The Task List Page (
/tasks/) displays a list of all tasks associated with the logged-in user. -
For each task, the following details are shown:
- Title
- Description
- Due Date (if available)
- Completion Status (Completed/Incomplete)
-
Each task in the task list can be marked as Complete or Incomplete by the user. This is done by toggling the task's status.
-
When the user marks a task as complete:
- The
completedfield of the task is updated in the database toTrue. - The task status is displayed as "Completed" on the Task List Page.
- The
-
If the task is marked as incomplete, the system updates the
completedfield toFalse.
The relationship between users and tasks is one-to-many. Each user can have multiple tasks, but each task is associated with only one user.
-
User Registration and Authentication:
- The user first creates an account via the registration page.
- Upon successful registration, the system creates both a
Userinstance and aProfileinstance.
-
Task Creation:
- After logging in, the user can create tasks.
- Each task is associated with the logged-in user by saving the user ID in the
Taskmodel.
-
Task Management:
- The user can view, create, or modify tasks on their personal task list.
-
Profile Management:
- The user can view and modify their profile details via the Django admin interface (this can be extended with views to allow users to edit their profiles via the frontend).
-
User Registration:
- A new user visits the site and registers using the Register Page (
/register/). - They enter their information, including a username, email, first name, last name, and password.
- The user is successfully registered, and a
Profileobject is created in the database linked to this user.
- A new user visits the site and registers using the Register Page (
-
User Login:
- The user now logs in using the Login Page (
/login/) with their credentials. - Upon successful login, the user is redirected to their Profile Page (
/profile/).
- The user now logs in using the Login Page (
-
User Task Management:
- The logged-in user decides to add a new task.
- They click the Create Task button and fill in the task details.
- The system creates a new task linked to the user and displays it in the task list.
-
Task Completion:
- The user marks the task as completed.
- The task is updated with the new status in the database.
-
User Logout:
- The user decides to log out, confirming the action on the Logout Page (
/logout/). - The user is logged out and redirected to the homepage or another page as defined.
- The user decides to log out, confirming the action on the Logout Page (
Django's built-in authentication system handles user login and session management:
- Login: After successful authentication, Django stores the session information in the browser cookies.
- Logout: The session is terminated, and the user is redirected to the desired page.
This project is open-source and available under the MIT License.
This file provides detailed instructions and workflow for contributors and developers working with the User and Task Management system. You can use this README.md in your project to make it easier for others to understand and contribute to the codebase.