This project is a Django REST Framework application for building a blog API. Users can register, create, read, update, and delete blog posts. The application also includes JWT authentication, pagination, search functionality, and the ability to retrieve random blog posts.
- User registration and JWT authentication (handled by the
account
app) - CRUD operations for blog posts (potentially handled by the
home
app, functionality depends on app implementation) - Pagination for displaying blog posts (functionality likely resides in the app handling blog posts)
- Search functionality for finding blog posts by keyword (functionality likely resides in the app handling blog posts)
- Retrieval of random blog posts (functionality likely resides in the app handling blog posts)
- Python (version 3.x recommended)
- pip (package installer for Python)
- A code editor or IDE
- Clone this repository.
- Create a virtual environment and activate it.
- Install the required dependencies:
pip install -r requirements.txt
- Apply database migrations:
python manage.py makemigrations
python manage.py migrate
- Run the development server:
python manage.py runserver
The API will be accessible at http://127.0.0.1:8000/ by default.
- Refer to the Django REST Framework documentation for detailed information on using the API: https://www.django-rest-framework.org/
- User registration and authentication likely happens under the
/account/
URL path (specific endpoints depend on theaccount
app implementation). - JWT authentication is required for accessing most API endpoints related to blog posts. You can obtain a JWT token by registering a user. Include the JWT token in the Authorization header of subsequent requests.
Additional Notes
- Refer to the codebase for specific details on how each endpoint is implemented, including which app handles blog post functionality.
- This is a basic implementation and can be extended further based on your specific needs.
Feel free to fork this repository and contribute by creating pull requests.
Updates based on URLs:
- The text mentions that specific functionalities like CRUD for blog posts, search, and random retrieval likely reside in the app mapped to the
/home/
URL path inurls.py
. This is because the provided URL structure suggests theaccount
app might handle user-related functionalities (registration, authentication) while another app might manage blog posts. - The example assumes blog post functionality resides under
/api/home/blogs/
. Update the example URL accordingly based on the actual implementation in your code.