Skip to content

Instantly share code, notes, and snippets.

@deepakprakash
deepakprakash / middleware.py
Created December 11, 2015 11:49 — forked from gijzelaerr/Django MultiDB selection from URL
Django MultiDB selection from URL
"""
Select database based on URL variable
Inspired by this Django snipped:
https://djangosnippets.org/snippets/2037/
It's assumed that any view in the system with a cfg keyword argument passed to
it from the urlconf may be routed to a separate database. for example:
@deepakprakash
deepakprakash / reserved_usernames.rb
Created June 9, 2012 22:51 — forked from caseyohara/reserved_usernames.rb
A list of reserved usernames to avoid vanity URL collision with resource paths
# A list of possible usernames to reserve to avoid
# vanity URL collision with resource paths
# It is a merged list of the recommendations from this Quora discussion:
# http://www.quora.com/How-do-sites-prevent-vanity-URLs-from-colliding-with-future-features
# Country TLDs found here:
# http://en.wikipedia.org/wiki/List_of_Internet_top-level_domains#Country_code_top-level_domains
# Languages found here: