Skip to main content

Document a django API with Optic

Project description

Optic for Django

Optic Proxy Setup

Python APIs built in Django are easy to connect to Optic using our custom middleware. In this tutorial we'll show you how to connect the Optic Documenting Middleware to your Django app so that your integration tests document your code as they execute.

Add the Middleware to your Project

Install the Optic Documenting Middleware using pip

pip3 install optic-document-django

Making the Middleware Run During Testing

Now add the middleware to the file that configures the Django API. You should put the middleware at the very bottom of the stack.


Using the Middleware in your tests

The Documenting middleware will document all the requests/responses that your tests run. Since it is integrated at the middleware level there's no need to update any of your tests files or fixtures.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

optic-document-django-0.1.4.tar.gz (2.3 kB view hashes)

Uploaded source

Built Distribution

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page