小编ism*_*nni的帖子

无效的块标记:'set'

我想在Jinja模板中设置一个变量.就这么简单.但我得到错误说:Invalid block tag: 'set', expected 'endblock'

这是我的模板:

{% block content %}
    <div class="col-lg-7 col-lg-offset-2">
        <div style="padding-top:100px"></div>
        <div class="panel panel-primary">
            <div class="panel-heading">
                <h3 class="panel-title">
                    <i class="mdi-social-person"></i>
                    Reports
                </h3>
            </div>
            <div class="panel-body">
                    {% set index = 'a' %}
            </div>
        </div>
    </div>
{% endblock content %}
Run Code Online (Sandbox Code Playgroud)

我认为设置应该是直截了当不是这么困难.

python django jinja2

5
推荐指数
2
解决办法
2166
查看次数

Python Social Auth 重定向到错误的 URL

我使用Python -社会-身份验证为我的Django的网站,让我们说:example.io。它正在工作。但是,在重新部署并尝试通过 Twitter 登录后,它重定向到错误的 URL,example只是,没有.io

我还尝试使用另一个 url, staging.example.io, 它仍然重定向到example, 没有stagingio

我尝试在本地部署它,所以 URL 是localhost:12345,并且它重定向到正确的 URL(到 localhost:12345 或 127.0.0.1:12345),并成功登录。

有人知道吗?

更新:我尝试使用另一个 url,例如 abc.def.com,但仍然重定向到example(没有 .io)。LinkedIn 社交身份验证也发生了这种情况。

python django redirect python-social-auth

5
推荐指数
0
解决办法
286
查看次数

标签 统计

django ×2

python ×2

jinja2 ×1

python-social-auth ×1

redirect ×1