A back-end API built with django rest framework that allows users to track and manage their medications. Users can enter certain data related to their medications such as name, dosage, times taken per day, and other useful information.
- Clone the repository
git clone https://github.com/ManuelDelarosa1204/Django-Medication-Tracker-API.git
- Create a virtual environment
python3 -m venv venv
-
Activate the virtual environment
Windows
venv/Scripts/activate
Unix
source venv/bin/activate
-
Install the required packages
pip install -r requirements.txt
- Apply database migrations
python3 manage.py migrate
- Create a superuser (admin) (Fill out information as prompted)
python3 manage.py createsuperuser
- Run the development server
python3 manage.py runserver
-
Access the admin panel in your browser by navigating to
localhost:8000/admin
and logging in with superuser credentials. -
Obtain a User Token: In the admin panel, navigate to Tokens. Copy the token associated with a user to make authorized API calls.
GET users/
: List all users of the application
POST users/
: Create a user
GET users/{user slug}/
: Retrieve user data
POST medications/create/
: Create medications (requires token)
GET *medications/{user slug}/
: List all medications for a specific user (requires token)
DELETE *medications/{user slug}/{medication id}/delete/
: Delete a medication for a user