Answer the question
In order to leave comments, you need to log in
How to use sessions across two sites in django?
There are 2 sites.
The site structure is as follows:
env ( Окружение )
one ( основная папка проекта )
-manage.py ( файл управления первого сайта )
-manage_another.py ( файл управления второго сайта )
-one
--settings_all.py ( Файл настроек с общими настройками для обоих сайтов )
--settings.py ( Файл настроек первого сайта )
--settings_another.py ( Файл настроек второго сайта )
--wsgi.py ( wsgi первого сайта )
--wsgi_another ( wsgi второго сайта )
Answer the question
In order to leave comments, you need to log in
Two sites on different domains cannot see each other's cookies (the browser simply will not send other people's cookies), and accordingly, the session cannot be divided either.
If there are resources to do everything well, then you can get confused with OAuth2. This protocol, roughly speaking, allows you to log in to one of the sites using another. For example, this is how social network authorization works throughout the Internet. There is a nice django-allauth library that supports authorization for a lot of providers.
If the use of any social network does not suit you (that is, you yourself want to act as a provider), then in your case I see 2 options:
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question