how to get site id in django shell

Solutions on MaxInterview for how to get site id in django shell by the best coders in the world

showing results for - "how to get site id in django shell"
Suzie
01 Nov 2017
1[ ... banner ... ]
2>>>
3>>> from django.contrib.sites.models import Site
4>>>
5>>> sorted([(site.id,site.name) for site in Site.objects.all()])
6[(1, u'www.lvh.me'), (2, u'example.com'), (3, u'www.example.com'),...]
7>>>
8>>> quit()
9user$