Django: Get Current Site & Display It


/ Published in: Python
Save to your folder(s)

In template: http://{{ site.domain }}


Copy this code and paste it in your HTML
  1. from django.contrib.sites.models import Site
  2. Site.objects.get_current()

URL: http://docs.djangoproject.com/en/dev/ref/contrib/sites/

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.