Django send_mail issue

2010-12-16 Thread Vikesh
Hi, I have never used sendmail in Ubuntu and I am not too good at networks. I was trying to implement a mail application in Django where I send a mail to the newly registered user for confirmation. I used the following settings in my settings.py file : EMAIL_HOST='localhost'

Re: registering app level signal handlers

2010-12-16 Thread W. Craig Trader
I usually register the signals for a given application at the bottom of that app's model.py file. - Craig - On Thu, Dec 16, 2010 at 19:04, dmitry b wrote: > On Dec 16, 3:28 pm, Graham Dumpleton > wrote: > > On Friday, December 17, 2010

Re: Very strange lost network connection problem

2010-12-16 Thread bax...@gretschpages.com
Sorry for responding to my own post -- trying to add some additional info. Because of the way it's behaving, I'm wondering if it's middleware related. Seems to be at a very low level in the request/response cycle. So with that in mind, this is my middleware below. Does the order look OK?

applying function in Paginator

2010-12-16 Thread piotr
Hello django community I'm rendering some objects with paginator. I made a function for these objects for being displayed as html, so I need the result of this function in a variable to pass it to the html template. May be good idea to implement a function to be aplied to displayed objects in the

Re: registering app level signal handlers

2010-12-16 Thread dmitry b
On Dec 16, 3:28 pm, Graham Dumpleton wrote: > On Friday, December 17, 2010 10:00:55 AM UTC+11, dmitry b wrote: > > Are you talking about UNIX process signals? I'm sorry, I forgot there are two ways to interpret my question. It is about Django signals. -- You

Re: registering app level signal handlers

2010-12-16 Thread Steve Holden
On 12/16/2010 6:28 PM, Graham Dumpleton wrote: > Are you talking about UNIX process signals? > He's almost certainly talking about Django signals. I've never seen a definite recommendation as to how to do things exactly once early on in the life of your server process, so I am afraid I cannot

Re: registering app level signal handlers

2010-12-16 Thread Graham Dumpleton
On Friday, December 17, 2010 10:00:55 AM UTC+11, dmitry b wrote: > > Hi, What is the best place to register a signal handler so that the > registration happens when the app is first initialized into django? I have > an app that needs to listen to signals generated by another app and fire off

registering app level signal handlers

2010-12-16 Thread dmitry b
Hi, What is the best place to register a signal handler so that the registration happens when the app is first initialized into django? I have an app that needs to listen to signals generated by another app and fire off celery tasks in response. I've tried placing the registration code into the

Re: virtualenv and deployment

2010-12-16 Thread Graham Dumpleton
On Friday, December 17, 2010 1:21:26 AM UTC+11, Craig Trader wrote: > > Alex ... > > This is the point where my experience ends -- I'm not operating in a > hosting environment. I can tell you that mod_python has to be compiled for > a specific version of Apache AND Python (one of the reasons

Re: Django model question from a newbee

2010-12-16 Thread Reino
Thanks Tom, I was confusing an instance of a ModelForm with an instance of the Model it represents. You suggestion about the mod_time is good idea. However, I still can't get the password stored as an md5 hash. Matteius, it is not an option to use Djangos User object, and user database.

Re: Confused about thread locals... again.

2010-12-16 Thread Doug Ballance
@ringemip Thanks for the reply. I've been considering something like that, but given the number of views and tags involved, it would be a very long process. Especially since I used a new context instance in most of my custom tags that render another template, rather the pushing, rendering,

Re: Django model question from a newbee

2010-12-16 Thread Matteius
Ok I did not mean to send that last post, it was an accident. 1.) Add exclude tuple here: class CasUserForm(ModelForm): class Meta: exclude = ('field1', 'field2') Now go ahead with part 2) 2.) Hide passwords in the form either by manually calling the fields and specifying

Re: Django model question from a newbee

2010-12-16 Thread Matteius
OK So these are UI issues and how you are saving Users to the database. The database field itself is a CharField. 1.) To hide form elements add a tupple inside the FormField under class meta like so: class CasUserForm(ModelForm): exclude = [field1, field2] 2.) On Dec 16, 6:39 am, Reino

Very strange lost network connection problem

2010-12-16 Thread bax...@gretschpages.com
This is a weird one. On a handful of topics on my forum, accessing the topic and/or attempting to add a post or do anything else loses the network connection. It's only on a handful, and it just started recently. I have no idea how Django can even do such a thing, but you can see it here:

Re: getting back max date from a joined table for list_display

2010-12-16 Thread Michael Dippery
On Dec 16, 2010, at 3:53 AM, dan kirkland wrote: > Hi, I'm new to python and django and need to join two tables together > - the first table holds details about a customer and I think is > probably passed as the obj parameter of the following function. The > second is a CallBackRequest table that

Re: use table not in the model

2010-12-16 Thread Tonton
thanks for yours ansewers i wiil read that i try this def getExtentFromaMap(amap): idx =[] e=[] listcouche = get_list_or_404(Layer, carte_id=amap.id) for l in range(len(listcouche)): x=listcouche[l].dataset_id idx.append (x) for ds in range(len(idx)):

Re: use table not in the model

2010-12-16 Thread W. Craig Trader
Tonton ... See for details on how to use so-called 'raw' SQL (ie: not managed with models) within Django. - Craig - On Thu, Dec 16, 2010 at 09:16, Tonton wrote: > Hello > i like to use some database table that are not

Re: use table not in the model

2010-12-16 Thread bruno desthuilliers
On 16 déc, 15:16, Tonton wrote: > Hello > i like to use some database table that are not in my models.py > in fact some of table will be add and remove by script > > is it possible to use some sql queries with it ? Of course it is. >>> from django.db import connection >>>

Re: use table not in the model

2010-12-16 Thread Mark (Nosrednakram)
On Dec 16, 7:16 am, Tonton wrote: > Hello > i like to use some database table that are not in my models.py > in fact some of table will be add and remove by script > > is it possible to use some sql queries with it ? on not at all ? > > regards > > tonton Hello Tonton, Yes,

Re: simple.direct_to_template and query objects

2010-12-16 Thread MarcoS
Yes, you're correct. Thank you so much On 16 Dic, 13:40, Marcos Moyano wrote: > I think you are looking for object_detail, not > direct_to_template.http://docs.djangoproject.com/en/dev/ref/generic-views/#django-views-... > > Rgds, > Marcos > > > > On Thu, Dec 16, 2010 at

Re: virtualenv and deployment

2010-12-16 Thread W. Craig Trader
Alex ... This is the point where my experience ends -- I'm not operating in a hosting environment. I can tell you that mod_python has to be compiled for a specific version of Apache AND Python (one of the reasons that mod_wsgi is better is that it breaks the Python-version dependency). If you

use table not in the model

2010-12-16 Thread Tonton
Hello i like to use some database table that are not in my models.py in fact some of table will be add and remove by script is it possible to use some sql queries with it ? on not at all ? regards tonton -- You received this message because you are subscribed to the Google Groups "Django

Re: Limit number of concurrent non-admin/non-superuser users

2010-12-16 Thread Stodge
I added an ajax call to log the user out when they close the browser. It works in Firefox and Chrome but is this an acceptable/safe practice? I experimented with SESSION_SAVE_EVERY_REQUEST=True SESSION_COOKIE_AGE = 300 which works but I can't guarantee that requests are sent frequently enough

Re: Django model question from a newbee

2010-12-16 Thread Tom Evans
On Thu, Dec 16, 2010 at 12:39 PM, Reino wrote: > I am new to Django, and I am building a simple application where I am > going to manage a legacy user database from Djangos admin interface. > Below is how my model looks like. > > My goal is to hide some of the fields in the form

Re: simple.direct_to_template and query objects

2010-12-16 Thread Marcos Moyano
I think you are looking for object_detail, not direct_to_template. http://docs.djangoproject.com/en/dev/ref/generic-views/#django-views-generic-list-detail-object-detail Rgds, Marcos On Thu, Dec 16, 2010 at 9:32 AM, MarcoS wrote: > Hi people, I want to define a generic

getting back max date from a joined table for list_display

2010-12-16 Thread dan kirkland
Hi, I'm new to python and django and need to join two tables together - the first table holds details about a customer and I think is probably passed as the obj parameter of the following function. The second is a CallBackRequest table that holds details of when I should next call a customer. The

Django model question from a newbee

2010-12-16 Thread Reino
I am new to Django, and I am building a simple application where I am going to manage a legacy user database from Djangos admin interface. Below is how my model looks like. My goal is to hide some of the fields in the form where I edit/add users. However, currently I can see all the fields except

simple.direct_to_template and query objects

2010-12-16 Thread MarcoS
Hi people, I want to define a generic view using simple.direct_to_template, something like this: (r'^detail_event/(?P\d+)/$', simple.direct_to_template, { 'extra_context': {'event': Event.objects.get(id=object_id),} }), Of course this doesn't work, django tell me that 'object_id' is

Re: virtualenv and deployment

2010-12-16 Thread Álex González
Thanks for your reply Craig, to use mod_python in my hosting I'm using this .htaccess file: SetHandler python-program PythonOption django.root / PythonHandler django.core.handlers.modpython PythonPath "['/var/www/vhosts/myhosting.com/httpdocs'] + sys.path" SetEnv DJANGO_SETTINGS_MODULE settings