qiwihui
qiwihui

Reputation: 63

django rest swagger does not display properly

I want to use django-rest-swagger to document my APIs, so I follow the official doc to setting in my django app. But it doesn't display properly like below:

does-not-display-properly

I was using Nginx+supervisor+gunicorn to serve my django app. Is it possible that they cause it?

The proper page should be like below:

s
(source: django-rest-framework.org)

Upvotes: 1

Views: 3649

Answers (1)

sinitsynsv
sinitsynsv

Reputation: 893

I assume that your static files is not configured. You can see this in firebug or chrome dev tools.

  1. Read the documentation how to deploy static files (https://docs.djangoproject.com/en/1.8/howto/static-files/deployment/)
  2. Check that rest_swagger in your INSTALLED_APPS.
  3. Check that STATIC_URL, STATIC_ROOT settings is setted properly.
  4. Call collectstatic management command.
  5. Check that nginx configured to serve static files in STATIC_ROOT folder.

Upvotes: 2

Related Questions