{% extends "base.html" %}
{% load url from future %}

{% block page-header%}
  <div class="page-header">
    <h1>Creating repository
  </div>
{% endblock %}

{% block content %}
  <p class="text-center lead">
    Just a moment... </br>
    <i class="icon-spinner icon-spin icon-4x"></i>
  </p>
{% endblock %}

{% block script %}
  <script>
    $(function(){
      setInterval(function(){
        $.ajax({ url: document.URL,
                 success: function(data){
                   if(data.match(/Creating repository/g)){
                     console.log("Not ready yet");
                   } else {
                     console.log("Ready!");
                     document.location.href = document.URL;
                   }
                 }
               });
      }, 5000);
    });
  </script>
{% endblock %}

{% extends "base.html" %}
{% load url from future %}

{% block page-header%}
  <div class="page-header">
    <h1>Creating repository
  </div>
{% endblock %}

{% block content %}
  <p class="text-center lead">
    Just a moment... </br>
    <i class="icon-spinner icon-spin icon-4x"></i>
  </p>
{% endblock %}

{% block script %}
  <script>
    // Called on success
    function onSuccess(data){
      if(data.match(/Creating repository/g)){
        console.log("Not ready yet");
      } else {
        console.log("Ready!");
        document.location.href = document.URL;
      }
    }

    // A function to poll the server
    function poll(){
      $.ajax({ url: document.URL,
               success: onSuccess,
               complete: poll,
               timeout: 50000 });
    }

    $(function() {
      poll()
    });
  </script>
{% endblock %}

Update polling function for repo_not_ready page
Update polling function for repo_not_ready page
