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

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

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

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

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

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

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

Re: HttpResponseRedirect and encoding

2009-08-05 Thread alecs
-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\

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"

Re: HttpResponseRedirect and encoding

2009-08-05 Thread alecs
://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"

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

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',

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))

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

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

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

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

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

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: ,

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

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

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

.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

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

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

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

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?

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

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

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

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

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

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.

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

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:

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

'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']

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.

Re: File Upload : Memory consumption

2009-06-24 Thread alecs
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: >

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... --~--~-~--~~~---~--~~

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

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