How to switch L10N off in django

2010-10-24 Thread alecs
LANGUAGE_CODE = 'ru-RU'

USE_I18N = True

# If you set this to False, Django will not format dates, numbers and
# calendars according to the current locale
USE_L10N = False
{{ post.date_added|date:"b" }} gives "окт" in templates.

If I set USE_I18N = False then it gives oct as it should be. Is this a
bug ? How can I solve this problem ? Are there any possibilities to
disable USE_I18N in template (in part of it) ?

-- 
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...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Signal : send a parameter to a receiver function

2010-04-14 Thread alecs
Thanks :)

-- 
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...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Signal : send a parameter to a receiver function

2010-04-14 Thread alecs
How can I send a parameter to a receiver function ? This is wrong :
signals.post_save.connect(receiver=refresh_index_page(fragment_name="categories_index",
sender=Post)

I have avoided this problem by wrapping my function in another
function, but a bit inconvenient :)

def refresh_index_page(sender, *args, **kwargs):
invalidate_template_cache(fragment_name="categories_index", *args,
**kwargs)

signals.post_save.connect(receiver=refresh_index_page, sender=Post)

-- 
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...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Send variable from view function to a templatetag

2010-03-03 Thread alecs
How can I send variable from my view function(which renders my
template) to a template tag library(which is {% load blah %} in this
template? I want to make my tag cloud independent from model:

register = Library()

@register.inclusion_tag("tags/cloud.html")
def tag_cloud(request):
"""Takes model and tag from context and returns cloud as a
response."""
tag_list = Tag.objects.cloud_for_model(HARD_CODED_MODEL, steps=9,
distribution =
tagging.utils.LOGARITHMIC,filters={'removed':False})
return {'tags' : tag_list}

Thanks :)

-- 
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...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: translation issue

2009-08-12 Thread alecs

Thanks :)) Sorry, a silly question :)
--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



translation issue

2009-08-12 Thread alecs

from django.utils.translation import ugettext as _
raise forms.ValidationError(_('%(email)s is not a valid e-mail
address.' %  {'email': email}))

#: helpers.py:30
#, python-format
msgid "%(email)s is not a valid e-mail address."
msgstr "%(email)s не верный формат e-mail адреса."

Everything works OK but this line is not ranslated. Why? Maybe newbie
question :)) Thanks :)
--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: HttpResponseRedirect and encoding

2009-08-05 Thread alecs

Ticket #11638 ...
--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: HttpResponseRedirect and encoding

2009-08-05 Thread alecs

After jumping to sqlite Internal Server Error is not raised, just

Environment:

Request Method: GET
Request URL: 
http://172.16.23.33/file/2840e589359de657b7275adcb60d4fbea6472e2a7746b3c9d451cb4b
Django Version: 1.1
Python Version: 2.6.2
Installed Applications:
['django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.admin',
 'filez.filezupload',
 'debug_toolbar']
Installed Middleware:
('firepy.django.middleware.FirePHPMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware')


Traceback:
File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/
base.py" in get_response
  92. response = callback(request, *callback_args,
**callback_kwargs)
File "/usr/local/lib/python2.6/dist-packages/django/contrib/auth/
decorators.py" in __call__
  78. return self.view_func(request, *args, **kwargs)
File "/var/www/filez/filezupload/views.py" in send_file
  260. return HttpResponseRedirect(path)
File "/usr/local/lib/python2.6/dist-packages/django/http/__init__.py"
in __init__
  407. self['Location'] = redirect_to
File "/usr/local/lib/python2.6/dist-packages/django/http/__init__.py"
in __setitem__
  320. header, value = self._convert_to_ascii(header, value)
File "/usr/local/lib/python2.6/dist-packages/django/http/__init__.py"
in _convert_to_ascii
  309. value = value.encode('us-ascii')

Exception Type: UnicodeEncodeError at /file/
2840e589359de657b7275adcb60d4fbea6472e2a7746b3c9d451cb4b
Exception Value: ('ascii', u"/site_media/upload/alecs/
\u0413\u0438\u0444\u0442,\u0414\u0436\u043e\u043d\u0441 - Python
\u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u043c
\u0430\u0434\u043c\u0438\u043d
\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d
\u0438\u0438.2009'.djvu", 25, 29, 'ordinal not in range(128)')


So I shall try to open a ticket ?
--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: HttpResponseRedirect and encoding

2009-08-05 Thread alecs

The problem happens when django is trying to path.encode('us-
ascii') ...
What can be the reason and how to prepare string to be successfully
processed ?
--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: HttpResponseRedirect and encoding

2009-08-05 Thread alecs

Sorry :(

return HttpResponseRedirect(path) brings  Internal Server Error:


cat /var/log/apache2/error.log

[Wed Aug 05 11:31:30 2009] [error] [client 172.16.23.33] mod_wsgi
(pid=6118): Exception occurred processing WSGI script '/var/www/filez/
apache/apache_django.wsgi'., referer: http://172.16.23.33/alecs/
[Wed Aug 05 11:31:30 2009] [error] [client 172.16.23.33] Traceback
(most recent call last):, referer: http://172.16.23.33/alecs/
[Wed Aug 05 11:31:30 2009] [error] [client 172.16.23.33]   File "/usr/
share/python-support/python-django/django/core/handlers/wsgi.py", line
246, in __call__, referer: http://172.16.23.33/alecs/
[Wed Aug 05 11:31:30 2009] [error] [client 172.16.23.33] response
= self.apply_response_fixes(request, response), referer: 
http://172.16.23.33/alecs/
[Wed Aug 05 11:31:30 2009] [error] [client 172.16.23.33]   File "/usr/
share/python-support/python-django/django/core/handlers/base.py", line
179, in apply_response_fixes, referer: http://172.16.23.33/alecs/
[Wed Aug 05 11:31:30 2009] [error] [client 172.16.23.33] response
= func(request, response), referer: http://172.16.23.33/alecs/
[Wed Aug 05 11:31:30 2009] [error] [client 172.16.23.33]   File "/usr/
share/python-support/python-django/django/http/utils.py", line 20, in
fix_location_header, referer: http://172.16.23.33/alecs/
[Wed Aug 05 11:31:30 2009] [error] [client 172.16.23.33] response
['Location'] = request.build_absolute_uri(response['Location']),
referer: http://172.16.23.33/alecs/
[Wed Aug 05 11:31:30 2009] [error] [client 172.16.23.33]   File "/usr/
share/python-support/python-django/django/http/__init__.py", line 74,
in build_absolute_uri, referer: http://172.16.23.33/alecs/
[Wed Aug 05 11:31:30 2009] [error] [client 172.16.23.33] location
= urljoin(current_uri, location), referer: http://172.16.23.33/alecs/
[Wed Aug 05 11:31:30 2009] [error] [client 172.16.23.33]   File "/usr/
lib/python2.6/urlparse.py", line 219, in urljoin, referer:
http://172.16.23.33/alecs/
[Wed Aug 05 11:31:30 2009] [error] [client 172.16.23.33] params,
query, fragment)), referer: http://172.16.23.33/alecs/
[Wed Aug 05 11:31:30 2009] [error] [client 172.16.23.33]   File "/usr/
lib/python2.6/urlparse.py", line 184, in urlunparse, referer:
http://172.16.23.33/alecs/
[Wed Aug 05 11:31:30 2009] [error] [client 172.16.23.33] return
urlunsplit((scheme, netloc, url, query, fragment)), referer:
http://172.16.23.33/alecs/
[Wed Aug 05 11:31:30 2009] [error] [client 172.16.23.33]   File "/usr/
lib/python2.6/urlparse.py", line 190, in urlunsplit, referer:
http://172.16.23.33/alecs/
[Wed Aug 05 11:31:30 2009] [error] [client 172.16.23.33] url =
'//' + (netloc or '') + url, referer: http://172.16.23.33/alecs/
[Wed Aug 05 11:31:30 2009] [error] [client 172.16.23.33]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xd0 in position
18: ordinal not in range(128), referer: http://172.16.23.33/alecs/


if I set return HttpResponseRedirect(path.encode('utf8')) then I'm
getting:

Environment:

Request Method: GET
Request URL: 
http://172.16.23.33/file/f5c27ee3982ebf701793038d22c72980d64793f566cb0ac10269ee0b
Django Version: 1.0.3
Python Version: 2.6.2
Installed Applications:
['django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.admin',
 'filez.filezupload',
 'debug_toolbar']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware')


Traceback:
File "/usr/share/python-support/python-django/django/core/handlers/
base.py" in get_response
  91. response = callback(request, *callback_args,
**callback_kwargs)
File "/usr/share/python-support/python-django/django/contrib/auth/
decorators.py" in __call__
  78. return self.view_func(request, *args, **kwargs)
File "/var/www/filez/filezupload/views.py" in send_file
  256. return HttpResponseRedirect(path.encode('utf8'))

Exception Type: UnicodeDecodeError at /file/
f5c27ee3982ebf701793038d22c72980d64793f566cb0ac10269ee0b
Exception Value: ('ascii', '/var/upload/alecs/\xd0\xa6\xd0\xb5\xd0\xbb
\xd0\xb5\xd0\xb2\xd1\x8b\xd0\xb5 \xd0\xbf\xd0\xbe\xd0\xba
\xd0\xb0\xd0\xb7\xd0\xb0\xd1\x82\xd0\xb5\xd0\xbb\xd0\xb8
\xd0\xb4\xd0\xb5\xd1\x8f\xd1\x82\xd0\xb5\xd0\xbb\xd1\x8c\xd0\xbd
\xd0\xbe\xd1\x81\xd1\x82\xd0\xb8 \xd0\xbd\xd0\xb0 2008 \xd0\xb3\xd0\xbe
\xd0\xb4.jpg', 18, 19, 'ordinal not in range(128)')



--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



HttpResponseRedirect and encoding

2009-08-05 Thread alecs

I'm trying to download via GET a file with name in russian and getting
Internal Server Error:

upfile = UpFile.objects.get(file_hash=file_hash)
path = os.path.join(settings.UPLOAD_ROOT, request.user.username,
upfile.file_name)
return HttpResponseRedirect(path.decode('utf8'))

If filename in English everything works ok.
The file was uploaded this way:

dir_path = os.path.join(settings.UPLOAD_ROOT, request.user.username)
upfile = UpFile.objects.create(user=user, file_name=file.name,
file_hash=file_hash,
file_content_type=file.content_type,file_path=file_path,
file_url=file_url, file_size=file.size)
path = '%s/%s' % (dir_path, file.name)
destination = open(path.encode('utf8'), 'wb+')
for chunk in file.chunks():
destination.write(chunk)
destination.close()

The encoding of mysql is utf8_bin.

The name of the file is correctly readable in my system(ls -lh):
locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

Can someone help ? Thanks ...
--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: encoding problem

2009-07-31 Thread alecs

Environment:

Request Method: GET
Request URL: 
http://172.16.23.33/file/4719e0bdedaa4f741f032991894d52ecb08c3476a598504fd1fee92d
Django Version: 1.0.3
Python Version: 2.6.2
Installed Applications:
['django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.admin',
 'filez.filezupload',
 'debug_toolbar']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware')


Traceback:
File "/usr/share/python-support/python-django/django/core/handlers/
base.py" in get_response
  91. response = callback(request, *callback_args,
**callback_kwargs)
File "/usr/share/python-support/python-django/django/contrib/auth/
decorators.py" in __call__
  78. return self.view_func(request, *args, **kwargs)
File "/var/www/filez/filezupload/views.py" in send_file
  253. content_disp = u'attachment; filename="%s" ' %
upfile.file_name

Exception Type: UnicodeDecodeError at /file/
4719e0bdedaa4f741f032991894d52ecb08c3476a598504fd1fee92d
Exception Value: ('ascii', '\xd0\x9d
\xd0\xb0\xd1\x81\xd1\x82\xd1\x80\xd0\xbe\xd0\xb9\xd0\xba\xd0\xb0
\xd0\xbf\xd0\xbe\xd1\x87\xd1\x82\xd1\x8b.doc', 0, 1, 'ordinal not in
range(128)')


If I do upfile.file_name.decode('utf8').encode('cp1251') it works in
IE ...
--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



encoding problem

2009-07-31 Thread alecs

I'm sending a file to user:

upfile = UpFile.objects.get(file_hash=request.path[6:])
user = get_object_or_404(User, username=request.user.username)
down_file_log = DownFile.objects.create(user_id=user,
file_id=upfile)
wrapper = FileWrapper(file(upfile.file_path))
response = HttpResponse(wrapper)
response['Content-Length'] = os.path.getsize(upfile.file_path)
response['Content-Type'] = upfile.file_content_type + ';
charset=utf8'
response['Content-Disposition'] = 'attachment; filename=\"' +
upfile.file_name + '\"'
return response

Mysql database encoding is utf8_bin.
The problem is in the filename: everything works OK with English, but
if the file_name is in Russian then in IE6 it's horrible and unreadable
(when you press on file link and download window appears) :(( But in
Firefox && Opera it's OK :((
Any suggestions ?
--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



encoding question

2009-07-29 Thread alecs


 filename = smart_unicode(file.name, encoding='cp1251',
strings_only=False, errors='strict')

destination = open('%s/%s' % (dir_path, filename), 'wb+')

 UnicodeEncodeError ('ascii', u'1.3.1.\u0421\u043b.\u041f
\u0435\u0440\u0435\u043d\u043e\u0441 \u043e\u0442\u043f
\u0443\u0441\u043a\u0430.doc', 6, 8, 'ordinal not in range(128)')

What to do ? Thanks!
--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Admin: adding user with profile

2009-07-20 Thread alecs

Hi all :) A small problem when trying to add a new user via admin web
interface:
Fields from UserProfile can be found on the edit user page (at the
bottom of it) and they are filled with default values, but if I'm
adding a new user  and press 'Save' they are not actually added to
myapp_userprofile table. :(
If I change them from default values and press 'Save' button they will
be added.
How to fix ? Thanks :)

admin.py

class UserProfileInline(admin.TabularInline):
model = UserProfile

class UserWithProfile(UserAdmin):
inlines = [UserProfileInline]

admin.site.unregister(User)
admin.site.register(User, UserWithProfile)

models.py

class UserProfile(models.Model):
max_folder_size = models.IntegerField(max_length=15,
default=104857600)
max_file_size = models.IntegerField(max_length=15,
default=52428800)
user = models.ForeignKey(User, unique=True)

--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Firefox doesn't receive response

2009-07-16 Thread alecs

After switching OFF firepy (!!!) everything works OK.
It seems to me that it's a firephp addon bug when it receives great
array of data.
--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Firefox doesn't receive response

2009-07-15 Thread alecs

I have faced with interesting issue: I have some views which process
files (deleting them recursively or saving many files). When I upload
or delete many files response is not received by firefox ... I just
press "Upload files" (sumbit upload form) button, and nothing happens
with this page (but it should render return render_to_response
('success.html', variables)). But the files are saved (or deleted),
i.e. view woks, but response is 'lost'.
Everything works ok in Safari, IE6&8, Opera 10b1, but not in Firefox
2&3

Any advices ? :)
--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: MultiFileWidget

2009-07-15 Thread alecs

 for file in request.FILES.getlist('file'):

Topic is closed :)
--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



MultiFileWidget

2009-07-15 Thread alecs

Hi! I'm trying to use http://www.djangosnippets.org/snippets/583/ and
getting an error 'str' object has no attribute 'name'.
It happens on this line:

logging.debug(request.FILES)
for file in request.FILES['file']:
filename = file.name

Using firepy ( logging.debug) I see this dictionary:

, ]}>

So what is wrong ? And why 'str' ?
Maybe it's a silly question, but I'm a newbie :)

--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: .views._CheckLogin.__call__ didn't return an HttpResponse object

2009-07-14 Thread alecs

Thanks. I thought this called view will do render_to_response ...
--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: .views._CheckLogin.__call__ didn't return an HttpResponse object

2009-07-14 Thread alecs

Ok, a simple question:
Are there any possibilities to call from current view another view.
For instance you have a large view and in the middle of it you need to
perform THE SAME actions which are already defined in def foo
(request,username).
Of course, you can copy the contents of foo(request,username) view
into your big view, but I don't think it's a correct solution.
--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: .views._CheckLogin.__call__ didn't return an HttpResponse object

2009-07-14 Thread alecs

I'm just calling another view mail_to_user(request,username,dummy) ,
which contains render_to_response!
--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



.views._CheckLogin.__call__ didn't return an HttpResponse object

2009-07-14 Thread alecs

Hi all :) Can u help me with .views._CheckLogin.__call__ didn't return
an HttpResponse object . I'm trying from my view 'jump' to another
view by calling mail_to_user(request,username,dummy)   The
mail_to_user view contains render_to_response and if I simply copy the
contents of mail_to_user into main view everything works OK. But I
think it's better to call another view than to copy a whole conent.
What can be wrong ?
--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Local admin site

2009-07-13 Thread alecs

It was a firefox+firebug issue. Firefox 3.0.11+firebug 1.3.3 Opera
opens this page ok :(
--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: submit form

2009-07-12 Thread alecs

Thanks, Dennis :)
--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



submit form

2009-07-11 Thread alecs

Hi! I think it's more web development question than django question,
but hope someone can advice me.
I have a table with checkboxes. Each  contains different
information about files (filename, filesize, url, etc).
Below this table I have three(or maybe more) buttons to perform
different actions with selected (using checkbox) files : delete them,
send by email and so on. So can you recommend me how to be with
buttons? Use jquery and submit form and add to post something like
button name? Are there any better ways? Thanks :)
--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Local admin site

2009-07-09 Thread alecs

Sorry for flooding.
It's an interesting behaviour of django: If I'm adding user
(user,password,confirm password) and press 'Save and continue editing'
it creates user(!) , but then nothing happens(I expect something like
a large form with email etc.) Maybe something with templates?
--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Local admin site

2009-07-09 Thread alecs

Ok, dropped database and recreated it using syncdb, added superuser.
The same thing - can't edit users :((
--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Local admin site

2009-07-09 Thread alecs

I'm superuser ...
--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Local admin site

2009-07-09 Thread alecs

I'm able to add groups and edit groups, sites, can add user(user)
but can't change it.
--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Local admin site

2009-07-09 Thread alecs

error.log is clear... neither happens in firebug ...
--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Local admin site

2009-07-09 Thread alecs

Hi! Can you help me with admin web ui: I'm on page 
http://172.16.23.33/admin/auth/user/
and I can't change user details - when I click on user nothing
happens. Though I'm able to add user ...

access.log of my apache

tail -f access.log
172.16.23.33 - - [09/Jul/2009:13:00:12 +0300] "GET /admin/auth/user/2/
HTTP/1.1" 200 2643 "http://172.16.23.33/admin/auth/user/; "Mozilla/5.0
(X11; U; Linux x86_64; en-US; rv:1.9.0.11) Gecko/2009060309 Ubuntu/
9.04 (jaunty) Firefox/3.0.11"
172.16.23.33 - - [09/Jul/2009:13:00:13 +0300] "GET /admin/auth/user/2/
HTTP/1.1" 200 2643 "http://172.16.23.33/admin/auth/user/; "Mozilla/5.0
(X11; U; Linux x86_64; en-US; rv:1.9.0.11) Gecko/2009060309 Ubuntu/
9.04 (jaunty) Firefox/3.0.11"
172.16.23.33 - - [09/Jul/2009:13:00:14 +0300] "GET /admin/auth/user/2/
HTTP/1.1" 200 2643 "http://172.16.23.33/admin/auth/user/; "Mozilla/5.0
(X11; U; Linux x86_64; en-US; rv:1.9.0.11) Gecko/2009060309 Ubuntu/
9.04 (jaunty) Firefox/3.0.11"
172.16.23.33 - - [09/Jul/2009:13:00:17 +0300] "GET /admin/auth/user/1/
HTTP/1.1" 200 2624 "http://172.16.23.33/admin/auth/user/; "Mozilla/5.0
(X11; U; Linux x86_64; en-US; rv:1.9.0.11) Gecko/2009060309 Ubuntu/
9.04 (jaunty) Firefox/3.0.11"
172.16.23.33 - - [09/Jul/2009:13:00:18 +0300] "GET /admin/auth/user/1/
HTTP/1.1" 200 2624 "http://172.16.23.33/admin/auth/user/; "Mozilla/5.0
(X11; U; Linux x86_64; en-US; rv:1.9.0.11) Gecko/2009060309 Ubuntu/
9.04 (jaunty) Firefox/3.0.11"
172.16.23.33 - - [09/Jul/2009:13:07:38 +0300] "GET /admin/auth/user/1/
HTTP/1.1" 200 2624 "http://172.16.23.33/admin/auth/user/; "Mozilla/5.0
(X11; U; Linux x86_64; en-US; rv:1.9.0.11) Gecko/2009060309 Ubuntu/
9.04 (jaunty) Firefox/3.0.11"
172.16.23.33 - - [09/Jul/2009:13:12:10 +0300] "GET /admin/auth/user/
add/ HTTP/1.1" 200 1114 "http://172.16.23.33/admin/auth/user/;
"Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.11) Gecko/
2009060309 Ubuntu/9.04 (jaunty) Firefox/3.0.11"
172.16.23.33 - - [09/Jul/2009:13:12:10 +0300] "GET /admin/jsi18n/ HTTP/
1.1" 200 803 "http://172.16.23.33/admin/auth/user/add/; "Mozilla/5.0
(X11; U; Linux x86_64; en-US; rv:1.9.0.11) Gecko/2009060309 Ubuntu/
9.04 (jaunty) Firefox/3.0.11"
172.16.23.33 - - [09/Jul/2009:13:12:27 +0300] "GET /admin/auth/user/1/
HTTP/1.1" 200 2624 "http://172.16.23.33/admin/auth/user/; "Mozilla/5.0
(X11; U; Linux x86_64; en-US; rv:1.9.0.11) Gecko/2009060309 Ubuntu/
9.04 (jaunty) Firefox/3.0.11"
172.16.23.33 - - [09/Jul/2009:13:12:28 +0300] "GET /admin/auth/user/2/
HTTP/1.1" 200 2643 "http://172.16.23.33/admin/auth/user/; "Mozilla/5.0
(X11; U; Linux x86_64; en-US; rv:1.9.0.11) Gecko/2009060309 Ubuntu/
9.04 (jaunty) Firefox/3.0.11"
--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: 'unicode' object has no attribute 'user' when sending e-mail

2009-07-07 Thread alecs

Shit! Great thanks, Tracey! You are absolutely right! I've made a
stupid mistake even for a beginner!
I redifined send_mail in my app :((
Thanks!
--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: 'unicode' object has no attribute 'user' when sending e-mail

2009-07-07 Thread alecs

Environment:

Request Method: POST
Request URL: http://172.16.23.33/alex/urlsend/
Django Version: 1.0.2 final
Python Version: 2.6.2
Installed Applications:
['django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'filez.filezupload']
Installed Middleware:
('firepy.django.middleware.FirePHPMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware')


Traceback:
File "/usr/lib/pymodules/python2.6/django/core/handlers/base.py" in
get_response
  86. response = callback(request, *callback_args,
**callback_kwargs)
File "/usr/lib/pymodules/python2.6/django/contrib/auth/decorators.py"
in __call__
  67. return self.view_func(request, *args, **kwargs)
File "/var/www/filez/filezupload/views.py" in urlsend
  186. auth_user = 'u...@exmpl.com', auth_password =
'gfhjkm_')
File "/usr/lib/pymodules/python2.6/django/contrib/auth/decorators.py"
in __call__
  66. if self.test_func(request.user):

Exception Type: AttributeError at /alex/urlsend/
Exception Value: 'unicode' object has no attribute 'user'

If comment out send_mail everythin works ok.

--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: 'unicode' object has no attribute 'user' when sending e-mail

2009-07-07 Thread alecs

I've found a response for a similar problem:
"Seems that the session middleware not active. It should append the
user object
to the request object."
But can't understand how to solve the problem...
Actually I'm getting to a page from which I'm sending a e-mail via
GET:
http://172.16.23.33/alex/send_mail/?fileurl=http://172.16.23.33/file/88165c9e3683b65c594dce33b4c3b2f48096ccaa7f65f68cc67cbb5a
Maybe it's an important moment ?
--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: 'unicode' object has no attribute 'user' when sending e-mail

2009-07-07 Thread alecs

Tried to embrace in [] - no effect ...
http://pastebin.com/m6437076d
--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



'unicode' object has no attribute 'user' when sending e-mail

2009-07-07 Thread alecs

I'm trying to send a e-mail, but getting this error. Don't know what
to do... Any ideas?
Thanks in advance.

def urlsend(request, username):
if request.method == 'POST':
form = SendMailForm(request.POST)
if form.is_valid():
subject = form.cleaned_data['subject']
message = form.cleaned_data['message']
to_email = form.cleaned_data['to_email']
try:
send_mail(subject, message, 'u...@exmpl.com',
to_email, fail_silently = False,
auth_user = 'u...@exmpl.com', auth_password =
'pass')
except Exception, e:
raise ValueError,e
return HttpResponseRedirect('/'+username+'/')
else:
sendMail = SendMailForm(request.POST)
variables = RequestContext(request, {
'username': username,
'form' : form,
})
return render_to_response('send_mail.html', variables)
return HttpResponseRedirect('/'+username+'/')
else:
return HttpResponseRedirect('/'+username+'/')
--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Redirect to html file

2009-06-29 Thread alecs

Hi! If I have some html file somewhere (i.e. /var/file), how to
redirect user to it? It is not a template and not in a template
folder. Thanks :)

--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: File Upload : Memory consumption

2009-06-24 Thread alecs

If to be honest I can't google this posts ... Most of the links are
for patches or for old django versions :(
Don't know, maybe I should try to set FILE_UPLOAD_MAX_MEMORY_SIZE, but
I didn't change it , so the default value is 2.5Mb ...

On Jun 24, 2:54 pm, John M <retireonc...@gmail.com> wrote:
> I've seen quite a few posts on this, and I think it's documented as
> well.
>
> As I recall, there is a certain way of doing large uploads, search the
> docs and the forum and I'm sure you'll find it.
>
> On Jun 24, 3:20 am, alecs <alecs@gmail.com> wrote:
>
> > Hi! I'm trying to upload a large file (700Mb) and something wrong with
> > django happens: First it starts caching enormously (4Gb of ram are
> > used), than it starts to purge caches and starts swapping (1Gb of swap
> > is used).
> > Have you ever faced with such a thing ? Django 1.02, mod_wsgi + Apache
> > 2.2
> > Thanks :)
--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: File Upload : Memory consumption

2009-06-24 Thread alecs

The maximum size, in bytes, for files that will be uploaded into
memory. Files larger than FILE_UPLOAD_MAX_MEMORY_SIZE will be streamed
to disk.
Defaults to 2.5 megabytes.

My file size is greater than 2.5Mb, so it will be streamed to disk...
--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



File Upload : Memory consumption

2009-06-24 Thread alecs

Hi! I'm trying to upload a large file (700Mb) and something wrong with
django happens: First it starts caching enormously (4Gb of ram are
used), than it starts to purge caches and starts swapping (1Gb of swap
is used).
Have you ever faced with such a thing ? Django 1.02, mod_wsgi + Apache
2.2
Thanks :)

--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



File upload over

2009-06-24 Thread alecs

Hi :) First of all I should say that I am not experienced in Django ;)

I have some problem with file Uploading - if the file is large (700Mb)
a strange thing happens with RAM :(
First it tries to cache something and all the 4Gb or Ram are captured,
than the cache is purged and it begins to swap - 1 Gb of swap is used
and so on ... I'm using Django 1.02 and apache mod_wsgi

--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---