Customizable urlize

62 views
Skip to first unread message

Johan Schiff

unread,
Jan 7, 2020, 7:24:52 AM1/7/20
to Django developers (Contributions to Django itself)
Hi Django.

I'm currently working on a project where we want to use Django template filter urlize, but with a custom url formatter. The way the Django code works atm, we can't extend urlize customize output. That means we have to go non-DRY and copy code. Generally I like using class based coding for this kind of thing, but Djangos template filters seems to prefer functions and discourage instantiation. Therefore, it would be nice to solve this in a functional style, in line with current design.

Wouldn't it be a good idea to extend django.utils.html.urlize, or am I looking at this the wrong way?

The function signature would be smthng like this:

def urlize(
        text,
        trim_url_limit=None,  # for compat reasons, though it would make sense to accomplish that with the formatter functions in the urlizetrunc filter.
        nofollow=False,
        autoescape=False,
        email_formatter: callable = None,
        url_formatter: callable = None,
    ):
    ...


Johan Schiff
Betahaus (SE)

Jure Erznožnik

unread,
Jan 7, 2020, 7:55:00 AM1/7/20
to django-d...@googlegroups.com
I've been monitoring this list for a bit, enough to see that 3.x is now
moving in the async direction.

Is there a roadmap as to where we want to get with this direction?


Or, to ask more directly:

I have been looking into django-channels for a while in order to start
catering for ever-increasing demands for more and more responsiveness in
my apps. Basically I see django-channels as a good approach at getting
the server to actually PUSH information to the clients. I sure hope I'm
not just wishful here, but that's how I understood this particular facet
of the project. There are some other things I also see quite appealing
in there.

Anyway, I understood that django-channels was a project just a tad too
big to simply be integrated into Django, but was heavily supported by
django core team?

OTOH I fear that with core django moving towards async will make
django-channels either hard to maintain or outright obsolete.

So, to finally arrive at the question: is the async action I have been
seeing going anywhere near where django-channels is today or is it a
completely separate effort? If the latter, what's the future outlook for
django-channels?


I sure hope I'm asking this in the right mailing list.


Thanks,
Jure

Adam Johnson

unread,
Jan 7, 2020, 12:43:40 PM1/7/20
to django-d...@googlegroups.com
Hi Jure

Andrew laid out the general plan in DEP 0009: https://github.com/django/deps/blob/master/accepted/0009-async.rst

I think this answers all your questions, for example:

WebSocket support will not be in Django itself; instead, we will make sure that Channels has all the hooks it needs to integrate cleanly and take over the ASGI root app location so it can handle WebSockets itself.

Thanks,
Adam


--
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-develop...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/ceac365f-70a0-2b1f-de6a-9cb171df4a79%40gmail.com.


--
Adam

Javier Buzzi

unread,
Jan 8, 2020, 4:31:23 AM1/8/20
to Django developers (Contributions to Django itself)
What does this have to do with what Johan Schiff asked about "customizable urlize"?

Jure Erznožnik

unread,
Jan 8, 2020, 4:36:27 AM1/8/20
to django-d...@googlegroups.com

I am sorry, it seems I misunderstood that "reply to list" (quick way of entering the "to" field) with subject change would create a new thread. I'm not really used to mailing lists.

LP,
Jure

--
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-develop...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages