[英]django REST swagger function based api does not have input PARAMETERS
[英]Swagger in Django rest function based api does not show properly on ubuntu server (production)
我無法在ubuntu django設置上正確顯示我的招搖。 我正在使用基於函數的API,就像這里https://github.com/m-haziq/django-rest-swagger-docs
這是無法正確顯示搖搖欲墜的結果-Ubuntu 16.04(在AWS中)
https://imgur.com/TnTNExa <-這是問題,如何解決?
但是在我的開發環境中,mac pc
https://imgur.com/E1Zst0E <---在PC(Mac)上表現出色
這是我的招搖模式。 如您所見,我有一些日志記錄:
https://gitlab.com/firdausmah/railerdotcom/blob/master/railercomapp/swagger_schema.py
以下是一些日志記錄:
2017-11-30 06:06:57,367 DEBUG xxxx home hello
2017-11-30 06:07:25,131 DEBUG get(self, request)
2017-11-30 06:07:25,132 DEBUG Check and load if the function has __doc__
2017-11-30 06:07:25,132 DEBUG swagger try yaml_doc
2017-11-30 06:07:25,134 DEBUG if yaml_doc
我的Django / NGINX / Ubuntu設置基於此:
https://jee-appy.blogspot.my/2017/01/deply-django-with-nginx.html
隨時查看我的代碼,
https://gitlab.com/firdausmah/railerdotcom/tree/master
昂首闊步可能是什么問題? 在發展其工作。 我設置開發和生產的方式沒有什么不同。 在生產中使用Nginx,Gunicorn,Supervisor。 在PC上,它在python manage.py runserver上運行。
此錯誤是因為無法訪問您龐大的靜態文件或在未知位置。 您可以在( http://railer.com/swagger/ )控制台中看到錯誤,該錯誤是:
要解決錯誤,請嘗試在您的settings.py
添加以下幾行:
STATICFILES_DIRS = (
os.path.join(BASE_DIR, "static"),
)
如果這不起作用,則將靜態文件目錄添加到其中。 有關更多信息,請查看以下答案:
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.