Hi Marten,

How are things going? Do you plan to make a push to merge this for 1.10? 
The alpha is scheduled for May 16. Are you still waiting for feedback? I 
think writing documentation would certainly facilitate that. Also, if 
there's any chance to break the existing commit into some smaller logic 
chunks/features to make review and merging easier, that would certainly be 
welcome from my perspective.

On Thursday, January 14, 2016 at 2:06:52 PM UTC-5, James Addison wrote:
>
> Marten,
>
>
> As you likely remember, I've been running your code for a few months now, 
> overall it's been pretty good. I mentioned some time ago that the list of 
> URLs displayed with `DEBUG=True` when triggering a 404 is sometimes empty, 
> or partially empty. This still happens for me, and I believe it has 
> something to do with using scheme/domain constraints - here are mine:
>
> class ConstraintBase(Constraint):
>     """
>     This exists purely as a way to ensure MRO mixin inheritance will work
>     """
>     def match(self, path, request=None):
>         return path, (), {}
>
>     def construct(self, url_object, *args, **kwargs):
>         return url_object, args, kwargs
>
>
> class SchemeConstraintMixin(object):
>     scheme = ''
>
>     def match(self, path, request=None):
>         if request and request.scheme == self.scheme:
>             return super().match(path, request)
>         raise Resolver404
>
>     def construct(self, url_object, *args, **kwargs):
>         url_object.scheme = self.scheme
>         return super().construct(url_object, *args, **kwargs)
>
>
> class HostConstraintMixin(object):
>     host = ''
>
>     def match(self, path, request=None):
>         if request and request.get_host() == self.host:
>             return super().match(path, request)
>         raise Resolver404
>
>     def construct(self, url_object, *args, **kwargs):
>         url_object.host = self.host
>         return super().construct(url_object, *args, **kwargs)
>
>
> class SchemeHostConstraint(SchemeConstraintMixin, HostConstraintMixin, 
> ConstraintBase):
>     def __init__(self, scheme, host):
>         self.scheme = scheme
>         self.host = host
>
>
> www_urlpatterns = [
>     url(r'^$', images_views.photos, {'template': 'images/homepage.html'}, 
> name='homepage'),
>     url(r'^users/', include('users.urls.profiles')),
>     url(r'^blog/', include('writing.urls.content'), {'section_slug': 'blog'}),
>     url(r'^galleries/', include('writing.urls.content'), {'section_slug': 
> 'galleries'}),
>     url(r'^writers/', include('writing.urls.authors')),
>     url(r'^', include('vendors.urls.www')),
>     url(r'^', include('images.urls')),
> ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
>
> my_urlpatterns = [
>     url(r'^', include('users.urls.my')),
>     url(r'^businesses/', include('vendors.urls.my')),
>     url(r'^user/', include('users.urls.auth')),
>     url(r'^user/', include('users.urls.social')),
> ]
>
> manage_urlpatterns = [
>     url(r'^admin/', include(admin.site.urls)),
> ]
>
> payments_urlpatterns = [
>     url(r'^braintree/', include('payments.urls.payments_braintree')),
> ]
>
> urlpatterns = [
>     # non-logged in pages; public facing and indexable by search engines
>     url(SchemeHostConstraint(*settings.SITE_DOMAIN_WWW), 
> include(www_urlpatterns)),
>     # logged in users only, public facing and not indexable by search engines 
> (perhaps some exceptions...)
>     
>
> ...

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/f7c7e16a-7c4d-4170-ba02-3325df52b06a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to