djangosnippets.org: Latest snippets tagged with 'contrib'https://djangosnippets.org/tags/contrib/2011-09-02T13:55:18.394173-05:00Configurable defaults for contrib.sites default Site during syncdb
2011-09-02T13:55:18.394173-05:00chrischambershttps://djangosnippets.org/snippets/2536/<p>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 <code>localhost:8000</code>). I made this so that the admin's "view on site" button will work automagically during my development cycle (which often involves dropping …</p>
Freely redistributabledjango redirects middleware a bit more fleixble
2009-10-23T10:19:22.123324-05:00robertrvhttps://djangosnippets.org/snippets/1770/<p>This is replace for django.contrib.redirects.RedirectFallbackMiddleware which redirects exact matches as well as startswith matches for the redirect.old_path</p>
<p>I had a problem with my urls, because are dynamically generic, so I can't create one redirect entry on the database for each possible url. So I made django redirects to search any …</p>
Freely redistributable