There are two ways to generate an OpenAPI spec in Django Rest Framework: CLI command and API endpoint. How it worksThe actual spec is produced by an underlying generator class, called by either a CLI command or an API endpoint. Long story short: generator collects the project endpoints from settings.