The problem of redirect in Apache Superset - apache-superset

When changing the language in the superset, a redirect to the main page occurs.
How to fix this problem so that the redirect does not occur?

How do you changing the language? Do you modify the following contents in config.py?
Setup default language
BABEL_DEFAULT_LOCALE = "zh"

Related

LOGIN_REDIRECT_URL not redirecting

I'm using Django, Mysql and Docker, with a custom user model for Django. After entering correct login details the LOGIN_REDIRECT_URL='searcher-home' variable in settings.py isn't redirecting to the home page as expected, instead it attempts to redirect to the default path of /accounts/profile/. Does anyone know what could be causing this? I've looked elsewhere for answers, but all issues I've found are either looking for LOGIN_URL which isn't what I need, or are using custom LoginViews, which I'm not. Any insight would be appreciated.
Edit:
For anyone else running into this error, I eventually tried to use a LoginView outlined in this question, which didn't require the LOGIN_REDIRECT_URL. Just ensure to have an AUTH_USER_MODEL defined in your settings.
retry it like this:
LOGIN_REDIRECT_URL='/searcher-home/'

Programmatically create Redirects in Wagtail

Is there a way to programmatically create functioning Redirect objects in Wagtail?
I am trying the obvious (naively creating the object):
Redirect.objects.create(old_path='/test', redirect_link='https://stackoverflow.com')
This creates a Redirect that is visible in the Wagtail admin panel, however navigating to /test simply 404s without redirecting.
However, if I then save the Redirect from the admin panel, it suddenly works.
Is there some special post-save logic I need to run in order to activate the redirect? I looked through the source and could not find anything.
User error - I believe I was running into DNS caching issues that prevented the redirect from working. My original code seems to work fine now.

Sitecore language embedding and default language

The business has a requirement to always show the language in the URL for our CD sites. I did some research and set the LanguageEmbedding setting to always. This seems to work fine for non-default languages but not for English, which is the default language.
When I try to go to www.abc.com, shouldnt it change to www.abc.com/en ? Am I right to think this or is this how Sitecore will behave for default language where it won't show the language if its not an embedded links?
Thanks
When Sitecore determines your language via browser preference, cookie, URL slug, or query string, it will not redirect to that preferred URL structure with language slug.
You can either create a redirect module (i.e. if language context set, make correct URL and redirect) or write out <link langref=""> tags, which is an SEO best practice anyways.
OOTB that is the way that Sitecore works. When you have LanguageEmbedding="always" - the links should all be generated with the language embedded - including for en, so a link to the home page would be www.abc.com/en - but if you just visit the domain - www.abc.com - Sitecore then uses either the language cookie stored from your last visit, or the default language.
If you want the behavior to be that if you visit www.abc.com the user is always it would be better to set that up using an IIS Redirect or a rewrite .

Redirect module in Sitecore

I have installed Redirect module in sitecore. Inside modules I have created "Redirect Url". In Redirect Url I wrote Requested Url "http://domainname/pagename" and selected Redirect To from content. But it is not working. Can anyone tell me what is wrong I am doing?
I have created redirect pattern.
It all depends on which module implementation you are using. I have heard multiple complaints on functional of original one (seems it is discontinued at all), so people are doing their own forks. The best implementation for the day is by Chris Adams and Max Slabyak, the module with sources, packages as well as good documentation is available at GitHub and it is being maintained with time.
With that Redirect Module installed, I do the following:
Under /sitecore/system/Modules/Redirect Module folder in Sitecore create a new redirect pattern called Pagename Test
Set requested expression to ^/pagename/?
Leave response status code equal 301
Set source item to the actual page item serving that redirect request
Do not forget to publish redirect pattern (and module itself if not yet)
Then as I hit http://myhostname/pagename/ I am being redirected to desired page with 301 status code.
Hope this helps and please let us know if that worked out for you.

Django, from php to Django

I have a website done with Django, that was previously done with PHP and CodeIgniter. I've moved the website to Webfaction, changed the DNS and all other configurations, but now my email is full of errors like this:
Error (EXTERNAL IP): /index.php/main/leer/7497
I don't know why the Django app is looking for pages from the PHP app, specially since the PHP app was in another host.
Are those URLs from your old site? That's probably a case of people having stale bookmarks, trying to navigate to them, and getting 404s. You might want to consider catching those, and redirecting to the new URL with response code 302.
I can't imagine those errors are caused by Django (except in the sense that the reports are from Django reporting 404s, which it does for free).
I agree with above. Just want to add you should use django.contrib.redirects to move the redirects.
You can read more about it here