I've never thought about using a Placeholder field for this purpose. Thanks
for the suggestion... I might have a crack at a reusable app this coming
week.

On Fri, Nov 22, 2019, 7:06 PM Jacob Rief <jacob.r...@gmail.com> wrote:

> *Two things:*
>>
>> 1) Not sure why the Django cache framework and DjangoCMS caches the page
>> when setting the 404 directly (as shown in the comments above). I cannot
>> find in the response.render where the status_code gets clobbered back to
>> 200.  However clearly if I grab the content (not the headers or statuscode)
>> and return that in a new HttpResponse with the correct status code -- it
>> works. I've tried no_cache decorators, etc.
>> 2) Should there be something better baked into DjangoCMS to catch /
>> handle Django handler events for 404 / 500 / others? I feel the answer is
>> yes however I'm open to suggestions on a different approach than the one
>> I'm using.
>>
>
> Error pages typically are not served by the CMS, therefore django-CMS
> doesn't offer any special page inside its menu tree.
> What you can do however, is to create a custom model using a
> PlaceholderField
> <http://docs.django-cms.org/en/latest/how_to/placeholders.html>. Then
> create a view serving your error pages.
> Inside the template used by that error-response view, refer to that model
> object using the given placeholder.
> These are the advantages of that approach:
>
>    1. You don't need to abuse any page from the tree in django-CMS. Error
>    messages are separated from normal content.
>    2. This allows your client to use the structure mode for editing the
>    placeholder's content.
>    3. By adding fields language and status_code to that model, you can
>    customize what is rendered on any occasion in any language.
>
> This btw. is an interesting use case and writing a reusable app for that
> purpose would make a lot of sense.
>
> --
> Message URL:
> https://groups.google.com/d/msg/django-cms-developers/topic-id/message-id
> Unsubscribe: send a message to
> django-cms-developers+unsubscr...@googlegroups.com
> ---
> You received this message because you are subscribed to the Google Groups
> "django CMS developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-cms-developers+unsubscr...@googlegroups.com.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/django-cms-developers/b746774e-8990-420b-9769-e9d7e413c733%40googlegroups.com
> <https://groups.google.com/d/msgid/django-cms-developers/b746774e-8990-420b-9769-e9d7e413c733%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
Message URL: 
https://groups.google.com/d/msg/django-cms-developers/topic-id/message-id
Unsubscribe: send a message to 
django-cms-developers+unsubscr...@googlegroups.com
--- 
You received this message because you are subscribed to the Google Groups 
"django CMS developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-cms-developers+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/django-cms-developers/CA%2BdVMxjhwdd5kX5dBMvdjHRK5rEorvNnUmoQYMRoQUioUPwoSg%40mail.gmail.com.

Reply via email to