<bdo id='fBI7G'></bdo><ul id='fBI7G'></ul>

      <i id='fBI7G'><tr id='fBI7G'><dt id='fBI7G'><q id='fBI7G'><span id='fBI7G'><b id='fBI7G'><form id='fBI7G'><ins id='fBI7G'></ins><ul id='fBI7G'></ul><sub id='fBI7G'></sub></form><legend id='fBI7G'></legend><bdo id='fBI7G'><pre id='fBI7G'><center id='fBI7G'></center></pre></bdo></b><th id='fBI7G'></th></span></q></dt></tr></i><div id='fBI7G'><tfoot id='fBI7G'></tfoot><dl id='fBI7G'><fieldset id='fBI7G'></fieldset></dl></div>
    1. <tfoot id='fBI7G'></tfoot>
      <legend id='fBI7G'><style id='fBI7G'><dir id='fBI7G'><q id='fBI7G'></q></dir></style></legend>

      1. <small id='fBI7G'></small><noframes id='fBI7G'>

        如何配置“HTTPS"?带有 drf-yasg 自动生成的招摇页面的方案?

        How can I configure quot;HTTPSquot; schemes with the drf-yasg auto-generated swagger page?(如何配置“HTTPS?带有 drf-yasg 自动生成的招摇页面的方案?)

          • <tfoot id='A04Bu'></tfoot>
              <tbody id='A04Bu'></tbody>

            <small id='A04Bu'></small><noframes id='A04Bu'>

                <bdo id='A04Bu'></bdo><ul id='A04Bu'></ul>

                1. <i id='A04Bu'><tr id='A04Bu'><dt id='A04Bu'><q id='A04Bu'><span id='A04Bu'><b id='A04Bu'><form id='A04Bu'><ins id='A04Bu'></ins><ul id='A04Bu'></ul><sub id='A04Bu'></sub></form><legend id='A04Bu'></legend><bdo id='A04Bu'><pre id='A04Bu'><center id='A04Bu'></center></pre></bdo></b><th id='A04Bu'></th></span></q></dt></tr></i><div id='A04Bu'><tfoot id='A04Bu'></tfoot><dl id='A04Bu'><fieldset id='A04Bu'></fieldset></dl></div>

                  <legend id='A04Bu'><style id='A04Bu'><dir id='A04Bu'><q id='A04Bu'></q></dir></style></legend>
                  本文介绍了如何配置“HTTPS"?带有 drf-yasg 自动生成的招摇页面的方案?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  I know in a traditional swagger YAML file, we can define the schemes with:

                  schemes:
                    - http
                    - https
                  
                  //OR
                  
                  schemes: [http, https]
                  

                  However, how can I do the same thing with auto-generated swagger page with the drf-yasg library?

                  Now, the generated swagger page only contains HTTP schemes, but HTTPS is missing. I've tried set the DEFAULT_API_URL in setting.py to https://mybaseurl.com, but it seems not to be working.

                  解决方案

                  There is a solution.

                  When defining get_schema_view() in urls.py, use this code:

                  schema_view = get_schema_view(
                      openapi.Info( ... ),
                      url='https://example.net/api/v1/', # Important bit
                      public=True,
                      permission_classes=(permissions.AllowAny,)
                  )
                  

                  Note: You can either use https or http because of that better use this solution with an environment variable for different setups.

                  这篇关于如何配置“HTTPS"?带有 drf-yasg 自动生成的招摇页面的方案?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Adding config modes to Plotly.Py offline - modebar(将配置模式添加到 Plotly.Py 离线 - 模式栏)
                  Plotly: How to style a plotly figure so that it doesn#39;t display gaps for missing dates?(Plotly:如何设置绘图图形的样式,使其不显示缺失日期的间隙?)
                  python save plotly plot to local file and insert into html(python将绘图保存到本地文件并插入到html中)
                  Plotly: What color cycle does plotly express follow?(情节:情节表达遵循什么颜色循环?)
                  How to save plotly express plot into a html or static image file?(如何将情节表达图保存到 html 或静态图像文件中?)
                  Plotly: How to make a line plot from a pandas dataframe with a long or wide format?(Plotly:如何使用长格式或宽格式的 pandas 数据框制作线图?)
                    <bdo id='hKqIm'></bdo><ul id='hKqIm'></ul>
                    1. <i id='hKqIm'><tr id='hKqIm'><dt id='hKqIm'><q id='hKqIm'><span id='hKqIm'><b id='hKqIm'><form id='hKqIm'><ins id='hKqIm'></ins><ul id='hKqIm'></ul><sub id='hKqIm'></sub></form><legend id='hKqIm'></legend><bdo id='hKqIm'><pre id='hKqIm'><center id='hKqIm'></center></pre></bdo></b><th id='hKqIm'></th></span></q></dt></tr></i><div id='hKqIm'><tfoot id='hKqIm'></tfoot><dl id='hKqIm'><fieldset id='hKqIm'></fieldset></dl></div>

                    2. <small id='hKqIm'></small><noframes id='hKqIm'>

                          <tbody id='hKqIm'></tbody>
                        <legend id='hKqIm'><style id='hKqIm'><dir id='hKqIm'><q id='hKqIm'></q></dir></style></legend>

                            <tfoot id='hKqIm'></tfoot>