Help solve the puzzle. When switching between templates, user authorization data flies. For authorization django.contrib.auth.backends.RemoteUserBackend is used. Here is a sketch of the code. The user is indexed and authorized. Then the already authorized user goes to photo and that's it, he is not authenticated.
def index(request): username = request.environ.get('HTTP_REMOTE_USER') auth = RemoteUserBackend() user = auth.authenticate(request, username) if user is not None: login(request, user, backend='django.contrib.auth') else: pass var = user return render(request, 'core/index.html', {'var': var} @login_required() def photo(request): var = dict() var['some_var'] = 'some data' return render(request, 'core/gallery.html', {'vars': var}) How in this case "transfer authorization" to another template?