Package: django-openapi
django-openapiA minimal FastAPI implementation in Python2 + Django without pydanticWhy do you make this? Can't you just use FastAPI directly?I'm a big fan ofFastAPI. It's elegant and saves lots of doc maintaince & API spec communication costs for me.But FastAPI needs Python3 to run, some legacy projects I maintained are still using Python2 and built by  Django framework. It would take 2 migration steps (Python 2 to 3 and Django to FastAPI) for moving them onto FastAPI framework.So I decided to build a minimal FastAPI implementation in Python2 + Django, that I could instantly get the benefits from FastAPI without too many migrations on my legacy projects.Who should use this?People who like the way FastAPI works butAre still on the long migration process from Python2 to Python3Or don't want to do full system rewrite from Django to FastAPIOr don't want to upgrade from Python2 to Python3FeaturesAuto OpenAPI schema/document generation from Python function parameterAuto HTTP request parameter validation from Python function parametersPython 2/3 compatiable, you could use almost the same code for you Python2/3 projectsInstallationpip install django-openapiLive demo provided by GitpodClick the button below and launch a free live demo server via GitpodIf the button doesn't show up, you clould also use below link directlyhttps://gitpod.io/#https://github.com/tokikanno/django-openapiAfter Gitpod launched, if you see a dialog like this, just hit theOpen Browserbutton then you will get to the quick intro live demo server.Use ctrl + p (or cmd + p if u're using MacOS X) and search forintro.pyto see the source code of intro demo server.Quick startIn your Django projectImportOpenAPIfromdjango_openapiCreate an API object instanceAdd API object into urlpatterns# import OpenAPI from django_opeanapifromdjango_openapiimportOpenAPI# create an API object instanceapi=OpenAPI(title='My OpenAPI Test',prefix_path='/test_api')urlpatterns=[api.as_django_url_pattern()# Add API object into urlpatterns]Start you django debug server and open your browser with url likehttp://localhost:8000/test_api/_docs, this is the auto document page.Now let's try adding some basic routes for you APIfromdjango_openapiimportPath,Query,Form@api.get('/test/hello_via_path/{word}',tags=['test'])defhello_via_path(word=Path()):return{'hello':word}@api.get('/test/hello_via_query',tags=['test'])defhello_via_query(word=Query()):return{'hello':word}@api.post('/test/hello_via_form',tags=['test'])defhello_via_form(word=Form()):return{'hello':word}Reload your browser & see if anything changed to the auto document pageAdvanced routes via JSON body & JSON schema objectfromdjango_openapiimportBodyfromdjango_openapi.schemaimportBaseModel,StringFieldclassHelloPayload(BaseModel):word=StringField(default_value='world',min_length=3)@api.post('/test/hello_via_json_body',tags=['test'])defhello_via_json_body(payload=Body(HelloPayload)):return{'hello':payload.word}Reload agagin, the auto document page now should have 4 APIs on it.Browse to thedemo folderfor more advanced samples.TODOMore documents and samplesBetter schema validation error message handlingMore advanced field types (e.g.: EmailStringField, CommaSeparatedArrayField ...)