-
Notifications
You must be signed in to change notification settings - Fork 424
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
25 additions
and
11 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,11 @@ | ||
from django.conf.urls import patterns, url | ||
import django | ||
from django.conf.urls import url | ||
from tenant_tutorial.views import HomeView | ||
|
||
urlpatterns = patterns('', | ||
url(r'^$', HomeView.as_view()), | ||
) | ||
|
||
urlpatterns = [ | ||
url(r'^$', HomeView.as_view()), | ||
] | ||
|
||
if django.VERSION < (1, 9, 0): | ||
urlpatterns = django.conf.urls.patterns('', *urlpatterns) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,11 @@ | ||
from django.conf.urls import patterns, url | ||
import django | ||
from django.conf.urls import url | ||
from customers.views import TenantView | ||
|
||
urlpatterns = patterns('', | ||
url(r'^$', TenantView.as_view()), | ||
) | ||
|
||
urlpatterns = [ | ||
url(r'^$', TenantView.as_view()), | ||
] | ||
|
||
if django.VERSION < (1, 9, 0): | ||
urlpatterns = django.conf.urls.patterns('', *urlpatterns) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,17 @@ | ||
import warnings | ||
from django.conf import settings | ||
from django.core.urlresolvers import reverse as reverse_default | ||
from django.utils.functional import lazy | ||
from tenant_schemas.utils import clean_tenant_url | ||
|
||
|
||
def reverse(viewname, urlconf=None, args=None, kwargs=None, prefix=None, | ||
current_app=None): | ||
url = reverse_default(viewname, urlconf, args, kwargs, prefix, current_app) | ||
url = reverse_default( | ||
viewname=viewname, | ||
urlconf=urlconf, | ||
args=args, | ||
kwargs=kwargs, | ||
current_app=current_app | ||
) | ||
return clean_tenant_url(url) | ||
|
||
reverse_lazy = lazy(reverse, str) |