Skip to content

Instantly share code, notes, and snippets.

@fabiotatsuo
Created July 31, 2013 00:09
Show Gist options
  • Save fabiotatsuo/6118208 to your computer and use it in GitHub Desktop.
Save fabiotatsuo/6118208 to your computer and use it in GitHub Desktop.
Site_ID
>>> from django.contrib.sites.models import Site
>>> site = Site()
>>> site.domain = 'example.com'
>>> site.name = 'My website'
>>> site.save()
>>> site.id
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment