Re: Problems in encryption when creating a new user with Admin

2006-07-10 Thread Kenneth Gonsalves
On 11-Jul-06, at 7:27 AM, Malcolm Tredinnick wrote: > I could give you the party line about why it is done like this, > but I'm not going to bother. I don't find it to be a particularly > defensible design, since it is an enormous hassle without being > part of > a uniformly strong security po

Re: Referring to media files

2006-07-10 Thread keukaman
Thanks for the help. Will this work if my site is primarly flat pages? --~--~-~--~~~---~--~~ 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 unsu

Re: Problems in encryption when creating a new user with Admin

2006-07-10 Thread Malcolm Tredinnick
On Mon, 2006-07-10 at 18:32 -0700, Vizcayno wrote: > When I create a new user in the Admin with all privileges, Django asks > for new user and password; When I type the password I can see what I > write, I think this field should be protected from seeing password. Since it doesn't accept a cleart

Re: Having trouble with views

2006-07-10 Thread Malcolm Tredinnick
On Mon, 2006-07-10 at 08:55 -0700, Tomas Jacobsen wrote: > Im trying to make a blog-like portfolio with finished projects I have > done. I want it to be easy to update when I have done something new, so > I thougth django seemed interesting for my webpage. I have been reading > some tutorials, and

Problems in encryption when creating a new user with Admin

2006-07-10 Thread Vizcayno
When I create a new user in the Admin with all privileges, Django asks for new user and password; When I type the password I can see what I write, I think this field should be protected from seeing password. After saving the new user I logout Admin, then I try to login with the new user, the appli

Re: Bug in login method?

2006-07-10 Thread [EMAIL PROTECTED]
I also ran into this issue recently. Say I have users signing up for user accounts to my site. When the user signs up their account is created but set to "not active". I also store a guid in the db assocaited with the users account. I then send the user an email with a link to activate the acc

Re: Django & Cookies

2006-07-10 Thread Tom Davis
Jeremy Dunck wrote: > On 7/10/06, Tom Davis <[EMAIL PROTECTED]> wrote: > > Say I have some php (or whatever) page that sets a cookie named > > "stuff", using django, could I just use request.session['stuff'] and > > get the value, or does Django use some kind of special cookie mechanism > > that

Re: book recommendations?

2006-07-10 Thread Paulo
When someone asks me how to dive in and learn XHTML/CSS I always recommend: < http://www.simplebits.com/publications/ > < http://www.cssmastery.com/ > < http://beginningwebdesign.com/ > < http://www.idest.com/csshacks/ > To get a hang of some of the newer DOM scripting techniques: < http://www.do

Re: book recommendations?

2006-07-10 Thread Jeremy Dunck
On 7/10/06, Iain Duncan <[EMAIL PROTECTED]> wrote: > Amazon and Indigo both say "customers also bought" > "Web Standards Solutions: The Markup and Style Handbook (Pioneering > Series)" by Dan Cederholm > > Any opinions on that? Sorry, no. I haven't read it nor have I followed Dan's work. > Or o

Re: book recommendations?

2006-07-10 Thread Iain Duncan
> Design-to-code process (HTML/CSS mostly): Designing With Web Standards > http://www.amazon.com/gp/product/0321385551 Amazon and Indigo both say "customers also bought" "Web Standards Solutions: The Markup and Style Handbook (Pioneering Series)" by Dan Cederholm Any opinions on that? Or on "Cas

Re: User never logs out

2006-07-10 Thread SmileyChris
This does bring up an interesting point that .is_anonymous would probably be better as something like .not_anonymous so we don't get false-positives in templates if user is not found. --~--~-~--~~~---~--~~ You received this message because you are subscribed to th

Re: Users Can't Log Into Admin

2006-07-10 Thread Jeremy Osterhouse
Another approach is to use signals. In models.py from django.dispatch import dispatcher from django.contrib.auth.models import User def user_save(instance): if not instance.password.startswith('sha1$'): instance.set_password(instance.password) return dispatcher.connect(user_save,

Re: Announce: Django Performance Monitoring

2006-07-10 Thread Ian Holsman
Hi Favo, It's free if you work on a OSS project. regards Ian On 11/07/2006, at 12:21 AM, favo wrote: > > Ask very carefully, Do you want to make it OS? > If you feel not happy with the question, just ignore it please. > > > > --~--~-~--~~~---~--~~ You received

Re: Weird index/urls.py behaviour

2006-07-10 Thread [EMAIL PROTECTED]
That worked perfectly! I can't thank you enough. --~--~-~--~~~---~--~~ 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 unsubscribe from this grou

Re: User never logs out

2006-07-10 Thread [EMAIL PROTECTED]
Turns out the problem was that I wasn't using RequestContext when processing the template therefore I always got the page as if the user was logged in. Now I know that I have to use RequestContext whenever I want to check the user's state in the templates. Thanks for forcing me to read the docs o

Re: No kwargs in many_to_many?

2006-07-10 Thread sdm
I'm looking this thread http://groups.google.com/group/django-users/browse_thread/thread/a01ca43d1b4d75ef/0507389caf2fd546?q=manytomany+kwargs&rnum=1#0507389caf2fd546 That have a problem like me, now I know that the function "get_myothermodel_list" is just a wrapper for the function "myothermodel

[0.91] No kwargs in many_to_many?

2006-07-10 Thread sdm
Hi, I'm using Django 0.91 (until 0.95 become stable) and I have a field ManyToMany, but when I try to do something like this: mymodels.get_object(pk=1).get_myothermodel_list(order_by=['some_field']) I got this error: *method_get_many_to_many() got an unexpected keyword argument 'order_by'* Same

Re: Bug in login method?

2006-07-10 Thread mamcxyz
Yes... I figure it later. Is necesary call authenticate() before login() to work. I Imagine that do login was enough. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, sen

Re: User never logs out

2006-07-10 Thread Derek Hoy
On 7/10/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Not quite... it does save the username/password for forms but I'm > unaware of such a feature in Firefox. AFAIK the only way autologin is > possible is by using a cookie which is something I haven't implemented > (yet). If you're workin

Re: User never logs out

2006-07-10 Thread [EMAIL PROTECTED]
Not quite... it does save the username/password for forms but I'm unaware of such a feature in Firefox. AFAIK the only way autologin is possible is by using a cookie which is something I haven't implemented (yet). --~--~-~--~~~---~--~~ You received this message be

Re: Bug in login method?

2006-07-10 Thread Joseph Kocherhans
On 7/10/06, mamcxyz <[EMAIL PROTECTED]> wrote: > > The login method in django\django\contrib\auth__init__.py > > say: > > def login(request, user): > """ > Persist a user id and a backend in the request. This way a user > doesn't > have to reauthenticate on every request. > """ >

Re: Bug in login method?

2006-07-10 Thread mamcxyz
I need to read more the code... The trouble is this: I'm building a singup form. After the form get processed, is not sufficient call the login() method but also the authenticate, this way: user = authenticate(username=user.username,password=request.POST['password']) login(reque

Re: Bug in login method?

2006-07-10 Thread Ivan Sagalaev
mamcxyz wrote: > However user.backend not exist in the user model definition. This is because request.user is not exactly a User instance. It's a wrapper that is available from authenticate(username=username, password=password). This one is what should be passed to login(). --~--~-~--~

Bug in login method?

2006-07-10 Thread mamcxyz
The login method in django\django\contrib\auth__init__.py say: def login(request, user): """ Persist a user id and a backend in the request. This way a user doesn't have to reauthenticate on every request. """ if user is None: user = request.user # TODO: It would

Re: In forms, where get the record created?

2006-07-10 Thread mamcxyz
Nevermind, I have the profile model using inhiterance. Forget this. --~--~-~--~~~---~--~~ 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 unsubs

Having trouble with views

2006-07-10 Thread Tomas Jacobsen
Im trying to make a blog-like portfolio with finished projects I have done. I want it to be easy to update when I have done something new, so I thougth django seemed interesting for my webpage. I have been reading some tutorials, and I finaly have manged to get in all the fields I want in the admi

In forms, where get the record created?

2006-07-10 Thread mamcxyz
I have this code: class Manipulator(forms.Manipulator): default = {} done = False def getData(self, request): return request.POST def getForm(self, data, errors): return forms.FormWrapper(self, data, errors) def process(self, request): data = self.get

Re: Is it worth caching results obtainable via SQL?

2006-07-10 Thread Jeremy Dunck
On 7/9/06, Paul <[EMAIL PROTECTED]> wrote: > 1) do something like > 'UserProfile.objects.filter(subscriptions=obj).count()' > 2) Keep a subscription count on each StorySection object. Adding one > when somebody subscribes and subtracting when they unsubscribe. > > 1 is obviously simpler, pushing w

Re: Announce: Django Performance Monitoring

2006-07-10 Thread favo
Ask very carefully, Do you want to make it OS? If you feel not happy with the question, just ignore it please. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email

Re: book recommendations?

2006-07-10 Thread Simon Willison
On 10 Jul 2006, at 06:42, arthur debert wrote: > also, simon willison's javascript introduction is excellent: > > http://flickr.com/photos/simon/sets/72057594077197868/ There's a better version of it up on the Mozilla Developer wiki now - other people have been fixing all the bugs :) http://

Re: book recommendations?

2006-07-10 Thread arthur debert
also, simon willison's javascript introduction is excellent: http://flickr.com/photos/simon/sets/72057594077197868/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send

Re: FileBrowser Test Version

2006-07-10 Thread patrickk
yes, working on that one ... Am 09.07.2006 um 15:39 schrieb favo: > > It's very cool, open svn address is better:-) > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to th

Re: Limiting file size before upload?

2006-07-10 Thread Ivan Sagalaev
Malcolm Tredinnick wrote: > I'm not 100% certain either. However, of the only hope you (Apache) have > to avoid being hit by a truck is to hope that the guy behind you > (Django) hold up a stop sign in time, then I would start looking for a > plan B. AFAIK mod_python's handler is called very earl

Re: Weird index/urls.py behaviour

2006-07-10 Thread Malcolm Tredinnick
On Mon, 2006-07-10 at 11:05 +, [EMAIL PROTECTED] wrote: > Hi Adrian, thanks for replying. The project's urls.py does include the > urls.py I've shown, but here they are: > > cat urls.py > from django.conf.urls.defaults import * > > urlpatterns = patterns('', > # Uncomment this for admin:

Re: [Newbie] Django & Cookies

2006-07-10 Thread Jeremy Dunck
On 7/10/06, Tom Davis <[EMAIL PROTECTED]> wrote: > Say I have some php (or whatever) page that sets a cookie named > "stuff", using django, could I just use request.session['stuff'] and > get the value, or does Django use some kind of special cookie mechanism > that can't talk to the "global" cook

Re: Limiting file size before upload?

2006-07-10 Thread Malcolm Tredinnick
On Mon, 2006-07-10 at 11:15 +, [EMAIL PROTECTED] wrote: > Malcolm, > > Malcolm Tredinnick wrote: > > Without answering your question directly, let me just point out that > > even if such a limit existed in Django, it still wouldn't help your > > Apache process, since it is already accepting t

Re: Limiting file size before upload?

2006-07-10 Thread [EMAIL PROTECTED]
Malcolm, Malcolm Tredinnick wrote: > Without answering your question directly, let me just point out that > even if such a limit existed in Django, it still wouldn't help your > Apache process, since it is already accepting the data. Hummm... That's probably right. I wasn't too sure at which poi

Re: User never logs out

2006-07-10 Thread Kenneth Gonsalves
On 10-Jul-06, at 4:30 PM, [EMAIL PROTECTED] wrote: > Sorry, I forgot to mention that yes, when I hit the back button I also > hit refresh. Actually, I even tried clearing the browser cache, > cookies, etc and I'm still logged in. maybe your browser is set to automatically login? -- regards

Re: Weird index/urls.py behaviour

2006-07-10 Thread [EMAIL PROTECTED]
Hi Adrian, thanks for replying. The project's urls.py does include the urls.py I've shown, but here they are: cat urls.py from django.conf.urls.defaults import * urlpatterns = patterns('', # Uncomment this for admin: (r'^admin/', include('django.contrib.admin.urls')), (r'^user/login/

Re: User never logs out

2006-07-10 Thread [EMAIL PROTECTED]
Sorry, I forgot to mention that yes, when I hit the back button I also hit refresh. Actually, I even tried clearing the browser cache, cookies, etc and I'm still logged in. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Gr

Re: Limiting file size before upload?

2006-07-10 Thread Malcolm Tredinnick
On Mon, 2006-07-10 at 10:42 +, [EMAIL PROTECTED] wrote: > Hi. > > Is there a way to limit upload file size *before* the upload is > accepted? > > Say I want to give people the option of uploading movie files, but I > want to limit them to 4MB per movie. If I understand the upload > behaviour

Limiting file size before upload?

2006-07-10 Thread [EMAIL PROTECTED]
Hi. Is there a way to limit upload file size *before* the upload is accepted? Say I want to give people the option of uploading movie files, but I want to limit them to 4MB per movie. If I understand the upload behaviour of Django correctly, the file is first accepted into main memory (*) , afte

Re: Validations

2006-07-10 Thread Kilian CAVALOTTI
On Monday 10 July 2006 09:03, Maximillian Dornseif wrote: > Probably I'm missing something here: > > I want 'validation' functionality in admin. E.g. I have the fields > size, weight and checked_logistics. checked logistics should be only > allowed to be set True if size and weight are not NULL. >

Re: [Newbie] Django & Cookies

2006-07-10 Thread Ian Holsman
request.COOKIE.get('foo',None) should do the trick On 10/07/2006, at 6:05 PM, Tom Davis wrote: > > Okay, this is a pretty simple question with probably a "duh" answer, > but I read the docs page on sessions and it doesn't specify, so here > goes: > > Say I have some php (or whatever) page that

Linking to Admin & Bookmarklets

2006-07-10 Thread [EMAIL PROTECTED]
Hello, is there an easy way to link to the corresponding admin page from a public view? The admin urls are straightforward and could be constructed easily, but it would be nice to have a smarter way to do this . The bookmarklets seem to do something similar, but I can't get them to work. Any sugge

[Newbie] Django & Cookies

2006-07-10 Thread Tom Davis
Okay, this is a pretty simple question with probably a "duh" answer, but I read the docs page on sessions and it doesn't specify, so here goes: Say I have some php (or whatever) page that sets a cookie named "stuff", using django, could I just use request.session['stuff'] and get the value, or do

Re: Partial change manipulator

2006-07-10 Thread Ivan Sagalaev
Greg wrote: > Is there a way to specify a _subset_ of the fields in a model for > the ChangeManipulator to operate on? You can set editable=False on those fields. Alternatively, if you use your custom views is to pass "follow" parameter in a manipulator constructor: manipulator = Model.Ch

Re: Problem with middleware

2006-07-10 Thread Guillermo Fernandez Castellanos
That's probably it. I don't know why, but I had this wrong idea that the 'get' would *assign* a default value to the dictionary if the value was not found! Thanks to both of you. G On 7/10/06, Ian Holsman <[EMAIL PROTECTED]> wrote: > > Hi Gullermo. > > I've done the same thing here: > http://s

Validations

2006-07-10 Thread Maximillian Dornseif
Probably I'm missing something here: I want 'validation' functionality in admin. E.g. I have the fields size, weight and checked_logistics. checked logistics should be only allowed to be set True if size and weight are not NULL. For 'normal' forms Manipulators/Validators seem the way to go. But