Re: include_block template tag

2021-04-19 Thread Jure Erznožnik

Hi Pierre,

I like your solution very much: implements what needs to be implemented, 
rationalises it very well and also adds all the other bits'n'pieces 
required for a proper PR.


I really hope this gets accepted, it was a huge thorn in our butts until 
we implemented it. Now we're (ab)using it everywhere.


LP,
Jure

On 17. 04. 21 10:23, Pierre Vanliefland wrote:

Hi Carlton,

Thanks for replying so quickly. It's definitely been an itch for me, 
as check the docs and Stack Overflow every year to check if this has 
been implemented!


I've completed the Gist with an "include/extends" example, but I 
haven't done the same for inclusion tags: as far as I know, an 
inclusion tag has a single, fixed template, which would require you to 
create one inclusion tag by component in your "design system", which 
would be even more cumbersome. And it would not allow you to override 
multiple block contents with arbitrary HTML, which is the goal here.


I plan to use my own implementation more extensively in the coming 
weeks to check its robustness, but I would be super happy to propose a 
PR if you find it interesting.


At the moment, it's not a big pain point for me, as I can use my 
custom tag, but I agree with the feeling of Carl above: while useful, 
it's a small feature and I'm afraid users won't be attracted by a 
third-party plugin for 50 lines of code...


I was wondering why I was feeling like this is a missing piece, and I 
remembered this morning: I used this feature a lot when I was using 
Twig (https://twig.symfony.com/doc/3.x/tags/embed.html).


It was super useful, especially when working on a web application (vs 
website), where you have a lot of similar sections and widgets, and 
I've been missing it a lot over the years.


Have a nice day!

Pierre

On Saturday, April 17, 2021 at 5:44:05 AM UTC+2 carlton...@gmail.com 
wrote:


Hi Pierre,

No problem at all! There’s some itch that folks have here so all
for the good discussing it.

Thanks for your work on the gist it looks good. I just glanced at
it now, and need to sit down longer but, can I ask you to add a
“What’s wrong with the current tools” section to text? i.e. How
would it look using include or a custom inclusion tag, and so why
would a new tag be better? I think that would be helpful. (Make
sense?)

Kind Regards,

Carlton



On 16 Apr 2021, at 23:03, Pierre Vanliefland
 wrote:

Hello! First, sorry if it is not appropriate to bring back this
thread from the grave, but I spent some time on finding a
solution for this and came up with an implementation that:

 1. Needs very little code
 2. Re-uses the existing code for the extends and include tags

I have written a Gist that contain the full code (including text)
and a bit of context:
https://gist.github.com/pvanliefland/bb676a906b900c7e29e46b474038a6ca


Do you think this is worth discussing here?

*Usage:*


  {% embed "section.html" %}
    {% block title %}Stats{% endblock %}
    {% block content %}
       
          A stat
          ...
      
    {% endblock %}
  {% endembed %}
  {% embed "section.html" %}
    {% block title %}Activity{% endblock %}
    {% block content %}
       Yesterday
       All my troubles seem so far away
    {% endblock %}
  {% endembed %}


On Wednesday, December 2, 2020 at 9:51:03 AM UTC+1
jure.er...@gmail.com  wrote:

Final comment for this:

we implemented the tag in our dynamicforms library (commit
with initial implementation

).

The initial implementation straight-out replaces the django
include tag, giving it an additional option to also declare a
block tag with nested blocks. That didn't work on Django 2.2.
though, so the final implementation now splits the tag in
block and non-block variants.

Anyway, I wanted to say that initial implementation wasn't
much feature-creep on the include tag anyway. It should be a
very small PR that would eliminate a huge disclaimer in
documentation in exchange for a couple (literally) lines of
new code.

TL;DR:

So: having implemented this, I'd say that code feature-creep
is cheaper than documentation / support effort needed to
explain away demands for the functionality?

Curtis, you're free to use this in your Sniplates. I'd just
warn about the helper function parse_tag which we got here


and don't know the license of, yet. We will get rid of it
ourselves if there's no reply shortly, but it was convenient
 

Re: Fellow Reports - April 2021

2021-04-19 Thread Mariusz Felisiak
Week ending April 18, 2021 

*Triaged: *
   https://code.djangoproject.com/ticket/32632 - Query resolution can be at 
least 3x slower in 3.2 (accepted) 
   https://code.djangoproject.com/ticket/32628 - Add extra data to 
autocomplete request (wontfix) 
   https://code.djangoproject.com/ticket/32625 - JSONField with callable 
default reports ModelForm.has_changed() when it hasn't (invalid) 
   https://code.djangoproject.com/ticket/32636 - 
QuerySet.values()/values_list() crashes on a combined queryset ordered by 
"extra" select. (created) 
   https://code.djangoproject.com/ticket/32634 - AlterField drops 
contraints in the wrong order when performed as reverse migration (invalid) 
   https://code.djangoproject.com/ticket/32637 - Technical 404 debug page 
doesn't display Http404's message in Django 3.2. (accepted) 
   https://code.djangoproject.com/ticket/32638 - threading.Thread.setDaemon 
has been deprecated in Python 3.10 (duplicate) 
   https://code.djangoproject.com/ticket/32639 - ADMINS and MANAGERS may 
contain invalid email addreses (wontfix) 
   https://code.djangoproject.com/ticket/32641 - Log the number of tests 
found in DiscoverRunner.build_suite() (accepted) 
   https://code.djangoproject.com/ticket/32642 - RuntimeError: 
'apps.core.apps' declares more than one default AppConfig on custom admin 
setup (invalid) 
   https://code.djangoproject.com/ticket/32646 - add request.json() 
shortcut (duplicate) 
   https://code.djangoproject.com/ticket/32644 - TemplateDoesNotExist for 
templates in local apps (invalid) 
   https://code.djangoproject.com/ticket/32648 - New sitemap 'alternates' 
generation feature is bugged using default values. (accepted) 
   https://code.djangoproject.com/ticket/32649 - ModelAdmin.search_fields 
crashes for a search term with unbalanced quotes. (accepted) 
   https://code.djangoproject.com/ticket/32645 - order_by().update() with 
joined fields crashes on MySQL/MariaDB. (accepted) 
   https://code.djangoproject.com/ticket/32643 - CookieStorage for 
contrib.messages crashes after upgrade to django 3.2 (accepted) 
   https://code.djangoproject.com/ticket/32651 - Combining Q with a Q 
containing Exists crashes (duplicate) 
   https://code.djangoproject.com/ticket/32656 - Broken link (invalid) 
   https://code.djangoproject.com/ticket/32657 - Combining an empty Q with 
a negated Exists un-negates the Exists lookup (accepted). 
   https://code.djangoproject.com/ticket/32653 - Quoting names in the 
Oracle backend is not consistent with the db_table generation. (accepted) 
   https://code.djangoproject.com/ticket/19159 - loaddata reports 
DeserializationError instead of MemoryError (invalid) 
   https://code.djangoproject.com/ticket/32659 - Autocomplete field: The 
results could not be loaded. (needsinfo) 

*Reviewed/committed: *
   https://github.com/django/django/pull/14011 - Fixed #32416 -- Made 
ThreadedWSGIServer close connections after each thread. 
   https://github.com/django/django/pull/14241 - Fixed #32627 -- Fixed 
QuerySet.values()/values_list() crash on combined querysets ordered by 
unannotated columns. 
   https://github.com/django/django/pull/14142 - Reduced the garbage 
collection frequency in runtests.py. 
   https://github.com/django/django/pull/14255 - Fixed #32635 -- Fixed 
system check crash for reverse o2o relations in CheckConstraint.check and 
UniqueConstraint.condition. 
   https://github.com/django/django/pull/14266 - Fixed #32643 -- Fixed 
decoding of messages in the pre-Django 3.2 format. 
   https://github.com/django/django/pull/14264 - Removed obsolete version 
check in setup.py. 
   https://github.com/django/django/pull/14261 - Fixed #32641 -- Made 
DiscoverRunner print the number of found tests. 
   https://github.com/django/django/pull/12688 - Fixed #29899 -- Made 
autodetector use model states instead of model classes. 

*Reviewed: *
   https://github.com/django/django/pull/14259 - Fixed #32648 -- Fixed 
VariableDoesNotExist rendering sitemaps template. 
   https://github.com/django/django/pull/14269 - Fixed #32652 -- Fixed 
links to new contributors FAQ. 

*Authored: *
   https://github.com/django/django/pull/14252 - Fixed #32637 -- Restored 
exception message on technical 404 debug page. 
   https://github.com/django/django/pull/14262 - Fixed #32649 -- Fixed 
ModelAdmin.search_fields crash when searching against phrases with 
unbalanced quotes.

Best,
Mariusz

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/a7d04422-3208-4ec7-a7f4-a88d2aba3b61n%40googlegroups.com.


Internal Server Error after deploy into hosting (cPanel)

2021-04-19 Thread Murugesan R
I have worked Django web site, and it's working successfully in the local 
host . But got Internal Server Error after moving into live for eg :  when 
I put *training.example.com/about* but working *training.example.com* . And 
page templates using common header and footer html codes, static files are 
working correctly. So please help review and advice . I have asked in 
stackoverflow , but not yet get solution. 

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/b3c0d8fb-5491-4077-b177-d2b656fa1f7dn%40googlegroups.com.


Re: Internal Server Error after deploy into hosting (cPanel)

2021-04-19 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
Hi!

I think you've found the wrong mailing list for this post. This mailing
list is for discussing the development of Django itself, not for support
using Django. This means the discussions of bugs and features in Django
itself, rather than in your code using it. People on this list are unlikely
to answer your support query with their limited time and energy.

For support, please follow the "Getting Help" page:
https://docs.djangoproject.com/en/3.1/faq/help/ . This will help you find
people who are willing to support you, and to ask your question in a way
that makes it easy for them to answer.

Thanks for your understanding and all the best,

Adam

On Mon, 19 Apr 2021 at 10:32, Murugesan R  wrote:

> I have worked Django web site, and it's working successfully in the local
> host . But got Internal Server Error after moving into live for eg :  when
> I put *training.example.com/about * but
> working *training.example.com * . And page
> templates using common header and footer html codes, static files are
> working correctly. So please help review and advice . I have asked in
> stackoverflow , but not yet get solution.
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-developers/b3c0d8fb-5491-4077-b177-d2b656fa1f7dn%40googlegroups.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CAMyDDM39q77f%3DOJHS5a%3DW55k2VBtCxR348dPwRxcfr%2BShB9LGw%40mail.gmail.com.