This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.conf import settings | |
class MobileTemplateMiddleware: | |
def process_request(self, request): | |
host = request.META.get('HTTP_HOST', '') | |
host_s = host.split('.') | |
if len(host_s) > 1: | |
subdomain = host_s[0] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class FooAdmin(admin.ModelAdmin): | |
def get_urls(self): | |
urls = super(ContentProjectAdmin, self).get_urls() | |
extra_urls = patterns('', | |
url(r'^dashboard/$', self.admin_site.admin_view(self.dashboard), name="cms_dashboard"), | |
) | |
return extra_urls + urls | |
NewerOlder