This project is created from Django and Django Rest Framework. You can use Postman
to test the API Endpoints. Once logged in, a token will generate and you can use the Token as Header:
key: Authorization
value: Bearer {generated token}
In the project directory:
pip install virtualenv
virtualenv venv
./venv/Scripts/activate
'venv' is you virtual environment name
pip install -r requirements.txt
python manage.py migrate
python manage.py runserver
Open http://localhost:8000/api/posts/ to view it in the browser.
python manage.py loaddata sample-data.json
- Signup for a new user, and login. This way you can see the pre-populated Posts and comments. You can create a new post and/or comment to existing posts.
- User Endpoints
Signup - api/auth/signup/
Login - api/auth/login/
- Posts Endpoints
Retrieve All Posts - api/posts/
Retrieve and Update Single Post - api/posts/<id>/
Delete Post - api/posts/delete/<id>/
Retrieve Post by Logged in User - api/me/posts/
- Comment Endpoints
Retrieve all comments on a post - api/post/<post_id>/comments/
Retrieve, Upate and Delete comment - api/post/<post_id>/comments/<comment_id>
- Token API
api/gettoken/