Re: redirect authenticated user in create view in django

2019-09-26 Thread Deep Sukhwani
wrote: > hi > i used CreateView for registration in my project and i wanna prevent > authenticated user from accessing to the register url and redirect it to > another page > can anyone tell me how can i do it? > > -- > You received this message because you are subscribed

Re: redirect authenticated user in CreateView

2019-09-25 Thread Randy Hughes
rote: > hi > i used CreateView for registration in my project and i wanna prevent > authenticated user from accessing to the register url and redirect it to > another page > can anyone tell me how can i do it? > > -- > You received this message because you are subscribed to th

redirect authenticated user in create view in django

2019-09-25 Thread saeed albooyeh
hi i used CreateView for registration in my project and i wanna prevent authenticated user from accessing to the register url and redirect it to another page can anyone tell me how can i do it? -- You received this message because you are subscribed to the Google Groups "Django users&q

redirect authenticated user in CreateView

2019-09-25 Thread saeed albooyeh
hi i used CreateView for registration in my project and i wanna prevent authenticated user from accessing to the register url and redirect it to another page can anyone tell me how can i do it? -- You received this message because you are subscribed to the Google Groups "Django users&q

Re: Completed form for an authenticated user

2016-04-27 Thread Said Akhmedbayev
est, > Gergely > > > > Gergely Polonkai > [image: https://]about.me/gergely.polonkai > > <https://about.me/gergely.polonkai?promo=email_sig&utm_source=email_sig&utm_medium=email_sig&utm_campaign=external_links> > > 2016-04-27 19:13 GMT+02:00 Said Ak

Re: Completed form for an authenticated user

2016-04-27 Thread Gergely Polonkai
sig&utm_source=email_sig&utm_medium=email_sig&utm_campaign=external_links> 2016-04-27 19:13 GMT+02:00 Said Akhmedbayev : > Let's say, for example, I have a reusable form. An authenticated user > fills out this form and saves it. How then, I can show to the user a page > w

Completed form for an authenticated user

2016-04-27 Thread Said Akhmedbayev
Let's say, for example, I have a reusable form. An authenticated user fills out this form and saves it. How then, I can show to the user a page with the complete form? Sorry, for not being able to explain the question clearly, I am new to django and to the web development in general. --

Re: How to add a post-login information to an authenticated user?

2013-10-18 Thread Khanh Tran
Even though i have not directly answered my question, i found out that session storage is an alternative solution. On Friday, October 18, 2013 12:17:50 PM UTC-7, Khanh Tran wrote: > > I am using out of the box django 1.5 authentication solution. After > authenticated, i want to add a 'post_login

How to add a post-login information to an authenticated user?

2013-10-18 Thread Khanh Tran
I am using out of the box django 1.5 authentication solution. After authenticated, i want to add a 'post_login_info' to the user using user_logged_in signal from django.contrib.auth.signals from django.contrib.auth.signals import user_logged_in from django.dispatch import receiver @receiver(use

Authenticated user loss an attribute that is added under user_logged_in signal.

2013-10-18 Thread Khanh Tran
I am using out of the box django 1.5 authentication solution. I also user_logged_in signal from django.contrib.auth.signals to add a piece of information to the logged in user to hope i can retrieve it later as follow: from django.contrib.auth.signals import user_logged_in from django.dispatch i

Re: How to know the current apache authenticated user

2008-06-01 Thread Ramiro Morales
On Mon, Jun 2, 2008 at 12:27 AM, Maykel Moya <[EMAIL PROTECTED]> wrote: > > I'm running a Django site via apache2 + mod_python. I'm not using any > Django related authentication mechanism, just apache digest > authentication against a flat file. > > [...] > > I'm thinking on a environment variable

How to know the current apache authenticated user

2008-06-01 Thread Maykel Moya
I'm running a Django site via apache2 + mod_python. I'm not using any Django related authentication mechanism, just apache digest authentication against a flat file. I need to know what user is currently authenticated by apache. Some people on #django have had point me to PythonAuthHandler but I

Re: Authenticated user from models.py

2008-05-23 Thread Eric Abrahamsen
Of course... That was a dumb question. On May 24, 2008, at 5:16 AM, [EMAIL PROTECTED] wrote: > > We have groups and permissions because the User model is meant for all > users, not just trusted users. > > On May 23, 3:49 pm, "Patrick J. Anderson" <[EMAIL PROTECTED]> > wrote: >> On Thu, 22 May 20

Re: Authenticated user from models.py

2008-05-23 Thread [EMAIL PROTECTED]
We have groups and permissions because the User model is meant for all users, not just trusted users. On May 23, 3:49 pm, "Patrick J. Anderson" <[EMAIL PROTECTED]> wrote: > On Thu, 22 May 2008 09:32:40 -0700, jonknee wrote: > > On May 21, 9:33 pm, "James Bennett" <[EMAIL PROTECTED]> wrote: > > >>

Re: Authenticated user from models.py

2008-05-23 Thread Patrick J. Anderson
On Thu, 22 May 2008 09:32:40 -0700, jonknee wrote: > On May 21, 9:33 pm, "James Bennett" <[EMAIL PROTECTED]> wrote: > >> Well, newforms-admin is being written to make the HttpRequest object >> available as an argument to the various ModelAdmin methods, which means >> that when you set up your ow

Re: Authenticated user from models.py

2008-05-22 Thread Eric Abrahamsen
On May 23, 2008, at 11:20 AM, [EMAIL PROTECTED] wrote: > > I find the "They're trusted, so let them enter it themselves" argument > frustrating. Not to mention: if they're trusted, then why do we have groups and permissions? > > > As someone above said, we're dealing with sites that potentia

Re: Authenticated user from models.py

2008-05-22 Thread [EMAIL PROTECTED]
I find the "They're trusted, so let them enter it themselves" argument frustrating. As someone above said, we're dealing with sites that potentially have a very large number of users. In cases where there's more than a few users, it becomes a hassle, a source of errors, and a time waster. Automat

Re: Authenticated user from models.py

2008-05-22 Thread jonknee
On May 21, 9:33 pm, "James Bennett" <[EMAIL PROTECTED]> wrote: > Well, newforms-admin is being written to make the HttpRequest object > available as an argument to the various ModelAdmin methods, which > means that when you set up your own custom admin you can do pretty > much anything you want.

Re: Authenticated user from models.py

2008-05-21 Thread Juanjo Conti
Thanks! http://code.djangoproject.com/wiki/CookBookThreadlocalsAndUser is what I was looking for. Juanjo -- mi blog: http://www.juanjoconti.com.ar --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" gr

Re: Authenticated user from models.py

2008-05-21 Thread Patrick J. Anderson
On Wed, 21 May 2008 20:33:35 -0500, James Bennett wrote: > On Wed, May 21, 2008 at 8:23 PM, Patrick J. Anderson > <[EMAIL PROTECTED]> wrote: >> Passing a Request object should work in application views, but what if >> one wants to capture that information on every save() call, including >> in the

Re: Authenticated user from models.py

2008-05-21 Thread James Bennett
On Wed, May 21, 2008 at 8:23 PM, Patrick J. Anderson <[EMAIL PROTECTED]> wrote: > Passing a Request object should work in application views, but what if > one wants to capture that information on every save() call, including in > the admin? > > What would be an elegant and beautiful approach to so

Re: Authenticated user from models.py

2008-05-21 Thread Patrick J. Anderson
On Wed, 21 May 2008 19:46:20 -0500, James Bennett wrote: > On Wed, May 21, 2008 at 7:35 PM, Juanjo Conti <[EMAIL PROTECTED]> wrote: >> Ugly. Is this the only way? > > Sigh. > > No, "ugly" is magical global variables and things that appear out of > thin air. > > Code that's clean and understand

Re: Authenticated user from models.py

2008-05-21 Thread James Bennett
On Wed, May 21, 2008 at 7:35 PM, Juanjo Conti <[EMAIL PROTECTED]> wrote: > Ugly. Is this the only way? Sigh. No, "ugly" is magical global variables and things that appear out of thin air. Code that's clean and understandable, where you can clearly see where everything comes from and what it's d

Re: Authenticated user from models.py

2008-05-21 Thread Juanjo Conti
Ugly. Is this the only way? Thanks you very much. -- Juanjo Conti --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubsc

Re: Authenticated user from models.py

2008-05-21 Thread [EMAIL PROTECTED]
Make user a parameter on the new save method and pass it to the save method wherever you call save in your views. On May 21, 6:58 pm, "Juanjo Conti" <[EMAIL PROTECTED]> wrote: > I can access the request from my views, but how can I acces the > request from models.py? > > I am redefining a Model's

Re: Authenticated user from models.py

2008-05-21 Thread Juanjo Conti
I can access the request from my views, but how can I acces the request from models.py? I am redefining a Model's save method. -- Juanjo Conti --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. T

Re: Authenticated user from models.py

2008-05-21 Thread Jashugan
On May 21, 4:31 pm, "Juanjo Conti" <[EMAIL PROTECTED]> wrote: > How can I access this information from the code? It's in the request: http://www.djangoproject.com/documentation/authentication/#authentication-in-web-requests --~--~-~--~~~---~--~~ You received this

Authenticated user from models.py

2008-05-21 Thread Juanjo Conti
I'd like to know which user has trigger the execution of some code in models.py. For example, while redefining the save method of some Model. How can I access this information from the code? -- Juanjo Conti --~--~-~--~~~---~--~~ You received this message because

Re: Authenticated user

2007-06-06 Thread birkin
José, > ... I thought I can do that overriding the save method of my > model class but the problem is how can I know the currently logged user? ... I just had to do this, and found and successfully implemented this "threadlocals middleware" solution:

Re: Authenticated user

2007-06-06 Thread Kelvin Nicholson
> > class Item(models.Model): > created_by = models.ForeignKey(User, editable = False) > > I set editable = False because I don't want this field appears in the > admin interface but it need to be in the database table. So, what I > want is when a user create an Item, it automatically ins

Authenticated user

2007-06-06 Thread Lic. José M. Rodriguez Bacallao
Hi people, here I come again, this time with a little question: suppose I got this model: from django.contrib.auth.models import User class Item(models.Model): created_by = models.ForeignKey(User, editable = False) I set editable = False because I don't want this field appears in the admin

Re: can I mimic authenticated user from shell?

2007-03-06 Thread Sandro Dentella
On Tue, Mar 06, 2007 at 05:43:26PM -, evenrik wrote: > > > I added a method to threadlocals.py that allows me to set the user so > I can run code in the shell that depends on get_current_user() > returning a user: > > def set_current_user(user): > _thread_locals.user = user > > This sh

Re: can I mimic authenticated user from shell?

2007-03-06 Thread yary
Now's a good time to try the new testing framework's test client http://www.djangoproject.com/documentation/testing/#test-client login as whomever, send some URLs, check the results. I know it ain't quite what you're looking for, but it may help. --~--~-~--~~~---~--~

Re: can I mimic authenticated user from shell?

2007-03-06 Thread evenrik
; > Regards, > Aidas Bendoraitis [aka Archatas] > > On 3/6/07, sandro.dentella <[EMAIL PROTECTED]> wrote: > > > > > Hi all, > > > How can I authenticate in a shell? I'm playing with Managers to meke > > them behave different according t

Re: can I mimic authenticated user from shell?

2007-03-06 Thread Aidas Bendoraitis
as] On 3/6/07, sandro.dentella <[EMAIL PROTECTED]> wrote: > > Hi all, > > How can I authenticate in a shell? I'm playing with Managers to meke > them behave different according to the permission of the user, but I > don't know how to play with the shell as authenticated

can I mimic authenticated user from shell?

2007-03-06 Thread sandro.dentella
Hi all, How can I authenticate in a shell? I'm playing with Managers to meke them behave different according to the permission of the user, but I don't know how to play with the shell as authenticated user. Really what happens is that if I test a user that results authenticated

Re: how to get a reference to a authenticated user

2007-02-20 Thread Benedict Verheyen
Russell Keith-Magee schreef: Thanks for the answers (super quick !) Russell en Honza. I'll try it out at once, Thanks, Benedict --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to thi

Re: how to get a reference to a authenticated user

2007-02-20 Thread Honza Král
On 2/20/07, Honza Kr�l <[EMAIL PROTECTED]> wrote: > On 2/20/07, Benedict Verheyen <[EMAIL PROTECTED]> wrote: > > > > Hi, > > > > i have some tables that i want to link with an authorized user. > > Right now i use the login mechanism of django. > > > > 1. Is it possible to specify a foreign_key to t

Re: how to get a reference to a authenticated user

2007-02-20 Thread Russell Keith-Magee
On 2/20/07, Benedict Verheyen <[EMAIL PROTECTED]> wrote: > > Hi, > > i have some tables that i want to link with an authorized user. > Right now i use the login mechanism of django. > > 1. Is it possible to specify a foreign_key to the auth_user database? Yes. from django.db import models from d

Re: how to get a reference to a authenticated user

2007-02-20 Thread Honza Král
On 2/20/07, Benedict Verheyen <[EMAIL PROTECTED]> wrote: > > Hi, > > i have some tables that i want to link with an authorized user. > Right now i use the login mechanism of django. > > 1. Is it possible to specify a foreign_key to the auth_user database? > If not, what is the best way to have a "u

how to get a reference to a authenticated user

2007-02-20 Thread Benedict Verheyen
Hi, i have some tables that i want to link with an authorized user. Right now i use the login mechanism of django. 1. Is it possible to specify a foreign_key to the auth_user database? If not, what is the best way to have a "user" field in a table that refers to a logged in user? 2. How can i g

Re: automatically fill in some fields of a form, storing authenticated user

2006-09-26 Thread Benedict Verheyen
Thanks Andres, quite interesting. The way i solved it was based on parts of the wiki and loads of trial and error. I made a class that simplifies using custom Manipulators and then derived a specific class for adding a Patient (model i'm using) where i initialise the derived class by calling th

Re: automatically fill in some fields of a form, storing authenticated user

2006-09-25 Thread Holger Schurig
> I think ajax tech will very suit for these things. Because you Recently there where browser exploits that utilized JavaScript. So it *CAN* happen that some people will turn JavaScript off. In this case your Ajax method doesn't work anymore. --~--~-~--~~~---~--~---

Re: automatically fill in some fields of a form, storing authenticated user

2006-09-25 Thread Andres Luga
Hi, the following are the suggestions of a Python and Django newbie, so take with a load of salt. Also the examples are not direct copy-paste and therefore might not work directly. On 9/22/06, Benedict Verheyen <[EMAIL PROTECTED]> wrote: > then data is looked up in another database and some of th

Re: automatically fill in some fields of a form, storing authenticated user

2006-09-22 Thread limodou
On 9/22/06, Benedict Verheyen <[EMAIL PROTECTED]> wrote: > I'm not sure how to do those tasks: > > 1. For a model, i want to allow the user to import settings from another > database. For instance, they fill in a number and hit a link or button, > then data is looked up in another database and som

automatically fill in some fields of a form, storing authenticated user

2006-09-22 Thread Benedict Verheyen
I'm not sure how to do those tasks:1. For a model, i want to allow the user to import settings from anotherdatabase. For instance, they fill in a number and hit a link or button,then data is looked up in another database and some of these values are then filled in the form so that when the user cre