Closed afdy closed 1 year ago
Hi @afdy thanks for reporting this. I have only been able to reproduce this with SITE_ID
setting unset. As moving the request attribute set at the start of the __init__
method, I opened #156 which should fix your issue. Could you test if it works for you? thanks
Description
Using Django-sites, and classed based views and attempting to render a meta object using get_context_data(), I hit a roadblock which fails to render any meta headers and results in an error.
Steps to reproduce
Versions
django 4.1.6 python 3.11.3
Expected behaviour
I would expect the page to render fine.
Actual behaviour
The page results in an error:
Additional information
If I remove the image line, it works fine.
I believe I've managed to locate the problem. The request object is not loaded until the final step of the init function, but it is used before it when rendering the image url.
If I override the meta class and move the line:
to the top, this works.
As a workaround I've extended the init function and moved the request object to the top, which works fine.