Rapidly generate DRF API views for all models in your Django project. Simplifies development, but use with caution in production.
The Django DRF Package is a convenient package designed to simplify the integration of Django and Django Rest Framework (DRF). It provides tools and utilities that automate common tasks, such as model registration and generation of serializers and viewsets, and setup of URL patterns for API endpoints.
DRF EasyView is a lightweight package that automates the creation of Django REST Framework (DRF) API views for all models in your Django project. With EasyView, you can effortlessly generate API endpoints and serializers, enabling seamless CRUD (Create, Retrieve, Update, Delete) operations for your models.
Simplify your development process and reduce boilerplate code by leveraging the power of DRF EasyView. It provides an intuitive and efficient solution for quickly exposing your models as robust and customizable APIs, allowing you to focus on building your application's core functionalities.
Key Features:
- Automatic generation of API views and serializers for all models
- Support for standard CRUD operations (Create, Retrieve, Update, Delete)
- Seamless integration with Django and Django REST Framework
- Customizable options for fine-grained control over API behavior
Get started with DRF EasyView today and streamline your API development workflow!
Rapidly generate DRF API views for all models in your Django project. Simplifies development, but use with caution in production.
The Django DRF Package is a convenient package designed to simplify the integration of Django and Django Rest Framework (DRF). It provides tools and utilities that automate common tasks, such as model registration and generation of serializers and viewsets, and setup of URL patterns for API endpoints.
To install the package, you can use pip
:
pip install drf-easyview==2.0.2
To use the package in your Django project, follow these steps:
-
Add
drf_easyview
to theINSTALLED_APPS
list in your project's settings file. -
Include the package's URLs in your project's
urls.py
file:from django.urls import include, path urlpatterns = [ # Other URL patterns path('easyview/', include('drf_easyview.urls')), ]
-
Start the server and check the root endpoint to have all your models APIs generated for you.
Once models are created, you can add this package to your Django project to automatically create an OpenAPI for all your models. With the reference provided by the package, you can start creating custom API views based on your business or personal requirements.
Here's how you can use the package to create your custom API views:
-
Ensure that the Django DRF Package is installed and added to your project as explained in the installation steps.
-
Start the development server by running the following command:
python manage.py runserver
-
Access the OpenAPI documentation for your models by appending
/easyview/
to the base URL of your Django project. For example, if your project is running athttp://localhost:8000/
, the OpenAPI documentation will be available athttp://localhost:8000/easyview/
. -
Explore the available models and their corresponding endpoints in the OpenAPI documentation. This will provide you with the necessary information to create your custom API views.
-
Based on your requirements, you can create custom API views using Django Rest Framework's class-based views or function-based views. Refer to the Django Rest Framework documentation for detailed instructions on creating custom API views.
Before using the package, run the database migration command to create the necessary tables:
python manage.py migrate
To start the development server and access the APIs provided by your models, use the following command:
python manage.py runserver
Once the server is running, you can access the APIs for your models by appending /easyview/
to the base URL of your Django project.
For example, if your Django project is running at http://localhost:8000/
, you can access the APIs for your models at http://localhost:8000/easyview/
. The root of the API will provide a list of available models and their corresponding endpoints.
Please note that you should replace http://localhost:8000/
with the actual base URL of your Django project.
If you would like to contribute to the Django DRF Package, please refer to the CONTRIBUTING.md file for guidelines.
The Django DRF Package is released under the MIT License.
If you have any questions or feedback, please contact us at [bobburih@gmail.com].
The latest documentation for this project can be found at drf-easyview.readthedocs.io.