Re: Setting LOGIN_URL dynamically, for different users, based on app?

2011-07-25 Thread dpapathanasiou
On Jul 25, 12:23 pm, Alexey Luchko wrote: > On 23.07.2011 18:13,dpapathanasiouwrote: > I've got a question on the solution.  Does it allow access to the other app > by direct url after successful login and redirect? No, because the decorator function checks the Group of request.user and rejects

Re: Setting LOGIN_URL dynamically, for different users, based on app?

2011-07-25 Thread Alexey Luchko
On 23.07.2011 18:13, dpapathanasiou wrote: That's interesting, I hadn't thought about using a hidden input for next in the two login templates. In the end, though, I went with just one login template. And rather than use UserProfiles (since there were no additional attributes I needed to attach

Re: Setting LOGIN_URL dynamically, for different users, based on app?

2011-07-23 Thread dpapathanasiou
That's interesting, I hadn't thought about using a hidden input for next in the two login templates. In the end, though, I went with just one login template. And rather than use UserProfiles (since there were no additional attributes I needed to attach to the default User model, and my two user t

Re: Setting LOGIN_URL dynamically, for different users, based on app?

2011-07-22 Thread Alexey Luchko
On 22.07.2011 17:32, dpapathanasiou wrote: So you're saying: have the function which handles the post-login request (i.e., defined in with LOGIN_REDIRECT_URL in settings.py and in urls.py to some corresponding views.py function) make that type check of user A/B, and simply redirect accordingly?

Re: Setting LOGIN_URL dynamically, for different users, based on app?

2011-07-22 Thread dpapathanasiou
Ah, ok, that makes sense -- I'm not sure if that's what Andre meant in the first place. So you're saying: have the function which handles the post-login request (i.e., defined in with LOGIN_REDIRECT_URL in settings.py and in urls.py to some corresponding views.py function) make that type check of

Re: Setting LOGIN_URL dynamically, for different users, based on app?

2011-07-22 Thread Andre Terra
On Fri, Jul 22, 2011 at 11:08 AM, dpapathanasiou < denis.papathanas...@gmail.com> wrote: > Without getting into what's "right" or "wrong", I can explain that the > two types of users are inherently different, i.e., not inheritable > from a common base class, so user profiles and permissions will n

Re: Setting LOGIN_URL dynamically, for different users, based on app?

2011-07-22 Thread Phang Mulianto
with user profile, i translate it this way : after user login,app check the profile of user then decide based on the profile which page sould user be redirected after login,say a to dashboard landing page, b user redirect to console page... why would create 2 login page for 1 project anyway.. On J

Re: Setting LOGIN_URL dynamically, for different users, based on app?

2011-07-22 Thread dpapathanasiou
Without getting into what's "right" or "wrong", I can explain that the two types of users are inherently different, i.e., not inheritable from a common base class, so user profiles and permissions will not work, because functions in /dashboard views.py should never be accessed (or in a position to

Re: Setting LOGIN_URL dynamically, for different users, based on app?

2011-07-22 Thread Andre Terra
No, there is no way to do that. I'm sorry, but your approach is convoluted and inherently wrong. Instead of asking "how can I make this solution work?" you should be asking "what's the best way to solve my needs?" and the answer to the latter will be very different from what you currently have in

Re: Setting LOGIN_URL dynamically, for different users, based on app?

2011-07-22 Thread dpapathanasiou
Thanks for your reply, but now that I've read up on custom profile and permissions, it doesn't seem like a solution. Here's another way of explaining it: in my urls.py file, I have two entries inside the urlpatterns definition, like this: (r'^dashboard/', include('mysite.console.urls')), (r'^cons

Re: Setting LOGIN_URL dynamically, for different users, based on app?

2011-07-21 Thread Shawn Milochik
On 07/21/2011 10:15 PM, dpapathanasiou wrote: How can I do that in the context of the built-in django auth API? Are there examples or tutorials of that? https://docs.djangoproject.com/en/1.3/topics/auth/#storing-additional-information-about-users -- You received this message because you are su

Re: Setting LOGIN_URL dynamically, for different users, based on app?

2011-07-21 Thread dpapathanasiou
How can I do that in the context of the built-in django auth API? Are there examples or tutorials of that? On Jul 21, 9:23 pm, Andre Terra wrote: > Why not make custom user profiles and write permission checks on your views? > > Cheers, > AT > > On Thu, Jul 21, 2011 at 10:15 PM, dpapathanasiou <

Re: Setting LOGIN_URL dynamically, for different users, based on app?

2011-07-21 Thread Andre Terra
Why not make custom user profiles and write permission checks on your views? Cheers, AT On Thu, Jul 21, 2011 at 10:15 PM, dpapathanasiou < denis.papathanas...@gmail.com> wrote: > I'd like to be able to support two different types of authenticated > users within a single django project site. > >

Setting LOGIN_URL dynamically, for different users, based on app?

2011-07-21 Thread dpapathanasiou
I'd like to be able to support two different types of authenticated users within a single django project site. The idea is that Type A users will work in the /dashboard app, and Type B users will work in the /console app. Since each app has its own set of models and views, I can do this at the db