bnzk / django-painless-redirects Goto Github PK
View Code? Open in Web Editor NEWdjango.contrib.redirects on steroids. maybe.
License: MIT License
django.contrib.redirects on steroids. maybe.
License: MIT License
to
no more editablemySQL and indexes, my friend
probably when many requests are made, the code is not threadsafe. enforcing db integrity with unique_together could be the solution.
use fieldsets for less used options, group things, better labels.
with a default of False, so the db is not filled up with tons of variations of GET variables.
throws exception
/products/whatever/it-is/ => /shop/whatever/it-is/
needs proof of concept that it really can work (urls reload, multi-server setups, threading, etc).
can crash inserting malware urls, with very long query strings....
Read about it, decide.
possibilities may be: a function, a string (.php), a regex (.*.cfm)
when changing slugs in django-cms, django-filer or django-folderless (planned for now).
can cause:
MultipleObjectsReturned at /
get() returned more than one RedirectHit -- it returned 2!
=> caused by concurrent hits from same referrer, so, not a multi site issue
at least PAINLESS_REDIRECTS_OLD_PATH_MAX_LENGTH!
directly calling process_response on the middleware is easy, but does not apply as it works in reality.
do redirect if we have a real hit, but do never auto create redirects when url does not start with a language slug (ie /de/ or /en/ or /en-us/ - must be in LANGUAGES, though). as the middleware will redirect to /lang/original-404-maybe/ anyway, and we will fetch it then!
Redirect, and keep GET vars. Must be set on redirect. Decide about this: Normal behaviour is, forget about GET vars when evaluating redirects?!?
/a/b/?x=y --> /c/d/?x=y
/a/b/?z=v --> /c/d/?z=v
with only one entry in the database.
301 as default, 302 selectable
...as in django-advanced-redirects
also, count different referrers.
please.
ManualRedirectMiddleware should be above for example LocaleMiddleware (that does the / > /en/ thing), so no false auto created Redirects are made.
want to redirect /foo AND /foo/ (obviously) to /bar/
whne LocaleMiddleware is enabled, together with i18n_patterns in urls.py, we'll have to enter two redirects, with and without slash - as /foo/ is not a valid url (as checked in CommonMiddleware, about here: https://github.com/django/django/blob/main/django/middleware/common.py#L71 ), and because of that, no redirect to /foo/ is made (but, instead, to /language/foo/).
One approach could be to check for Redirects with and without slash at the end, when there is no slash at the end of the current path. Or even try a "ignore the slash at the end" approach, making the final slah irrellevant. This would enhance usability for redirect editors, as currently, one is often forced to enter redirects with and withouth the trailing slahsh.
to prevent redirect caching of modern browsers. if possible, open in a new incognito window, circumventing django-cms overlay issues.
/my-redirect/?check=vnisorvus8zasdoa
(1406, "Data too long for column 'old_path' at row 1")
validate the model before save. zack.
maybe baby
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.