Graphene CRUD Maker
This is a project to auto generate a graphql crud using graphene django
Requirements
- Python >= 3.6
- Django >= 2.2
- Graphene Django >= 2.0
Quick start
Installation
pip install graphene-crud-maker
Create a Django project
django-admin startproject core .
Add "graphene_crud_maker" to your INSTALLED_APPS setting like this:
INSTALLED_APPS = [
...
'myapp',
'graphene_crud_maker',
'graphene_django',
]
Note: "myapp" is the name of the app
Add GRAPHENE to your settings.py
define the schema location for Graphene in the settings.py file of your Django project:
link: https://docs.graphene-python.org/projects/django/en/latest/
GRAPHENE = {
"ATOMIC_MUTATIONS": True,
'SCHEMA': 'core.schema.schema.schema',
"SCHEMA_INDENT": 4,
"MIDDLEWARE": [
"graphene_django.debug.DjangoDebugMiddleware",
'graphql_jwt.middleware.JSONWebTokenMiddleware',
]
}
Note name "core" is the name of the project
Add URLS to your urls.py
from django.conf.urls import url
from django.views.decorators.csrf import csrf_exempt
from graphql_jwt.decorators import jwt_cookie
from graphene_django.views import GraphQLView
urlpatterns = [
# ...
url(r"graphql", csrf_exempt(jwt_cookie(GraphQLView.as_view(graphiql=True)))),
]
Create the app
python3 manage.py startapp myapp
Note: create models
Usage
Python
python3 manage.py maker --help
Output
Create Graphene CRUD
optional arguments:
-h, --help show this help message and exit
-n NAME, --name NAME App name to create the CRUD graphQL
-e [EXCLUDE ...], --exclude [EXCLUDE ...]
Fields to exclude in the CRUD (id, createdAt, updatedAt)
...
Command to create GraphQL
python3 manage.py maker -n myapp
Run the server
python3 manage.py runserver
GraphiQL
http://localhost:8000/graphql
Metadata
Release files for graphene-crud-maker 1.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| graphene-crud-maker-1.2.0.tar.gz | 8.8 kB | Without provenance | Details for graphene-crud-maker-1.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| graphene_crud_maker-1.2.0-py3-none-any.whl | Python 3 | none | any | Details for graphene_crud_maker-1.2.0-py3-none-any.whl |
Total release size: 19.1 kB
Release files / graphene-crud-maker-1.2.0.tar.gz
| Download URL | graphene-crud-maker-1.2.0.tar.gz |
|---|---|
| Size | 8.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b5d7da61b162aebc8357ec055aa6e4e56cfc7eb7974172b69f4511d35911a3ba
|
|
BLAKE2b-256 checksum How to use checksums |
7d1c2182fb4a16f39ce2a0a17cabfa79d788552e297495ef77c4455cf23edd4e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.6
|
Release files / graphene_crud_maker-1.2.0-py3-none-any.whl
| Download URL | graphene_crud_maker-1.2.0-py3-none-any.whl |
|---|---|
| Size | 10.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2715bc63c2893c049f4d90b589f568ac8c64d0c14a9c04cb53f6a18dac7650d1
|
|
BLAKE2b-256 checksum How to use checksums |
e29d52e52f66e5b2545da2d72e4b8cf9dd2ec6fa7cf8a4e0314ae10a81d931d4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.6
|
Security for graphene-crud-maker 1.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.