Login

Snippets by chrischambers

Snippet List

Configurable defaults for contrib.sites default Site during syncdb

This simple snippet provides a more sensible default for the Site object created during the first pass of syncdb (that is, with a default domain of `localhost:8000`). I made this so that the admin's "view on site" button will work automagically during my development cycle (which often involves dropping and recreating a sqlite database). In addition, it provides 2 options for configuring the default Site as you'd like: settings parameters (`DEFAULT_SITE_DOMAIN` and `DEFAULT_SITE_NAME`) or `kwargs` (the latter takes precedence).

  • django
  • admin
  • sites
  • syncdb
  • contrib
  • manage
  • Site
  • defaults
Read More

chrischambers has posted 1 snippet.