https://github.com/raiden70/drf_commands
DRF_commands is a Django package that helps you to create django rest framework endpoints faster using manage.py.
https://github.com/raiden70/drf_commands
api api-rest django django-rest-framework endpoints framework generic-views python3 rest
Last synced: about 1 year ago
JSON representation
DRF_commands is a Django package that helps you to create django rest framework endpoints faster using manage.py.
- Host: GitHub
- URL: https://github.com/raiden70/drf_commands
- Owner: raiden70
- License: bsd-3-clause
- Created: 2021-11-10T11:51:32.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-11-10T18:32:34.000Z (over 4 years ago)
- Last Synced: 2025-03-25T01:39:05.294Z (about 1 year ago)
- Topics: api, api-rest, django, django-rest-framework, endpoints, framework, generic-views, python3, rest
- Language: Python
- Homepage:
- Size: 15.6 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# DRF_commands
DRF_commands is a Django package that helps you to create django rest framework endpoints faster using **manage.py**.
You can visit **Django rest framework** website for more information about generic views:https://www.django-rest-framework.org/
Quick start
-----------
1. Run ``pip install DRF_commands``
1. Add Both "rest_framework" and "DRF_commands" to your **INSTALLED_APPS** of your **settings.py** like this::
````python
INSTALLED_APPS = [
...
'rest_framework',
'DRF_commands',
]
````
2. Create a Django application using DRF_commands:
``python manage.py createApp [yourAppName]``
3. Run ``python manage.py`` using custom commands of DRF_commands to create generic views.
Available commands:
-------------------
* *createApp* [yourAppName]
* *createSerializer* [appName][serializerName]
* *APIView* [appName][viewName]
* *CreateAPIView* [appName][viewName]
* *DestroyAPIView* [appName][viewName]
* *ListAPIView* [appName][viewName]
* *ListCreateAPIView* [appName][viewName]
* *RetrieveAPIView* [appName][viewName]
* *RetrieveDestroyAPIView* [appName][viewName]
* *RetrieveUpdateAPIView* [appName][viewName]
* *RetrieveUpdateDestroyAPIView* [appName][viewName]
* *UpdateAPIView* [appName][viewName]
> **_NOTE:_**
Make sure to execute those commands with the apps created by the command ``createApp`` of ``DRF_commands``
### Generated application working tree:
```
├── admin.py
├── apps.py
├── __init__.py
├── migrations
│ └── __init__.py
├── models
│ └── __init__.py
├── serializers
│ └── __init__.py
├── static
│ └── myapp
├── templates
│ └── myapp
├── tests.py
├── urls.py
└── views
└── __init__.py
```