Django custom authentication

2013-10-22 Thread Praveen Madhavan
Hello All, I am trying custom authentication with django, I wrote a class and filled it with the methods authenticate and get_user, I also added this authentication to the AUTHENTICATION_BACKENDS in settings.py file. I have called my custom authenticate method and followed it up with

Re: Django custom authentication

2013-10-22 Thread François Schiettecatte
Praveen I would check that cookies are being returned from the browser, the session information in stored in them, and did you check that get_user() is returning the user corresponding to the ID? François On Oct 22, 2013, at 7:53 AM, Praveen Madhavan wrote: > Hello All, > > I am trying

Re: Django data to Javascript

2013-10-22 Thread drakko
Thanks!!! This helped a lot. Now it is working as I was hoping :) drakko trešdiena, 2013. gada 16. oktobris 16:14:39 UTC+2, ke1g rakstīja: > > > On Wed, Oct 16, 2013 at 3:39 AM, drakko >wrote: > >> ... >> > > >> But accessing should_have_found_list in template has no problems. I have >> sepa

Re: Django custom authentication

2013-10-22 Thread Tom Evans
On Tue, Oct 22, 2013 at 12:53 PM, Praveen Madhavan wrote: > Hello All, > > I am trying custom authentication with django, I wrote a class and > filled it with the methods authenticate and get_user, I also added this > authentication to the AUTHENTICATION_BACKENDS in settings.py file. > >

Re: Django custom authentication

2013-10-22 Thread Praveen Madhavan
Tom Thanks for the response, here is my view def home(request): if not request.user.is_authenticated(): # I have written my own custom authenticate method that returns an user object user=authenticate(request=request) if not user: return HttpResponseRedir

Re: What is the best solution to deploy Django on a Windows server?

2013-10-22 Thread Augusto Destrero
The virtual machine solution already came to my mind, but unfortunately it's not practical in this case. I investigated a bit the available solutions to have Django running on Windows and I came up with a CherryPy based deployment of Django. I wrote a blog post on my experience with this approac

Re: supervisor

2013-10-22 Thread Diogene Laerce
Are you sure you need one ? Well I need to monitor at least uwsgi to keep the site up. I rely now on monit, it seems ok. Like I asked to Lukas, what do you think of it ? uWSGI Emperor is way more capable (in terms of monitoring and management of bad-behaving apps) and easy to manage (j

Re: supervisor

2013-10-22 Thread Diogene Laerce
the trick is to add supervisor command that specifically tells the program to NOT daemonize [program:my_uwsgi] command = /usr/local/bin/uwsgi -i /path/to/config.ini autorestart = True user = your_user config.ini: your standard uwsgi config, but NO daemonize=logfile path that works perfectly

Django 1.6b4 fails to run tests with runner test.simple trying to import TransRealMixin

2013-10-22 Thread Matthieu Rigal
Hi all, I know that TransRealMixin already was a problem in the past and I thought it was "fixed" in the meaning that it was incorporated in the project. (https://github.com/django/django/pull/1147) I tried to run my actual tests (developed on 1.4.x) on the 1.6b4 and here is what comes out whe

Re: supervisor

2013-10-22 Thread Lukáš Němec
Dne 22. 10. 2013 18:24, Diogene Laerce napsal(a): the trick is to add supervisor command that specifically tells the program to NOT daemonize [program:my_uwsgi] command = /usr/local/bin/uwsgi -i /path/to/config.ini autorestart = True user = your_user config.ini: your standard uwsgi config, bu

Re: source code of the Django Tutorial?

2013-10-22 Thread tim
You are mixing versions of the tutorial. Check the URL or the green "Documentation version:" in the bottom right. The "dev" versions use "Question" while the older versions use "Poll". On Monday, October 21, 2013 4:13:46 PM UTC-4, Daniel Roseman wrote: > > On Monday, 21 October 2013 20:47:51 UTC

Re: MySQL error when trying to run tests with utf8mb4 charset

2013-10-22 Thread tim
I think you may be barking up the wrong tree, see https://code.djangoproject.com/ticket/21196 On Friday, October 18, 2013 7:30:10 PM UTC-4, fle...@fletchowns.net wrote: > > Looks like this comes from custom_user.py in django.contrib.auth.tests: > > class CustomUser(AbstractBaseUser): > email

Re: Django 1.6b4 fails to run tests with runner test.simple trying to import TransRealMixin

2013-10-22 Thread Ramiro Morales
Matthieu, On Tue, Oct 22, 2013 at 1:22 PM, Matthieu Rigal wrote: > Hi all, > > I know that TransRealMixin already was a problem in the past and I thought > it was "fixed"in the meaning that it was incorporated in the project. > (https://github.com/django/django/pull/1147) > > I tried to run my ac

HOWTO: Create a ManyToMany Relationship?

2013-10-22 Thread Timothy W. Cook
Can someone point me to where this is explained in the docs (1.6)? I have a ManyToMany relationship in my models between Author and Paper. I am processing an XML file to create records for Papers. I want to check if an Author exists and if not create the record. This was quite easy for Foreign

Re: Django 1.6b4 fails to run tests with runner test.simple trying to import TransRealMixin

2013-10-22 Thread Ramiro Morales
On Tue, Oct 22, 2013 at 4:33 PM, Ramiro Morales wrote: > > Could you give us more information about how to reproduce this? i.e. what > tests are you trying to run? etc. Never mind, I've reproduced it and opened ticket [1]12307. -- Ramiro Morales @ramiromorales 1. https://code.djangoproject.co

Re: HOWTO: Create a ManyToMany Relationship?

2013-10-22 Thread Pepsodent Cola
I'm a beginner so I can only answer your first question. The below link has helped me with 1:M and N:M relationship experiments. Can someone point me to where this is explained in the docs (1.6)? https://docs.djangoproject.com/en/1.6/topics/db/examples/ On Tuesday, October 22, 2013 11:59:

Re: Django 1.6b4 fails to run tests with runner test.simple trying to import TransRealMixin

2013-10-22 Thread Ramiro Morales
On Tue, Oct 22, 2013 at 8:26 PM, Ramiro Morales wrote: > On Tue, Oct 22, 2013 at 4:33 PM, Ramiro Morales wrote: >> >> Could you give us more information about how to reproduce this? i.e. what >> tests are you trying to run? etc. > > Never mind, I've reproduced it and opened ticket [1]12307. Thi

[ANNOUNCE] Django 1.6 release candidate available

2013-10-22 Thread James Bennett
It's almost here! Tonight we've issued a release candidate for Django 1.6. Information, including links to downloads and release notes, is available on the Django project blog: https://www.djangoproject.com/weblog/2013/oct/22/16c1/ -- You received this message because you are subscribed to the

Re: Auth backends don't work with HttpResponseRedirect and Django 1.4+?

2013-10-22 Thread Praveen Madhavan
Hi, Can you please exlpain it further. I am facing the same issue. I have written a get_user() method in my customauthentication.py. My authentication is successful but the subsequent requests show up as anonymous user. Thanks Praveen.M On Monday, 21 October 2013 16:28:12 UTC+5:30, HM wro

variable in django template

2013-10-22 Thread Harjot Mann
I want to initialize a varibale in django template from zero, which I want to comapre with the some job_no whihc is coming from database. I am not getting hoe to decalre a variable. Please help me . -- Harjot Kaur Mann Blog: http://harjotmann.wordpress.com/ Daily Dairy: http://harjotmann.wordpress

Re: HOWTO: Create a ManyToMany Relationship?

2013-10-22 Thread Mike Dewhirst
On 23/10/2013 11:51am, Pepsodent Cola wrote: I'm a beginner so I can only answer your first question. The below link has helped me with 1:M and N:M relationship experiments. Can someone point me to where this is explained in the docs (1.6)? https://docs.djangoproject.com/en/1.6/topics/db/