2

I've installed a wonderfull app called django-rosetta. The problem I've found is first that it's not integrated in the django-admin, and it looks like it's not going to be.

Second I need to give access to the translators to the rosetta app and they have access only if they are logged in. But if they are not, the url dispatcher goes to the default page when no match is done and they try to access to the url.

The login workflow right now is the following:

  1. they go to the django admin and log in.
  2. after that they have to paste the rosetta url in the browser and then they access

I would like that my translators could enter in the rosetta url and if they are not logged in, the 'admin log-in page' must ask them to do this and then redirect them to the rosetta url again.

Is there any way to do this? (Sorry if it's not very well explained)

Versions:

  • Django==1.5.1
  • django-rosetta==0.7.2
Paolo Moretti
  • 54,162
  • 23
  • 101
  • 92
Lucas
  • 597
  • 3
  • 15

1 Answers1

0

Did you try to add this in your settings.py ?

LOGIN_URL = "/login/"

So non-authenticated users will be redirected to login_url when trying to access a view with '@login_required' decorator.

example:

You try to access this url without be logged in:

http://www.yourproject.com/rosetta/

So django automatically will redirect you to:

http://www.yourproject.com/login/?next=/rosetta/

And as you can see in the url, Django adds automatically ?next=/rosetta/ to the url, and after a succesfull log in, you'll be redirected to the page you were trying to access

AlvaroAV
  • 10,335
  • 12
  • 60
  • 91