How to Update the Current Browser URL

# UPDATE THE CURRENT URL IN BROWSER::
<script>

ChangeUrl = function(page, url) {

    if (typeof (history.pushState) != "undefined") {

        var obj = { Page: page, Url: url };

        history.pushState(obj, obj.Page, obj.Url);

        $('.breadcrumb-get-a-pro').attr('href', url);

    } else {

        alert("Browser does not support HTML5.");

    }

}

</script>

Sitemap in Python Django

Sitemap in Python Django

# For Sitemap
from django.views.generic import TemplateView
urlpatterns = [

    url(r'^admin/', admin.site.urls),

    #include testapp app url
    url(r'', include('testapp.urls')),

    url(r'^sitemap\.xml$', TemplateView.as_view(template_name='sitemap.xml', content_type='text/xml')),


]
**  keep the sitemap.xml file in app/templates/sitemap.xml

Show Success or Failure message in Python Django

# Save Flash Message Data
messages.success(request, 'Settings Updated successfully.')
# Show Message in Html from Message variable
{% if messages %}

    {% for message in messages %}

        <div class="alert alert-success">

             <a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>

             <strong>Success!</strong> {{message}}

        </div>

    {% endfor %}

{% endif %}
Or Like this,
<div class="col-sm-6">

    {% if messages %}

        <ul class="messages">

            {% for message in messages %}

                <li{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message }}</li>

            {% endfor %}

        </ul>

    {% endif %}

</div>