Project-Demo.mp4
For more detail overview visit this link: https://youtu.be/4XTaPGTVto0
- Frontend: HTML5, CSS3, Bootstrap5, JavaScript
- Backend: Python=3.11.4, Django=4.2.5
- Database: PostgreSQL, (Hosted on Render for Production)
- Static and Media Upload: AWS S3 Bucket using Cloudflare R2
- API: Django-REST-Framework
- Version Control: Git, GitHub
- Editor: VS Code
- Operating System: Ubuntu 23.04 LTS
- Browser(Tested On): Google Chrome, Microsoft Edge, Mozilla Firefox
- Install Python3
- Install pip
sudo apt install python3-pip
- Clone the repository
git clone https://github.com/MusfiqDehan/task-manager.git
- Go to the project directory
cd task-manager
- Create a virtual environment
python3 -m venv venv
- Activate the virtual environment
source venv/bin/activate
- Install the dependencies
pip3 install -r requirements.txt
- Run the server
python manage.py runserver
-
Open the browser and go to http://127.0.0.1:8000/
-
To deactivate the virtual environment
deactivate
- Install PostgreSQL
sudo apt install postgresql postgresql-contrib
- Login to PostgreSQL
sudo -u postgres psql
- Create a database
CREATE DATABASE task_manager;
- Create a user
CREATE USER task_manager_user WITH PASSWORD 'task_manager_password';
- Grant privileges to the user
GRANT ALL PRIVILEGES ON DATABASE task_manager TO task_manager_user;
- Exit from PostgreSQL
\q
-
Open the
settings.py
file fromtask_manager
directory -
Create a file named
.env
in thetask_manager
directory and add the following lines
SECRET_KEY=your_secret_key
DEBUG=False
DB_ENGINE=django.db.backends.postgresql
DB_NAME=task_manager
DB_USER=task_manager_user
DB_PASSWORD=task_manager_password
DB_HOST=localhost
DB_PORT=5432
See the .env.example
file for reference.
-
You will find a file named
db.json
in the root directory -
Run the following command to import data from
db.json
python3 manage.py loaddata db.json
- Migrate Database
python manage.py makemigrations
python manage.py migrate
- Run the server
python manage.py runserver
-
Open the browser and go to http://127.0.0.1:8000/
-
To access the admin panel, go to http://127.0.0.1:8000/admin/
-
Login with the following credentials:
- Username:
admin
- Password:
admin
- Username:
-
If these credentials don't work, you can create a superuser by running the following command:
python manage.py createsuperuser
-
Enter the username, email, and password
-
Now you can access the admin panel with the credentials you have just created
- Endpoint: http://127.0.0.1:8000/tasks/api/v1/tasks
- Method: GET
- Description:
- Returns all the tasks
- Endpoint: http://127.0.0.1:8000/tasks/api/v1/tasks/1
- Method: GET, PUT, PATCH, DELETE
- Description:
- Returns a single task
- Updates a single task
- Partially updates a single task
- Deletes a single task