codingjoe / django-pictures

Responsive cross-browser image library using modern codes like AVIF & WebP
BSD 2-Clause "Simplified" License
248 stars 20 forks source link

NoReverseMatch : 'pictures' is not a registered namespace #50

Closed eduardo-victor closed 2 years ago

eduardo-victor commented 2 years ago

In the last 1.0rc2 update I came across the error "NoReverseMatch : 'pictures' is not a registered namespace", after comparing the last version with the previous one I noticed that a default configuration for the USE_PLACEHOLDERS was missing, so I was able to fix this by adding to the PICTURES in the file settings.py

PICTURES = { "BREAKPOINTS": { "xs": 576, "s": 768, "m": 992, "l": 1200, "xl": 1400, }, "GRID_COLUMNS": 12, "CONTAINER_WIDTH": 1200, "FILE_TYPES": ["WEBP"], "PIXEL_DENSITIES": [1, 2], "USE_PLACEHOLDERS": False, <- fixed the problem adding this line }

codingjoe commented 2 years ago

Hi @eduardo-victor,

Thank you for reaching out. I believe this is because you didn't set up the placeholder's URLs.

I think we need to improve both the documentation and error handling. Likewise, I believe a more verbose error message would be prudent.

I am curious, why didn't you set up the URL bit, and why aren't you using the placeholders in development?

Cheers! Johannes

eduardo-victor commented 2 years ago

I'm using the library for student purposes, maybe I didn't understand how to set the URL bit. I came across this "error" while trying to list images registered in an API with the DRF, in this way I managed to correct it, but I will study a little more about the library. However thanks for your attention :) Cheers.

codingjoe commented 2 years ago

Hi @eduardo-victor, there are no wrong questions. I'll reopen the issue and try to improve the docs. Software adoption is crucial to the success of this project ;)

codingjoe commented 2 years ago

@eduardo-victor thanks again for bringing this to my attention. Version 1.0rc3 comes with a dedicated check for this as well as with an updated documentation.