Re: internal server error not sending message notification

2013-05-04 Thread ?manu*
Hi Ian,

you suggestion make perfect sense but I'm currently running django 1.4. 
Anyway I tried adding those line to my settings, but nothing has changed...

Any other suggestion? I don't even know how to debug such an issue... 
should I insert breakpoints in the django library?

E.

On Saturday, May 4, 2013 5:06:53 PM UTC+2, Ian Lewis wrote:
>
> Hi,
>
> Did you set your LOGGING configuration in your settings.py? If you 
> happened to upgrade to Django 1.5 then the default LOGGING configuration 
> went away and it will no longer sent emails to the admins without some 
> configuration. This is described at the following url where it says "Prior 
> to Django 1.5": 
> https://docs.djangoproject.com/en/dev/topics/logging/#configuring-logging
>
> You need to set up something like the following for admin error mails to 
> work:
>
> LOGGING = {
> 'version': 1,
> 'disable_existing_loggers': False,
> 'filters': {
> 'require_debug_false': {
> '()': 'django.utils.log.RequireDebugFalse',
> }
> },
> 'handlers': {
> 'mail_admins': {
> 'level': 'ERROR',
> 'filters': ['require_debug_false'],
> 'class': 'django.utils.log.AdminEmailHandler'
> }
> },
> 'loggers': {
> 'django.request': {
> 'handlers': ['mail_admins'],
> 'level': 'ERROR',
> 'propagate': True,
> },
> }
> }
>
> Hope that helps,
> Ian
>
>
> On Sat, May 4, 2013 at 8:01 AM, ?manu*  > wrote:
>
>> I suddenly realized that my server is no more sending email notifications 
>> when an internal error occurs. I'm not sure which could be the modification 
>> that caused this behavior. I have the following information:
>>
>> 1. on internal errors the server gives an error not founding template 
>> file 500.html.
>>
>> 2. if I put my 500.html template then django does not complain anymore, 
>> shows the page but does not send the email message.
>>
>> 3. from manage.py shell the command django.core.mail.mail_admins works 
>> fine (email arrives to the admins)
>>
>> Any clue?
>>
>> Thanks,
>> E.
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com
>> .
>> Visit this group at http://groups.google.com/group/django-users?hl=en.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>  
>>  
>>
>
>
>
> -- 
> Ian
>
> http://www.ianlewis.org/ 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Can't open any other view except default "It Worked!" page......

2013-05-04 Thread Vibhu Rishi
Did you :
1. add the polls app to the INSTALLED_APP?
2. modify the urls.py as mentioned below to go to the polls ?

Vibhu

On Sun, May 5, 2013 at 7:42 AM, Russell Keith-Magee  wrote:

>
> If all you're getting is the "It worked!" page, then it means your urls.py
> hasn't been configured correctly. The "It worked" page is displayed when
> your urls.py is found, but is empty.
>
> You'll need to write some views and connect them up in your urls.py;
> alternatively, you could write up admin registrations for your inspected
> models and activate the admin URLs.
>
> Yours,
> Russ Magee %-)
>
> On Sun, May 5, 2013 at 8:27 AM, Daniel O' Shaughnessy <
> danieljamesda...@gmail.com> wrote:
>
>> Hi,
>>
>> This worked fine for me with the polls tutorial app but when I tried
>> another app it kept just giving me that page over and over even though I
>> followed the same procedure as the polls app except I used inspectdb
>>
>> Now this page is all I get for anything and I've tried deleting all
>> projects and starting new ones but no luck any ideas?
>>
>> Cheers,
>>
>> Daniel
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-users?hl=en.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>



-- 
Simplicity is the ultimate sophistication. - Leonardo da Vinci
Life is really simple, but we insist on making it complicated. - Confucius

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Can't open any other view except default "It Worked!" page......

2013-05-04 Thread Russell Keith-Magee
If all you're getting is the "It worked!" page, then it means your urls.py
hasn't been configured correctly. The "It worked" page is displayed when
your urls.py is found, but is empty.

You'll need to write some views and connect them up in your urls.py;
alternatively, you could write up admin registrations for your inspected
models and activate the admin URLs.

Yours,
Russ Magee %-)

On Sun, May 5, 2013 at 8:27 AM, Daniel O' Shaughnessy <
danieljamesda...@gmail.com> wrote:

> Hi,
>
> This worked fine for me with the polls tutorial app but when I tried
> another app it kept just giving me that page over and over even though I
> followed the same procedure as the polls app except I used inspectdb
>
> Now this page is all I get for anything and I've tried deleting all
> projects and starting new ones but no luck any ideas?
>
> Cheers,
>
> Daniel
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Data concurrency, consistency and serializable

2013-05-04 Thread Qna Share
Are there any reputable libraries (with actual production references like 
Instagram) to deal with data concurrency, consistency and serializability?
A typical scenario is: a race condition caused by two clients. Suppose if 
someone had two browsers open and simultaneously click on [yes] from 
browser A and [no] from browser B.
I have seen the following 3 things mentioned by doing some google search:
1. use model.objects. select_for_update() with filter()
2. use django-concurrency library (
https://github.com/saxix/django-concurrency)
3. use django-locking (https://github.com/stdbrouw/django-locking)
I can't find any production references for #2 and #3. I don't really want 
to apply some kind lab experiment even though they look good and a quick 
evaluation seems to do what they advertised.
As for #1, I'm thinking about using the following steps:
1. locking on some context object using select_for_update() with filter() 
within which I check for isOKToUpdate. release lock. If not ok, throw error 
immediately.
2. updateByClones. I will clone all the objects that I will update then 
update the clones.
3. locking on the same context object again and check isOKToUpdate again 
and this time I also do an atomic swap and commit if isOK. release lock. If 
not ok, throw error also.
In short, double locking with atomic swap. The locking is in a transaction 
with commit_on_ok. The locking block calls should be fairly fast because 
the context object is light weight with just a hash (some random string) to 
check whether someone else has updated or not.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Can't open any other view except default "It Worked!" page......

2013-05-04 Thread Daniel O' Shaughnessy
Hi,

This worked fine for me with the polls tutorial app but when I tried 
another app it kept just giving me that page over and over even though I 
followed the same procedure as the polls app except I used inspectdb

Now this page is all I get for anything and I've tried deleting all 
projects and starting new ones but no luck any ideas?

Cheers,

Daniel

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Problem with Django 1.5.1 and django-pyodbc

2013-05-04 Thread Thomas De Reyck
Hi, I had almost exactly the same issue just a week ago. Try using the 
django-pyodbc-azure fork. It works great for me.

Mvg,
Thomas De Reyck

On 3-mei-2013, at 00:47, Kerry Calvert  wrote:

> I have Django running on a Windows server with MS Sql using django-pyodbc.  I 
> had Django version 1.4.2 working, and then upgraded to 1.5.1.  This broke 
> django-pyodbc, which I fixed by updating to a fork by 'Gorah'.  This got my 
> old site up and running. I then tried to create a new site, and when I ran 
> syncdb, the error is that get-grouping requires two arguments.  This appears 
> to be a new requirement in django\db\models\sql\compiler.py, which is 
> imported by sql_server\pyodbc\compiler.py. I 'fixed' this by changing the 
> Django line to "def get_grouping(self, ordering_group_by=None):", but I 
> suspect that this is not the right thing to do.  I'm an old programmer, but 
> new to Python, Django, and open source.  Where should I go with this?
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>  
>  

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Django - Query

2013-05-04 Thread cingusoft
Hi

You need to use exceptions to solve this problem

try:
movieObject=Movie.objects.get(.)
except Movie.DoesNotExist:
#make the insert query
movieObject=Movie()



BlackBerry de movistar, allí donde estés está tu oficin@

-Original Message-
From: Hélio Miranda 
Sender: django-users@googlegroups.com
Date: Sat, 4 May 2013 06:49:48 
To: 
Reply-To: django-users@googlegroups.com
Subject: Re: Django - Query

That was it, but now I'm the problem is that, I wonder if there is a movie 
on BD, but there insert.
I am trying as follows, but I do not get:

And it gives me the following error: Movie matching query does not exist.
The film is not clear ...
Does anyone know what I'm doing wrong?

Código (Python):
if Movie.objects.get(MovieTitle='Avatar').exists():
reportMovie.MovieTitle = 'Avatar'
reportMovie.MovieTitlePT = line["Movie Name (PT)"]
reportMovie.save()

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.



-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: internal server error not sending message notification

2013-05-04 Thread Ian Lewis
Hi,

Did you set your LOGGING configuration in your settings.py? If you happened
to upgrade to Django 1.5 then the default LOGGING configuration went away
and it will no longer sent emails to the admins without some configuration.
This is described at the following url where it says "Prior to Django 1.5":
https://docs.djangoproject.com/en/dev/topics/logging/#configuring-logging

You need to set up something like the following for admin error mails to
work:

LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'filters': {
'require_debug_false': {
'()': 'django.utils.log.RequireDebugFalse',
}
},
'handlers': {
'mail_admins': {
'level': 'ERROR',
'filters': ['require_debug_false'],
'class': 'django.utils.log.AdminEmailHandler'
}
},
'loggers': {
'django.request': {
'handlers': ['mail_admins'],
'level': 'ERROR',
'propagate': True,
},
}
}

Hope that helps,
Ian


On Sat, May 4, 2013 at 8:01 AM, ?manu*  wrote:

> I suddenly realized that my server is no more sending email notifications
> when an internal error occurs. I'm not sure which could be the modification
> that caused this behavior. I have the following information:
>
> 1. on internal errors the server gives an error not founding template file
> 500.html.
>
> 2. if I put my 500.html template then django does not complain anymore,
> shows the page but does not send the email message.
>
> 3. from manage.py shell the command django.core.mail.mail_admins works
> fine (email arrives to the admins)
>
> Any clue?
>
> Thanks,
> E.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>



-- 
Ian

http://www.ianlewis.org/

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Django - Query

2013-05-04 Thread Hélio Miranda
That was it, but now I'm the problem is that, I wonder if there is a movie 
on BD, but there insert.
I am trying as follows, but I do not get:

And it gives me the following error: Movie matching query does not exist.
The film is not clear ...
Does anyone know what I'm doing wrong?

Código (Python):
if Movie.objects.get(MovieTitle='Avatar').exists():
reportMovie.MovieTitle = 'Avatar'
reportMovie.MovieTitlePT = line["Movie Name (PT)"]
reportMovie.save()

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




internal server error not sending message notification

2013-05-04 Thread ?manu*
I suddenly realized that my server is no more sending email notifications 
when an internal error occurs. I'm not sure which could be the modification 
that caused this behavior. I have the following information:

1. on internal errors the server gives an error not founding template file 
500.html.

2. if I put my 500.html template then django does not complain anymore, 
shows the page but does not send the email message.

3. from manage.py shell the command django.core.mail.mail_admins works fine 
(email arrives to the admins)

Any clue?

Thanks,
E.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: FW:

2013-05-04 Thread Ian Foote
Sorry for this everyone. My password wasn't strong enough. I've updated 
it now.


Ian

On 04/05/13 03:36, Kurtis Mullins wrote:

Phishing Web Site (SPAM)


On Sat, Apr 6, 2013 at 9:10 PM, Ian Foote > wrote:

Snip

--
You received this message because you are subscribed to the Google
Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it,
send an email to django-users+unsubscr...@googlegroups.com
.
To post to this group, send email to django-users@googlegroups.com
.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.



--
You received this message because you are subscribed to the Google
Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




pass an element from query to template

2013-05-04 Thread Yulia Shutupandskate
 

I have a list of tags, and for each element in this list I want to count 
number of questions, which are related to tags as many-to-many.

> def localhost(request):
> tag_list = Tag.objects.all()
>
> #size = Question.objects.filter(tags__pk=tag.pk).count()
>
> return render_to_response('localhost.html',
>   {#'size': size, 
> 'tag_list': tag_list,},
>   context_instance=RequestContext(request))
>
> The problem is I don't know how to get "tag" to write "tag.pk" in query. 
But "tag.pk" is defined in template inside the loop for. How can I take it 
from there? 

> {%for tag in tag_list %} 
>
> {{tag.pk}} {{ size }}  
>
> {% endfor %}   
>
> I tried to make another loop in views but of course it failed, because 
they were separate from each other.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




how can i remove djangos Django filter lookup function" __search" defalt sql attribute "IN BOOLEAN MODE "

2013-05-04 Thread rohit verma
i am using search method in django to fetch data

hname_result = models.Hotel.objects.filter(name__search=hname)
its sql equivalen is

   select name from table where MATCH(name)AGAINST ('value' IN BOOLEAN MODE 
) 

but i want 
select name from table where MATCH(name)AGAINST ('value'  ) 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.