Re: Having Headache With LoginForm
Yeah, I've done that, but its not working! Any help? On Jan 17, 10:37 pm, Mark Furbeewrote: > It means, don't use the "decorator" @login_required above your login view. > Your login view cannot require a login, because you'd never get to log in. > Chicken and egg. > > > > On Tue, Jan 17, 2012 at 2:34 PM, coded kid wrote: > > > Thorsten Sanders wrote: > > > With using > > > > @login_required decorator the user needs to be logged in to allow > > execution, don't makes much sense for a login :P > > > > Am 17.01.2012 22:23, schrieb coded kid: > > > > Hi guys, I�m having problem with my login form. The login form will > > > > redirect me to the next page even if I didn�t input anything in the > > > > username and password field. Also it can�t get the username of the > > > > registered users to verify if the user data is wrong or right. How can > > > > I get rid of this problem? > > > > Below are my code: > > > > In views.py > > > > from django.db import models > > > > from mymeek.meekme.models import RegisterForm > > > > from django.shortcuts import render_to_response > > > > from django.http import HttpResponse > > > > from django.template import RequestContext > > > > from django.http import HttpResponseRedirect > > > > from django.contrib.auth import authenticate, login > > > > from django.contrib.auth.decorators import login_required > > > > > @login_required > > > > def mylogin(request): > > > > if request.method=='POST': > > > > username= request.POST['username'] > > > > password= request.POST['password'] > > > > user=authenticate (username=username, password=password) > > > > if user is not None: > > > > if user.is_active: > > > > login(request, user) > > > > return HttpResponseRedirect('/logpage/') > > > > else: > > > > return direct_to_template(request,'q_error.html') > > > > else: > > > > return render_to_response('mainpage.html') > > > > In my template: > > > > > > > > > > > > > > > > > > > > {{form.username.label_tag}} > > > > {{form.username}} > > > > > > > > > > > > {{form.password.label_tag}} > > > > {{form.password}} > > > > > > > > > > > > > > > > > > > > > > > > Please help me out! Thanks. > > > -- > > 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 group, send email to > > django-users+unsubscr...@googlegroups.com. > > For more options, visit this group at > >http://groups.google.com/group/django-users?hl=en. -- 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 group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
పనిమనిషి నూకాలు పూకు ని పచ్చడి కింద దెంగాను
పనిమనిషి నూకాలు పూకు ని పచ్చడి కింద దెంగాను click to Read Full Story http://www.googlika.com -- 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 group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Having Headache With LoginForm
It means, don't use the "decorator" @login_required above your login view. Your login view cannot require a login, because you'd never get to log in. Chicken and egg. On Tue, Jan 17, 2012 at 2:34 PM, coded kidwrote: > > > Thorsten Sanders wrote: > > With using > > > > @login_required decorator the user needs to be logged in to allow > execution, don't makes much sense for a login :P > > > > > > > > Am 17.01.2012 22:23, schrieb coded kid: > > > Hi guys, I�m having problem with my login form. The login form will > > > redirect me to the next page even if I didn�t input anything in the > > > username and password field. Also it can�t get the username of the > > > registered users to verify if the user data is wrong or right. How can > > > I get rid of this problem? > > > Below are my code: > > > In views.py > > > from django.db import models > > > from mymeek.meekme.models import RegisterForm > > > from django.shortcuts import render_to_response > > > from django.http import HttpResponse > > > from django.template import RequestContext > > > from django.http import HttpResponseRedirect > > > from django.contrib.auth import authenticate, login > > > from django.contrib.auth.decorators import login_required > > > > > > @login_required > > > def mylogin(request): > > > if request.method=='POST': > > > username= request.POST['username'] > > > password= request.POST['password'] > > > user=authenticate (username=username, password=password) > > > if user is not None: > > > if user.is_active: > > > login(request, user) > > > return HttpResponseRedirect('/logpage/') > > > else: > > > return direct_to_template(request,'q_error.html') > > > else: > > > return render_to_response('mainpage.html') > > > In my template: > > > > > > > > > > > > > > >{{form.username.label_tag}} > > >{{form.username}} > > > > > > > > >{{form.password.label_tag}} > > >{{form.password}} > > > > > > > > > > > > > > > > > > Please help me out! Thanks. > > > > > -- > 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 group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > > -- 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 group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Having Headache With LoginForm
Thorsten Sanders wrote: > With using > > @login_required decorator the user needs to be logged in to allow execution, > don't makes much sense for a login :P > > > > Am 17.01.2012 22:23, schrieb coded kid: > > Hi guys, I�m having problem with my login form. The login form will > > redirect me to the next page even if I didn�t input anything in the > > username and password field. Also it can�t get the username of the > > registered users to verify if the user data is wrong or right. How can > > I get rid of this problem? > > Below are my code: > > In views.py > > from django.db import models > > from mymeek.meekme.models import RegisterForm > > from django.shortcuts import render_to_response > > from django.http import HttpResponse > > from django.template import RequestContext > > from django.http import HttpResponseRedirect > > from django.contrib.auth import authenticate, login > > from django.contrib.auth.decorators import login_required > > > > @login_required > > def mylogin(request): > > if request.method=='POST': > > username= request.POST['username'] > > password= request.POST['password'] > > user=authenticate (username=username, password=password) > > if user is not None: > > if user.is_active: > > login(request, user) > > return HttpResponseRedirect('/logpage/') > > else: > > return direct_to_template(request,'q_error.html') > > else: > > return render_to_response('mainpage.html') > > In my template: > > > > > > > > > >{{form.username.label_tag}} > >{{form.username}} > > > > > >{{form.password.label_tag}} > >{{form.password}} > > > > > > > > > > > > Please help me out! Thanks. > > -- 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 group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Having Headache With LoginForm
How do you mean by that? Thorsten Sanders wrote: > With using > > @login_required decorator the user needs to be logged in to allow execution, > don't makes much sense for a login :P > > > > Am 17.01.2012 22:23, schrieb coded kid: > > Hi guys, I�m having problem with my login form. The login form will > > redirect me to the next page even if I didn�t input anything in the > > username and password field. Also it can�t get the username of the > > registered users to verify if the user data is wrong or right. How can > > I get rid of this problem? > > Below are my code: > > In views.py > > from django.db import models > > from mymeek.meekme.models import RegisterForm > > from django.shortcuts import render_to_response > > from django.http import HttpResponse > > from django.template import RequestContext > > from django.http import HttpResponseRedirect > > from django.contrib.auth import authenticate, login > > from django.contrib.auth.decorators import login_required > > > > @login_required > > def mylogin(request): > > if request.method=='POST': > > username= request.POST['username'] > > password= request.POST['password'] > > user=authenticate (username=username, password=password) > > if user is not None: > > if user.is_active: > > login(request, user) > > return HttpResponseRedirect('/logpage/') > > else: > > return direct_to_template(request,'q_error.html') > > else: > > return render_to_response('mainpage.html') > > In my template: > > > > > > > > > >{{form.username.label_tag}} > >{{form.username}} > > > > > >{{form.password.label_tag}} > >{{form.password}} > > > > > > > > > > > > Please help me out! Thanks. > > -- 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 group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Having Headache With LoginForm
With using @login_required decorator the user needs to be logged in to allow execution, don't makes much sense for a login :P Am 17.01.2012 22:23, schrieb coded kid: Hi guys, I’m having problem with my login form. The login form will redirect me to the next page even if I didn’t input anything in the username and password field. Also it can’t get the username of the registered users to verify if the user data is wrong or right. How can I get rid of this problem? Below are my code: In views.py from django.db import models from mymeek.meekme.models import RegisterForm from django.shortcuts import render_to_response from django.http import HttpResponse from django.template import RequestContext from django.http import HttpResponseRedirect from django.contrib.auth import authenticate, login from django.contrib.auth.decorators import login_required @login_required def mylogin(request): if request.method=='POST': username= request.POST['username'] password= request.POST['password'] user=authenticate (username=username, password=password) if user is not None: if user.is_active: login(request, user) return HttpResponseRedirect('/logpage/') else: return direct_to_template(request,'q_error.html') else: return render_to_response('mainpage.html') In my template: {{form.username.label_tag}} {{form.username}} {{form.password.label_tag}} {{form.password}} Please help me out! Thanks. -- 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 group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Having Headache With LoginForm
Hi guys, I’m having problem with my login form. The login form will redirect me to the next page even if I didn’t input anything in the username and password field. Also it can’t get the username of the registered users to verify if the user data is wrong or right. How can I get rid of this problem? Below are my code: In views.py from django.db import models from mymeek.meekme.models import RegisterForm from django.shortcuts import render_to_response from django.http import HttpResponse from django.template import RequestContext from django.http import HttpResponseRedirect from django.contrib.auth import authenticate, login from django.contrib.auth.decorators import login_required @login_required def mylogin(request): if request.method=='POST': username= request.POST['username'] password= request.POST['password'] user=authenticate (username=username, password=password) if user is not None: if user.is_active: login(request, user) return HttpResponseRedirect('/logpage/') else: return direct_to_template(request,'q_error.html') else: return render_to_response('mainpage.html') In my template: {{form.username.label_tag}} {{form.username}} {{form.password.label_tag}} {{form.password}} Please help me out! Thanks. -- 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 group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: am I understanding sessions correctly?
> > Yes, your caching seems a likely culprit, and so does the asynchronous > nature of you AJAX (but it seems like you've got a handle on that > part). I haven't thought through the load balancer bit yet, but > presumably they are all using the same cache / database / session > store..? > update -- we seem to have resolved the problem by installing memcached and using the "django.contrib.sessions.backends.cached_db" session middleware. We also seem to have gotten a nice (and unexpected) performance boost as well. -- 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 group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Web Servers for Django Projects [WAS: Does anyone know any blogs...]
On Tue, Jan 17, 2012 at 3:56 AM, Tom Evanswrote: > On Mon, Jan 16, 2012 at 11:12 PM, Stuart Laughlin > wrote: >> I also note that everyone who advocates >> for apache concedes that the default installation/configuration is really >> not appropriate for django apps. I intend to look more deeply into the >> suitability of the default configurations of nginx / lighttpd / cherokee as >> delivered by various linux distros. Finally, your point about mod_wsgi's >> superior configurability is a good one, and something I had not considered. > > You're inventing words that you think I said. The 'default' config is > entirely appropriate for django apps, it is however not high > performance. > > I say 'default', because it is only the default on certain OS. On the > platform we serve on, FreeBSD, it is a simple choice which MPM to > choose, and the default configuration for Apache configured with > worker or event MPM is entirely on par with nginx/lighty. > Fair enough, Tom. "The default config of apache on certain operating systems (e.g. most linux distros) will not yield high performance for your django apps." I suspect it was my unqualified usage of the nebulous phrase "not appropriate" that prompted you to accuse me of "inventing words that [I] think [you] said," but in fact the more clearly stated proposition above is what I had in mind in the first place. Regards, --Stuart -- 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 group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: raw_post_data
On Tue, Jan 17, 2012 at 3:52 PM, Dilvanewrote: > Hi, > > I am using PUT method, I get data from request.raw_post_data. > > it's possible do that? > > a = Article.objects.get(pk=1) > f = ArticleForm(request.raw_post_data, instance=a) > f.save() > > > Thanks! > No. Forms expect their data argument to be a dict like object. request.raw_post_data is a raw string containing the raw post data (clue is in the name), which will be in whatever format you pushed to it. If the data is of MIME type application/x-www-form-urlencoded or multipart/form-data, then you can use django.http.QueryDict to parse it - request.POST is a QueryDict. Otherwise, you must parse the contents into a dict-like object that forms can process. Cheers Tom -- 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 group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: document admin interface
On 16 Jan., 16:36, Sébastien Billionwrote: > Hi, > > Why don't use help_text argument in your models or formAdmin? Thank you. That was exactly what I was looking for. -- 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 group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
raw_post_data
Hi, I am using PUT method, I get data from request.raw_post_data. it's possible do that? a = Article.objects.get(pk=1) f = ArticleForm(request.raw_post_data, instance=a) f.save() Thanks! -- 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 group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Best Practices for Outsourcing Partial Development?
You would have to work to modularize your design so you can split jobs in a very much self contained modules for each outsourcing team, if a module has dependencies with others you may want to create a set of stubs and hand them that, hell you could even generate the whole set of stubs for all the project and just have the outsourcing programmers fill them, this seams to ease things. As for freelancing sites, as others have said, its a bit difficult to find good experienced developers there and some platforms just puts a barrier between you and the developer. If your project is sensitive and you have security worries I suggest you to consider at least local freelancing, otherwise word of mouth is a good way to lookup good candidates, check what OSS projects they are engaged with. Personally as some one that have been a freelancer for a few years, I found the use of such platforms painful and a friction cause, so I tend not to use them I very much prefer the platforms I'm already using (for developing Free Software) such as github / bitbucket, trac, redmine, etc. The best jobs I ever had have been outside such platforms, but alas YMMV. Regards, Carlos Daniel Ruvalcaba Valenzuela -- 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 group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Pinax or Straight Django
On 01/17/12 01:12, Kevin Miller wrote: I have been struggling between using Pinax or Straight django to develop my apps. I have never used Pinax, but was reading on it. I have already only developed one website in django although it is not yet launched. I'm not sure it's an either/or proposition. Pinax is built on Django, so you can work in Pinax and add other Django modules (or work in pure Django and pull in elements you like from Pinax). It might be helpful to listen to the FLOSS Weekly podcast that recently interviewed James Tauber of Pinax: http://twit.tv/show/floss-weekly/193 where James makes it pretty clear that they're symbiotic. -tkc -- 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 group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Best Practices for Outsourcing Partial Development?
On Jan 17, 4:51 am, Venkatraman Swrote: > On Tue, Jan 17, 2012 at 6:30 AM, cjwalter wrote: > > This is why I would appreciate to hear about experiences traveling > > this road. What worked and what didn't? > > Have never been a fan of elance etc; you should be lucky to find a good set > of 'trained hands' there. > The best would be to ask around and check the probable candidates - word of > mouth works best. > > -Venkat I mentioned elance just as an example for other such platforms and I agree that there are other avenues to find somebody capable, too. However, there still remains the question on how to let somebody participate on partial development aspects. If there is no good solution for this, then the requirements for third parties are even higher as full access to all source code needs to be granted (using tools like git, svn etc.) --ChrisW -- 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 group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Validators for fields in Proxy Model - possible without monkeypatching?
I've found the solution, initially I was looking in wrong direction. All I needed to do is to use ``Model.clean()`` method and then call ``Model.full_clean()`` in ``save()``: from django.contrib.auth.models import User class CustomUser(User) def clean(self): """ Clean username field to be lowercase. """ self.username = self.username.lower() def save(self, *args, **kwargs): """ Override save() method to call model cleaning. """ self.full_clean(exclude=['password']) super(CustomUser, self).save(*args, **kwargs) On Jan 17, 2:37 am, Matt Schinckelwrote: > You can probably use a form to do most of what you want, with the caveat > that as long as your restrictions are more restrictive than any db > constraints that auth.User puts in there are. -- 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 group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Web Servers for Django Projects [WAS: Does anyone know any blogs...]
On Mon, Jan 16, 2012 at 11:12 PM, Stuart Laughlinwrote: > I also note that everyone who advocates > for apache concedes that the default installation/configuration is really > not appropriate for django apps. I intend to look more deeply into the > suitability of the default configurations of nginx / lighttpd / cherokee as > delivered by various linux distros. Finally, your point about mod_wsgi's > superior configurability is a good one, and something I had not considered. You're inventing words that you think I said. The 'default' config is entirely appropriate for django apps, it is however not high performance. I say 'default', because it is only the default on certain OS. On the platform we serve on, FreeBSD, it is a simple choice which MPM to choose, and the default configuration for Apache configured with worker or event MPM is entirely on par with nginx/lighty. On top of that, you get all the advantages of being part of the Apache ecosystem. Apache 2.4.0 will be released this week (probably), with a mass of enhancements: http://httpd.apache.org/docs/trunk/new_features_2_4.html I'd thoroughly recommend not ignoring Apache in search of the new cool. Cheers Tom -- 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 group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Pinax or Straight Django
Well if you're writing social-style apps (e.g. friends, invites, events, groups, forums, blogs, wikis, social-networks) then Pinax. Otherwise go with Django. On Tue, Jan 17, 2012 at 6:12 PM, Kevin Millerwrote: > Dear all, > > I have been struggling between using Pinax or Straight django to > develop my apps. I have never used Pinax, but was reading on it. > I have already only developed one website in django although it is not > yet launched. > > I would really like to hear the experiences of those who have used both. > > Are there really any benefits in using Pinax? > > NB: On a quick browse on google I realize that it was difficult to > find good and up to date tutorials on Pinax. > > > Thanks in advance for the replies. > > > Kevin > > -- > 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 group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > -- 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 group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.