Skip to content

Conversation

bmispelon
Copy link
Member

@bmispelon bmispelon commented Aug 1, 2025

This PR adds django-flatpages-extra, which is a package I created after a discussion with @StephanieAG from the fundraising WG on how to make it easier to update flat pages.

As you can tell from the very short PR, the package is a drop-in replacement and is reversible. It adds the following features to the admin:

  • The ability to create a revision for a flat page
  • preview revisions (including a shareable link for people who don't have an admin account)
  • reverting revisions
  • better history of changes for flat pages

Initially I was going to develop this as an app in this project, but then realized it might be useful as a 3rd party too. If accepted I would release a 1.0 of the package.

Screenshots:

Editing content directly is disabled Screenshot 2025-08-02 at 12-02-50 _accessibility_ -- Django Accessibility Statement! Change flat page Django site admin
Preview page Screenshot 2025-08-02 at 12-07-34 Django Accessibility Statement! Django
Compare view (diff) Screenshot 2025-08-02 at 12-08-18 Comparing revision with original Django site admin

@bmispelon bmispelon force-pushed the flatpages-extra branch 3 times, most recently from 9973089 to aa27de7 Compare August 1, 2025 23:46
@bmispelon bmispelon marked this pull request as ready for review August 1, 2025 23:52
@bmispelon bmispelon marked this pull request as draft August 2, 2025 11:02
@bmispelon bmispelon marked this pull request as ready for review August 2, 2025 12:40
@ulgens
Copy link
Member

ulgens commented Aug 7, 2025

Adding the link for easier review: https://pypi.org/project/django-flatpages-extra/

@ulgens
Copy link
Member

ulgens commented Aug 7, 2025

+1 for having the "is published" feature and revisions, but not sure about offloading both of them to a new package.

@tim-schilling
Copy link
Member

tim-schilling commented Sep 18, 2025

@bmispelon I think we may want to have CI on that package as well, otherwise upgrades could be a bit tricky in the future [if things fall out of date with new versions of Django].

@bmispelon
Copy link
Member Author

@bmispelon I think we may want to have CI on that package as well, otherwise upgrades could be a bit tricky in the future [if things fall out of date with new versions of Django].

The code is hosted on Codeberg where CI is not so easy to set up. I've added a just ci command that runs the test suite (100% coverage) on all supported versions of Django: 5.0, 5.1, 5.2 and event 6.0 (alpha release). They all pass locally, so I've released the current code as version 1.0 on pypi.

I also took the liberty of rebasing this PR onto the latest main branch.

Would folks be ok if I deployed this on the preview server?

@bmispelon
Copy link
Member Author

+1 for having the "is published" feature and revisions, but not sure about offloading both of them to a new package.

* If we are going to keep history, I'd prefer a package like https://django-simple-history.readthedocs.io/en/stable/ that works with every model.

* For "is published" feature, I think a small custom model could solve it.

The "small custom model" is how django-flatpages-extra started. I originally created it inside the source code of this site, but realized it could be useful as a third party.

I've designed the django-flatpages-extra so it can be added and removed with no ill effect, so we can install it temporarily while an alternate solution is worked on (maybe one involving django-simple-history and/or a simpler custom model).

@ulgens
Copy link
Member

ulgens commented Oct 2, 2025

The "small custom model" is how django-flatpages-extra started. I originally created it inside the source code of this site, but realized it could be useful as a third party.

Thanks for the details.

I've designed the django-flatpages-extra so it can be added and removed with no ill effect, so we can install it temporarily while an alternate solution is worked on (maybe one involving django-simple-history and/or a simpler custom model).

That sounds okay to me.

@bmispelon bmispelon added the preview-server Use this label if the PR has been deployed to the preview server label Oct 2, 2025
@bmispelon
Copy link
Member Author

I've deployed this to the preview server. I'll reach out to Stephanie to see if she has time to test it to see if it this solution would work for her.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
preview-server Use this label if the PR has been deployed to the preview server
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants