SimpleAPI-Django is a straightforward note API implemented in the Django framework, designed to showcase REST API principles for CRUD operations, authentication, and more. It leverages various Django packages, including Djoser for authentication, djangorestframework-simplejwt, djangorestframework-xml, drf-yasg for Swagger documentation (accessible via /swagger or /redoc), and pipenv for dependency management.
- Django 3.x and Django Rest Framework
- RESTful API supporting CRUD operations
- Authentication powered by Djoser
- Token-based authentication with djangorestframework-simplejwt
- Swagger documentation available at /swagger or /redoc
- Utilizes pipenv for dependency management
SimpleAPI-Django embodies best practices for creating a comprehensive REST API, including:
- Versioning to manage API changes gracefully
- Throttling mechanisms for controlling the rate of API requests
- Flexible rendering options (json, text/html, and xml)
- Pagination for handling large datasets
- Search capabilities for efficient data retrieval
- Ordering for sorting results based on specific criteria
-
Clone the repository:
git clone https://github.com/WannaCry081/SimpleAPI-Django.git
-
Create a virtual environment:
cd SimpleAPI-Django virtualenv venv
-
Activate the virtual environment:
source venv/Scripts/activate
-
Install dependencies:
pip install -r requirements.txt
-
Run migrations:
python manage.py migrate
-
Create a superuser:
python manage.py createsuperuser
-
Start the development server:
python manage.py runserver
Access the API at
http://localhost:8000/
.
Execute unit tests with:
python manage.py test
This project is licensed under the MIT License - see the LICENSE file for details.