-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support of redirects #11
Conversation
Conflicts: djangoseo/version.py
current_site = get_current_site(request) | ||
subdomain = getattr(request, 'subdomain', '') | ||
|
||
redirect_patterns = RedirectPattern.objects.filter(site=current_site, subdomain=subdomain) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Тут можно сразу по url_pattern__regex поискать
|
||
for redirect_pattern in redirect_patterns: | ||
if re.match(redirect_pattern.url_pattern, full_path): | ||
Redirect.objects.get_or_create( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
А в этом случае пользователь получит редикект? Или 404? Ведь RedirectFallbackMiddleware идет ДО данного middleware
|
||
for redirect_pattern in redirect_patterns: | ||
if re.match(redirect_pattern.url_pattern, full_path): | ||
Redirect.objects.get_or_create( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Не особо понимаю смысла возможности создавать несколько Redirect (у тебя тут цикл ведь)
Added support of redirects from 404 through special middleware.