- Python v3.10.5
- Django v4.1.3
- Djangorestframework v3.14.0
- MySQL
ACTIONS | HTTP METHODS | ENDPOINTS |
---|---|---|
REGISTER FOR AN ACCOUNT | POST | /api/register |
LOGIN WITH AN ACCOUNT | POST | /api/login |
LOGOUT FROM AN ACCOUNT | POST | /api/logout |
get profile data of all users
GET
/app/user
search user by username
/app/user/?search=
get friend list of authenticated user
GET
/app/friend
invite a particular authenticated user
GET
/app/user/{user-id}/invites/
decline request from a user with his user id assuming he sent a request to the authenticated user
POST
/app/user/{user-id}/declines/
accepts request from a user : his user id assuming he sent a request to the authenticated user
POST
/app/user/{user-id}/accepts/
view posts created by the authenticated user
GET
/feed/self-posts
view authenticated user friend posts like, comment
GET
/feed/friends-posts
like/unlike friend posts with post id
POST
/feed/friends-posts/{post-id}/likes
comment on friend posts with post id
POST
/feed/friends-posts/{post-id}/comments
- Download python v3.10.5
- Run the executable file as an administrator
- Add python path to environment variables
- Clone the following repository,
git clone https://github.com/mohammadjayeed/DRF_FriendSystem_v2
- Make a virtual environment with the following command
python -m venv venv
- Activate the virtual environment with the command
venv/scripts/activate
- Install dependencies
pip install -r requirement.txt
- Configure MySQL
configure MySQL client and make necessary changes in database section of the project settings folder
- Run the following command which creates migrations based on models or change of models
python manage.py makemigrations
- Run the following command to apply it to the database
python manage.py migrate
- Run the following command to create a superuser to access admin panel by adding the required information. We will require username and password to login to the admin panel
python manage.py createsuperuser
- Start the application by typing the following command
python manage.py runserver