From: Aleksander Ɓukasz Date: Mon, 14 Oct 2013 15:06:05 +0000 (+0200) Subject: Starting with mil app X-Git-Url: https://git.mdrn.pl/edumed.git/commitdiff_plain/aca7f25034a7db679c5f8e02c9d12833d70cc152?ds=inline;hp=42c42960c2dce4500f12dd14a68a10ed4f06abf5 Starting with mil app --- diff --git a/edumed/settings.d/20-basic.py b/edumed/settings.d/20-basic.py index 3c900c8..340a94c 100644 --- a/edumed/settings.d/20-basic.py +++ b/edumed/settings.d/20-basic.py @@ -23,6 +23,11 @@ TEMPLATE_LOADERS = ( ROOT_URLCONF = 'edumed.urls' +SUBDOMAIN_URLCONFS = { + None: 'edumed.urls', + 'katalog': 'mil.urls', +} + # Python dotted path to the WSGI application used by Django's runserver. WSGI_APPLICATION = 'edumed.wsgi.application' diff --git a/edumed/settings.d/40-middleware.py b/edumed/settings.d/40-middleware.py index b9c614d..998b707 100644 --- a/edumed/settings.d/40-middleware.py +++ b/edumed/settings.d/40-middleware.py @@ -3,6 +3,7 @@ MIDDLEWARE_CLASSES = tuple(x for x in ( 'django.contrib.sessions.middleware.SessionMiddleware' if "django.contrib.sessions" in INSTALLED_APPS else None, #'django.middleware.locale.LocaleMiddleware', + 'subdomains.middleware.SubdomainURLRoutingMiddleware', 'fnpdjango.middleware.URLLocaleMiddleware', 'django.middleware.common.CommonMiddleware', diff --git a/mil/__init__.py b/mil/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/mil/urls.py b/mil/urls.py new file mode 100644 index 0000000..4f765de --- /dev/null +++ b/mil/urls.py @@ -0,0 +1,7 @@ +from django.conf.urls import patterns, include, url +from .views import root + + +urlpatterns = patterns('', + url(r'^$', root, name="root"), +) diff --git a/mil/views.py b/mil/views.py new file mode 100644 index 0000000..5d7fcbf --- /dev/null +++ b/mil/views.py @@ -0,0 +1,5 @@ +from django.http import HttpResponse + + +def root(request): + return HttpResponse('mil') \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 49b1e28..1a8d1d6 100644 --- a/requirements.txt +++ b/requirements.txt @@ -35,3 +35,4 @@ django-libravatar sorl-thumbnail>=11,<12 pyyaml +django-subdomains>=2.0.4,<2.1