Re: captcha problem

2006-10-31 Thread Dirk Eschler

Am Dienstag, 31. Oktober 2006 16:11 schrieb Grigory Fateyev:
> Hello Dirk Eschler!
>
> On Tue, 31 Oct 2006 15:32:03 +0100 you wrote:
> > > urlpatterns = patterns('anastas.apps.captcha.views',
> > > (r'^i/$', 'image'),
> > > (r'^json/$', 'json'),
> > > )
>
> This is like mine.
>
> > Uh wait, only the image is broken in this case.
> >
> > Another thing to check, does pycaptcha write anything to your tmp
> > dir? By default it seems to create the temporary image
> > at /tmp/pycaptcha_1.
> >
> >>> tempfile.gettempdir()
>
> '/tmp/.private/greg'
>
> # ls -la /tmp/.private/greg/py*
> -rw-r--r--  1 greg greg 12288 ïËÔ 30
> 18:36 /tmp/.private/greg/pycaptcha_1
>
> It is right?

Looks good, so the pycaptcha is creating the file. I have no idea what to 
check next, don't see anything wrong in your code.

-- 
Dirk Eschler 
http://www.krusader.org

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: captcha problem

2006-10-31 Thread Dirk Eschler

Am Dienstag, 31. Oktober 2006 15:20 schrieb Dirk Eschler:
> In this case i would expect a TemplateSyntaxError. Since you don't get one,
> i suppose it is loaded.
>
> I tried to reproduce your error: i get empty captcha_* values when my
> captcha/urls.py is wrong. Judging from the code you have posted, i think it
> should look like:
>
> urlpatterns = patterns('anastas.apps.captcha.views',
> (r'^i/$', 'image'),
> (r'^json/$', 'json'),
> )

Uh wait, only the image is broken in this case.

Another thing to check, does pycaptcha write anything to your tmp dir? By 
default it seems to create the temporary image at /tmp/pycaptcha_1.

-- 
Dirk Eschler 
http://www.krusader.org

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: captcha problem

2006-10-31 Thread Grigory Fateyev

Hello Dirk Eschler!
On Tue, 31 Oct 2006 15:32:03 +0100 you wrote:

> > urlpatterns = patterns('anastas.apps.captcha.views',
> > (r'^i/$', 'image'),
> > (r'^json/$', 'json'),
> > )
This is like mine.
 
> Uh wait, only the image is broken in this case.
> 
> Another thing to check, does pycaptcha write anything to your tmp
> dir? By default it seems to create the temporary image
> at /tmp/pycaptcha_1.

>>> tempfile.gettempdir()
'/tmp/.private/greg'

# ls -la /tmp/.private/greg/py*
-rw-r--r--  1 greg greg 12288 ïËÔ 30
18:36 /tmp/.private/greg/pycaptcha_1

It is right?

-- 
÷ÓÅÇÏ ÎÁÉÌÕÞÛÅÇÏ! çÒÉÇÏÒÉÊ
greg [at] anastasia [dot] ru
ðÉÓØÍÏ ÏÔÐÒÁ×ÌÅÎÏ: 2006/10/31 18:07

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: captcha problem

2006-10-31 Thread Dirk Eschler

Am Dienstag, 31. Oktober 2006 14:24 schrieb Grigory Fateyev:
> Hello Aidas Bendoraitis!
>
> On Tue, 31 Oct 2006 12:11:00 +0100 you wrote:
> > Maybe your captcha template tag is not loaded? Did you put it in the
> > right place?
>
> Thanks for replay!
>
> I am sure templsate is in the right place:
> anastas/
> apps/
> captcha/
> templatetags/
> captcha.py
> urls.py
> utils.py
> views.py
>
> How to check if it load?

In this case i would expect a TemplateSyntaxError. Since you don't get one, i 
suppose it is loaded.

I tried to reproduce your error: i get empty captcha_* values when my 
captcha/urls.py is wrong. Judging from the code you have posted, i think it 
should look like:

urlpatterns = patterns('anastas.apps.captcha.views',
(r'^i/$', 'image'),
(r'^json/$', 'json'),
)

-- 
Dirk Eschler 
http://www.krusader.org

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: captcha problem

2006-10-31 Thread Grigory Fateyev

Hello Aidas Bendoraitis!
On Tue, 31 Oct 2006 12:11:00 +0100 you wrote:

> Maybe your captcha template tag is not loaded? Did you put it in the
> right place?

Thanks for replay!

I am sure templsate is in the right place:
anastas/
apps/
captcha/
templatetags/
captcha.py
urls.py
utils.py
views.py

How to check if it load?

-- 
÷ÓÅÇÏ ÎÁÉÌÕÞÛÅÇÏ! çÒÉÇÏÒÉÊ
greg [at] anastasia [dot] ru
ðÉÓØÍÏ ÏÔÐÒÁ×ÌÅÎÏ: 2006/10/31 16:19

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: captcha problem

2006-10-31 Thread Aidas Bendoraitis
Maybe your captcha template tag is not loaded? Did you put it in the
right place?

Regards,
Aidas Bendoraitis aka Archatas


On 10/31/06, Grigory Fateyev <[EMAIL PROTECTED]> wrote:
>
> Hello Grigory Fateyev!
> On Mon, 30 Oct 2006 21:30:01 +0300 you wrote:
>
> > Why it can be, and how to fix it?
>
> Please, any suggestions?
>
> --
> ÷ÓÅÇÏ ÎÁÉÌÕÞÛÅÇÏ! çÒÉÇÏÒÉÊ
> greg [at] anastasia [dot] ru
> ðÉÓØÍÏ ÏÔÐÒÁ×ÌÅÎÏ: 2006/10/31 13:06
>
> >
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: captcha problem

2006-10-31 Thread Grigory Fateyev

Hello Grigory Fateyev!
On Mon, 30 Oct 2006 21:30:01 +0300 you wrote:

> Why it can be, and how to fix it?

Please, any suggestions?

-- 
Всего наилучшего! Григорий
greg [at] anastasia [dot] ru
Письмо отправлено: 2006/10/31 13:06

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



captcha problem

2006-10-30 Thread Grigory Fateyev

Hello!

I want to use captcha protection for any app, and I do:

### urls.py
(r'^captcha/', include('anastas.apps.captcha.urls')),

### anastas.apps.articles.urls.py 
(r'^create/$', 'anastas.apps.captcha.views.verify',
dict(forward_to='anastas.apps.a rticles.views.create_article')),

### anastas.apps.articles.views.py
def create_article(request, captcha_error):
manipulator = Article.AddManipulator()
if not request.user.is_anonymous():
if request.POST:
new_data = request.POST.copy()
new_data['author'] = str(request.user.id)
new_data['publish'] = '0'
errors = manipulator.get_validation_errors(new_data)
if captcha_error:
errors['captcha_word'] = captcha_error
if not errors:
manipulator.do_html2python(new_data)
manipulator.save(new_data)
return HttpResponseRedirect("/news/")
else:
errors = new_data = {}

form = forms.FormWrapper(manipulator, new_data, errors)
return render_to_response('articles/article_form.html', {
'form': form,
}, context_instance=RequestContext(request))

### temlate
{% load captcha %}
{% captcha %}

[...]
  

  
{% trans "Please enter the word you see in the picture" %}
   


but all {{ captcha_* }} shows empty:
  

  
Please enter the word you see in the picture


   
  

Why it can be, and how to fix it?

Thanks.

-- 
÷ÓÅÇÏ ÎÁÉÌÕÞÛÅÇÏ! çÒÉÇÏÒÉÊ
greg [at] anastasia [dot] ru
ðÉÓØÍÏ ÏÔÐÒÁ×ÌÅÎÏ: 2006/10/30 20:57

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---