Add django ninja
This commit is contained in:
parent
4aefc48716
commit
19cc196e34
4 changed files with 34 additions and 1 deletions
8
app/api.py
Normal file
8
app/api.py
Normal file
|
@ -0,0 +1,8 @@
|
|||
from ninja import NinjaAPI
|
||||
|
||||
api = NinjaAPI(version="1.0.0")
|
||||
|
||||
|
||||
@api.get("/hello")
|
||||
def hello(request):
|
||||
return {"response": "Hello world"}
|
|
@ -17,6 +17,9 @@ Including another URLconf
|
|||
from django.contrib import admin
|
||||
from django.urls import path
|
||||
|
||||
from app.api import api
|
||||
|
||||
urlpatterns = [
|
||||
path('admin/', admin.site.urls),
|
||||
path('api/v1/', api.urls)
|
||||
]
|
||||
|
|
23
poetry.lock
generated
23
poetry.lock
generated
|
@ -408,6 +408,27 @@ tzdata = {version = "*", markers = "sys_platform == \"win32\""}
|
|||
argon2 = ["argon2-cffi (>=19.1.0)"]
|
||||
bcrypt = ["bcrypt"]
|
||||
|
||||
[[package]]
|
||||
name = "django-ninja"
|
||||
version = "0.22.2"
|
||||
description = "Django Ninja - Fast Django REST framework"
|
||||
category = "main"
|
||||
optional = false
|
||||
python-versions = ">=3.7"
|
||||
files = [
|
||||
{file = "django_ninja-0.22.2-py3-none-any.whl", hash = "sha256:c53b098a8190f373ea2605c276a6061d48b2626500a9c6b9916c503e4b4a20eb"},
|
||||
{file = "django_ninja-0.22.2.tar.gz", hash = "sha256:913ebde7571d6a6968c9ac0b9e8a24680c46444d44fdd552f8831dbeede1292c"},
|
||||
]
|
||||
|
||||
[package.dependencies]
|
||||
Django = ">=2.2"
|
||||
pydantic = ">=1.6,<2.0.0"
|
||||
|
||||
[package.extras]
|
||||
dev = ["pre-commit"]
|
||||
doc = ["markdown-include", "mkdocs", "mkdocs-material", "mkdocstrings"]
|
||||
test = ["black", "django-stubs", "flake8", "isort", "mypy (==0.931)", "psycopg2-binary", "pytest", "pytest-asyncio", "pytest-cov", "pytest-django"]
|
||||
|
||||
[[package]]
|
||||
name = "exceptiongroup"
|
||||
version = "1.1.1"
|
||||
|
@ -2124,4 +2145,4 @@ indexer = ["ujson", "warcio", "idna", "beautifulsoup4", "lxml", "langdetect", "p
|
|||
[metadata]
|
||||
lock-version = "2.0"
|
||||
python-versions = ">=3.10,<3.11"
|
||||
content-hash = "b40fcb8fc85427fe91b9ba334eaa21bc58c746471650121fbf0846c859c6999e"
|
||||
content-hash = "9e8a04eb23e361a1493232289085251695eaeb08e165a36ad2ceeed03ad825cb"
|
||||
|
|
|
@ -34,6 +34,7 @@ pyarrow = {version= "==6.0.0", optional = true}
|
|||
pyspark = {version= "==3.2.0", optional = true}
|
||||
Levenshtein = {version= "==0.16.0", optional = true}
|
||||
django = "^4.2.4"
|
||||
django-ninja = "^0.22.2"
|
||||
|
||||
[tool.poetry.extras]
|
||||
indexer = [
|
||||
|
|
Loading…
Reference in a new issue