Re: [Django] #34220: Cannot import csrf_input_lazy from partially initialized module.

2 views
Skip to first unread message

Django

unread,
Dec 21, 2022, 3:01:29 AM12/21/22
to django-...@googlegroups.com
#34220: Cannot import csrf_input_lazy from partially initialized module.
-------------------------------------+-------------------------------------
Reporter: thommy | Owner: nobody
Type: Bug | Status: new
Component: Template system | Version: 4.1
Severity: Normal | Resolution:
Keywords: Jinja2 TemplateView | Triage Stage: Accepted
ImportError csrf_input_lazy |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by thommy):

Hi Mariusz,

thanks for the quick response. I'll give it a try.

However it might take a couple of days to be sure because the problem
happens so rarely.

Best regards
Thommy

--
Ticket URL: <https://code.djangoproject.com/ticket/34220#comment:2>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jan 2, 2023, 4:36:01 AM1/2/23
to django-...@googlegroups.com
#34220: Cannot import csrf_input_lazy from partially initialized module.
-------------------------------------+-------------------------------------
Reporter: thommy | Owner: nobody
Type: Bug | Status: new
Component: Template system | Version: 4.1
Severity: Normal | Resolution:
Keywords: Jinja2 TemplateView | Triage Stage: Accepted
ImportError csrf_input_lazy |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by thommy):

Hi Mariusz,

happy new year!

So far the exception hasn't occured again.

It would be great to see this patch in one of the next bugfix releases :-)

Best regards
Thommy

--
Ticket URL: <https://code.djangoproject.com/ticket/34220#comment:3>

Django

unread,
Jan 2, 2023, 4:49:35 AM1/2/23
to django-...@googlegroups.com
#34220: Cannot import csrf_input_lazy from partially initialized module.
-------------------------------------+-------------------------------------
Reporter: thommy | Owner: nobody
Type: Bug | Status: new
Component: Template system | Version: 4.1
Severity: Normal | Resolution:
Keywords: Jinja2 TemplateView | Triage Stage: Accepted
ImportError csrf_input_lazy |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak):

Replying to [comment:3 thommy]:


> Hi Mariusz,
>
> happy new year!

The same to you!

> So far the exception hasn't occured again.

That's great! Would you like to prepare PR?

> It would be great to see this patch in one of the next bugfix releases
:-)

Per our backporting policy it doesn't qualify for a backport, so it can be
fixed in Django 4.2, see
[https://docs.djangoproject.com/en/stable/internals/release-process/
Django’s release process] for more details.

--
Ticket URL: <https://code.djangoproject.com/ticket/34220#comment:4>

Django

unread,
Jan 5, 2023, 4:59:16 PM1/5/23
to django-...@googlegroups.com
#34220: Cannot import csrf_input_lazy from partially initialized module.
-------------------------------------+-------------------------------------
Reporter: thommy | Owner: nobody
Type: Bug | Status: new
Component: Template system | Version: 4.1
Severity: Normal | Resolution:
Keywords: Jinja2 TemplateView | Triage Stage: Accepted
ImportError csrf_input_lazy |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by rajdesai24):

hey Mariusz would love to draft a PR

--
Ticket URL: <https://code.djangoproject.com/ticket/34220#comment:5>

Django

unread,
Jan 5, 2023, 11:49:26 PM1/5/23
to django-...@googlegroups.com
#34220: Cannot import csrf_input_lazy from partially initialized module.
-------------------------------------+-------------------------------------
Reporter: thommy | Owner: nobody
Type: Bug | Status: new
Component: Template system | Version: 4.1
Severity: Normal | Resolution:
Keywords: Jinja2 TemplateView | Triage Stage: Accepted
ImportError csrf_input_lazy |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak):

Replying to [comment:5 rajdesai24]:


> hey Mariusz would love to draft a PR

Thanks, please prepare PR, see my
[https://code.djangoproject.com/ticket/34220#comment:1 comment]. There is
nothing more to do, IMO.

--
Ticket URL: <https://code.djangoproject.com/ticket/34220#comment:6>

Django

unread,
Jan 6, 2023, 5:45:59 AM1/6/23
to django-...@googlegroups.com
#34220: Cannot import csrf_input_lazy from partially initialized module.
-------------------------------------+-------------------------------------
Reporter: thommy | Owner:
| rajdesai24
Type: Bug | Status: assigned

Component: Template system | Version: 4.1
Severity: Normal | Resolution:
Keywords: Jinja2 TemplateView | Triage Stage: Accepted
ImportError csrf_input_lazy |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by rajdesai24):

* owner: nobody => rajdesai24
* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/34220#comment:7>

Django

unread,
Jan 6, 2023, 7:44:02 AM1/6/23
to django-...@googlegroups.com
#34220: Cannot import csrf_input_lazy from partially initialized module.
-------------------------------------+-------------------------------------
Reporter: thommy | Owner:
| rajdesai24
Type: Bug | Status: assigned
Component: Template system | Version: 4.1
Severity: Normal | Resolution:
Keywords: Jinja2 TemplateView | Triage Stage: Accepted
ImportError csrf_input_lazy |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by rajdesai24):

Please find the [https://github.com/django/django/pull/16433 PR]

--
Ticket URL: <https://code.djangoproject.com/ticket/34220#comment:8>

Django

unread,
Jan 6, 2023, 7:59:17 AM1/6/23
to django-...@googlegroups.com
#34220: Cannot import csrf_input_lazy from partially initialized module.
-------------------------------------+-------------------------------------
Reporter: thommy | Owner:
| rajdesai24
Type: Bug | Status: assigned
Component: Template system | Version: 4.1
Severity: Normal | Resolution:
Keywords: Jinja2 TemplateView | Triage Stage: Ready for
ImportError csrf_input_lazy | checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* has_patch: 0 => 1
* stage: Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/34220#comment:9>

Django

unread,
Jan 6, 2023, 8:08:05 AM1/6/23
to django-...@googlegroups.com
#34220: Cannot import csrf_input_lazy from partially initialized module.
-------------------------------------+-------------------------------------
Reporter: thommy | Owner:
| rajdesai24
Type: Bug | Status: assigned
Component: Template system | Version: 4.1
Severity: Normal | Resolution:
Keywords: Jinja2 TemplateView | Triage Stage: Ready for
ImportError csrf_input_lazy | checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by thommy):

Thank you :-)

--
Ticket URL: <https://code.djangoproject.com/ticket/34220#comment:10>

Django

unread,
Jan 6, 2023, 8:18:56 AM1/6/23
to django-...@googlegroups.com
#34220: Cannot import csrf_input_lazy from partially initialized module.
-------------------------------------+-------------------------------------
Reporter: thommy | Owner:
| rajdesai24
Type: Bug | Status: closed

Component: Template system | Version: 4.1
Severity: Normal | Resolution: fixed

Keywords: Jinja2 TemplateView | Triage Stage: Ready for
ImportError csrf_input_lazy | checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by GitHub <noreply@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"d5f892d873c6f98178121214f3c00d284ae1296d" d5f892d8]:
{{{
#!CommitTicketReference repository=""
revision="d5f892d873c6f98178121214f3c00d284ae1296d"
Fixed #34220 -- Moved csrf_input_lazy, csrf_token_lazy imports to the
toplevel.

This prevents random errors with partially initialized modules.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/34220#comment:11>

Reply all
Reply to author
Forward
0 new messages