回复: login or login_decorator issue

2012-08-09 Thread Pengfei Xue
-- Sincerely, Pengfei Xue 已使用 Sparrow (http://www.sparrowmailapp.com/?sig) 已使用 Sparrow (http://www.sparrowmailapp.com/?sig) 在 2012年8月9日星期四,下午2:33,mapapage 写道: > > I wrote this custom authentication backend: > > from django.contrib.auth.models import User, check_password > from auth.model

Re: 回复: login or login_decorator issue

2012-08-09 Thread mapapage
> > I'm working with a legacy database so I should use another model (Owners) > instead of the default Djangoconstrib.auth.models.User for authentication. > That's why I wrote my own and custom authentication backend. > My model has an id field (id = models.DecimalField(...)) that is used for

Re: 回复: login or login_decorator issue

2012-08-09 Thread mapapage
On Thursday, August 9, 2012 10:39:07 AM UTC+3, mapapage wrote: > > I'm working with a legacy database so I should use another model (Owners) >> instead of the default Djangoconstrib.auth.models.User for >> authentication. >> > That's why I wrote my own and custom authentication backend. > >>

回复: login or login_decorator issue

2012-08-09 Thread Pengfei Xue
http://www.djangobook.com/en/2.0/chapter14/ take a quick look at this article, i think it will help you out -- Sincerely, Pengfei Xue 已使用 Sparrow (http://www.sparrowmailapp.com/?sig) 已使用 Sparrow (http://www.sparrowmailapp.com/?sig) 在 2012年8月9日星期四,下午3:39,mapapage 写道: > > > On Thursd

Re: 回复: login or login_decorator issue

2012-08-09 Thread mapapage
I saw it but I think that this isn't what I need for what I wanna do. I shouldn't use django's authentication module. I should make my own backend work. -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit

showing many-to-many field in admin interface

2012-08-09 Thread Mo Mughrabi
hello everyone, am trying to build a single model that will be used for uploaded images/files. Am trying to use it in the best way in the admin pages, so when i associate it with a specific model as a many-to-many field it would appear in a friendly way for users to upload images. My attachment m

Login/ Logout user details

2012-08-09 Thread Pervez Mulla
Hi, Please tell me how can I know ,the details about user login and logout details , and how can I store that data in DB in Django. Thank You Pervez -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us

email as username best practice in 1.4

2012-08-09 Thread Gordon Wrigley
What is the recommended best approach for using emails as usernames in Django 1.4? I've looked in the FAQ and couldn't find anything, I see there is this issue https://code.djangoproject.com/ticket/3011 which is likely to be addressed in 1.5 but I can't wait for 1.5. Searching here, stackoverfl

Re: Login/ Logout user details

2012-08-09 Thread Aljoša Mohorović
On Thu, Aug 9, 2012 at 1:19 PM, Pervez Mulla wrote: > Please tell me how can I know ,the details about user login and logout > details , and how can I store that data in DB in Django. User model (auth.models.User) has last_login and if you need custom data stored you can try using: https://docs.d

Middleware manipulating template in response

2012-08-09 Thread Thomas Weholt
I need to change what template to use in a response based on type of user-agent in request. The middleware below works ok to detect mobile client, but I cannot get the template manipulation in the process_view method to work. The middleware: # Credits: http://djangosnippets.org/snippets/2001/ im

Re: Login/ Logout user details

2012-08-09 Thread Satinderpal Singh
On Thu, Aug 9, 2012 at 4:49 PM, Pervez Mulla wrote: > Hi, > > Please tell me how can I know ,the details about user login and logout > details , and how can I store that data in DB in Django. There are many registration modules already made in django, you just download it and install to your syste

Re: Middleware manipulating template in response

2012-08-09 Thread Daniel Roseman
> > On Thursday, 9 August 2012 13:18:36 UTC+1, MrMuffin wrote: >> >> I need to change what template to use in a response based on type of >> user-agent in request. The middleware below works ok to detect mobile >> client, but I cannot get the template manipulation in the process_view >> method

Re: Middleware manipulating template in response

2012-08-09 Thread Thomas Weholt
Hmmm ... is there any other way to achieve the same result ( using a special template for mobile devices ) without hacking this into each view? MiddleWare using https://docs.djangoproject.com/en/dev/topics/http/middleware/?from=olddocs/#process-template-response for instance? Anyway, thanks for

Pure python-alternative to Gunicorn/NGINX/Serving static content

2012-08-09 Thread Thomas Weholt
I'm using gunicorn and nginx on ubuntu when deploying my django projects, but now I need to run a project on several platforms, including windows. Is there a similar pure python configuration ( with the expected reduced performance for serving static content )? -- Mvh/Best regards, Thomas Weholt

Re: Nullable User email

2012-08-09 Thread Demian Brecht
Thanks for the feedback guys.. What I ended up doing was adding the following lines to my models module: from django.contrib.auth.models import User as BaseUser BaseUser._meta.get_field("username")._unique = False BaseUser._meta.get_field("email").null = True Melvin: I tried your suggestion and

ordering of post_syncdb signals?

2012-08-09 Thread carrier24sg
Hi folks, I am a little confused with the ordering of the post_syncdb signal? (using 1.2.4) Looking at the code in auth and contenttype, what makes auth.permission so sure that the appropriate content type was created before the necessary permission is created? Similarly, I have another app calle

Re: Middleware manipulating template in response

2012-08-09 Thread Kurtis Mullins
I saw this in one of the previous Python newsletters (I think) and it looked pretty interesting: https://github.com/gregmuellegger/django-mobile On Thu, Aug 9, 2012 at 9:29 AM, Thomas Weholt wrote: > Hmmm ... is there any other way to achieve the same result ( using a > special template for mobil

Re: Created & updated date/time in models

2012-08-09 Thread Lachlan Musicman
On Thu, Aug 9, 2012 at 3:33 PM, Dennis Lee Bieber wrote: > On Thu, 9 Aug 2012 09:02:39 +1200, Lachlan Musicman > declaimed the following in gmane.comp.python.django.user: >> >> From what I can see, the admin interface already keeps this data for >> each object (exception: no create_date for data

Combining django-tables2 with django-filter info ListView?

2012-08-09 Thread Paul
I have a listview using the generic class based ListView. I have get_queryset overloaded in my view: class WebsiteList(ListView): model = Website def get_queryset(self): return Website.objects.all() First step is to add the tables2 mixin as follows: class WebsiteList(tables.Sing

Re: Middleware manipulating template in response

2012-08-09 Thread Matt Pegler
It sounds like you want to automagically do something like: if request.is_mobile: return render_to_response('test_mobile.html',{}) return render_to_response('test.html',{}) I'm not sure that will be possible without modifying your views. I did something similar by determining which base templ

Setting APPEND_SLASH = False and PREPEND_WWW = True

2012-08-09 Thread JJ Zolper
Hello all, I am interested in making these two changes to Django: Setting APPEND_SLASH = False and PREPEND_WWW = True. The following links describe what each of these do but do not tell me actually where these settings reside so that I can actually change them: http://djangobook.com/en/2.0/cha

Re: Setting APPEND_SLASH = False and PREPEND_WWW = True

2012-08-09 Thread Russell Keith-Magee
On Fri, Aug 10, 2012 at 10:41 AM, JJ Zolper wrote: > Hello all, > > I am interested in making these two changes to Django: Setting APPEND_SLASH > = False and PREPEND_WWW = True. > > The following links describe what each of these do but do not tell me > actually where these settings reside so that

log file will be overwrite when use prefork?

2012-08-09 Thread DanYun Liu
below is the logging config in setting.py. only the newest logs in the output file.. It seems the log file is overwrite when new process been forked LOGGING = { 'version': 1, 'disable_existing_loggers': False, 'formatters': { 'standard': { 'format': '%(levelname)s

回复: log file will be overwrite when use prefork?

2012-08-09 Thread Pengfei Xue
you are using TimedRotatingFileHandle, so it will rotate your log into a new file with the name as xxx.20120810, and start store new entries in 'filename'( stat.txt, error.txt) -- Sincerely, Pengfei Xue 已使用 Sparrow (http://www.sparrowmailapp.com/?sig) 已使用 Sparrow (http://www.sparrowmaila