Flask Bootstrap modal works on dev server, but not in production

泄露秘密 提交于 2019-12-11 23:03:48

问题


Does anyone face this issue.. I have a very strange behavior with Flask and Bootstrap modal. On my dev server http://127.0.0.1:5000/ I have a modal which appears after user is typing wrong login credentials:

HTML code in Index page:

<div class="modal fade" id="ExistsModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
        <div class="modal-dialog" role="document">
          <div class="modal-content">
            <div class="modal-header">
              <h5 class="modal-title" id="exampleModalLabel">This email already exists!</h5>
              <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                <span aria-hidden="true">&times;</span>
              </button>
            </div>
            <div class="modal-body">
              If you have forgotten your password, .......
            </div>
            <div class="modal-footer">
              <button type="button" class="btn btn-secondary" data-dismiss="modal">Continue</button>

            </div>
          </div>
        </div>
      </div>

But on my production 'http://flask-env.xxx.us-west-1.elasticbeanstalk.com I can see the modal only if I manually refresh a page!

For return function I'm using return redirect(url_for('index',_anchor='login')) and in index() I passed arguments!

{% if email_exists %}
          <script>
            $("#ExistsModal").modal('show');
          </script>
          {% endif %}

My question is - why modal show up after manual refresh on production? But on dev its works fine!

来源:https://stackoverflow.com/questions/55681679/flask-bootstrap-modal-works-on-dev-server-but-not-in-production

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!