themotleyfool / wagtail-automatic-redirects Goto Github PK
View Code? Open in Web Editor NEWPackage to help with Wagtail URL redirects
License: BSD 3-Clause "New" or "Revised" License
Package to help with Wagtail URL redirects
License: BSD 3-Clause "New" or "Revised" License
It was pointed out to me by Wagtail core developer @kaedroho that we should consider making use of Django's bulk_create
to avoid scaling issues with the automatic redirects.
We are currently using create_or_update
(here and here).
I was wondering if the update part of that method is ever needed. If we already have a redirect pointing from an old path to the page object then this should still point to the right page object, even it if its slug is changed again (or the page is moved). Please correct me if I am wrong. Might be worth adding a test to make sure this works.
In that case the redirect don't need updating, we could drop the update part and create only new redirects in an efficient manner.
Hey all,
Checking through the source, this package isn't able to be used with Wagtail^=3.0 currently. Are there any plans to update this?
Thanks - Will.
There is a PR in the Dubs repo to accomplish automatic redirects. We would like this code to be available to our other repos using Wagtail, and maybe even open source?
The PagesAppConfig
may need to be an Abstract class and then inherited by the individual Wagtail Apps that want to use it.
The import location of SiteMiddleware
was changed in the 2.11 release of Wagtail to wagtail.contrib.legacy
. The import would need to be changed in this package or the use of SiteMiddleware
would need to be removed to allow use/development of the package with later versions of Wagtail.
See also Wagtail 2.11 release notes
Wagtail now has page move hooks that could be nice for adding redirects when moving a page that is already published.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.