📜  如何在 django....shell 中获取 SITE_ID - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:14.449000             🧑  作者: Mango

代码示例1
[ ... banner ... ]
>>>
>>> from django.contrib.sites.models import Site
>>>
>>> sorted([(site.id,site.name) for site in Site.objects.all()])
[(1, u'www.lvh.me'), (2, u'example.com'), (3, u'www.example.com'),...]
>>>
>>> quit()
user$