Re: Django context translations with dynamic variables

2017-03-02 Thread Jani Tiainen
Hi, On 02.03.2017 19:43, Uri Even-Chen wrote: What if we "cheat" makemessages like this: {% if 0%}{% trans 'This user blocked you.' context 'female' %} {% trans 'This user blocked you.' context 'male' %} {% trans 'This user blocked you.' context 'other' %} {% endif %} {%trans 'This user blo

django angular

2017-03-02 Thread mohamed shawky
how to save data which it come from angular in data base -- 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 th

Pressing enter/return key does not submit the list_editable in Django admin

2017-03-02 Thread Leo Shao
I'm assuming this is because there are two submit buttons in one form and when pressing enter (while focused on an input), it submits the action (e.g. delete) rather than the list_editable. When I press enter (while focused on an 'hours' input), it reacts th

Re: How to keep track of online users?

2017-03-02 Thread Melvyn Sopacua
On Thursday 02 March 2017 14:47:30 Branko Zivanovic wrote: > I need to know online status for each user. How do I do that? from importlib import import_module from django.conf import settings from django.contrib.auth import get_user_model engine = import_module(settings.SESSION_ENGINE) # docs[1]

Re: How to keep track of online users?

2017-03-02 Thread Shawn Milochik
You actually can't, unless you're using JavaScript for something like websockets or other polling. You can only track their last activity using their session. Specifically, if a user loads one of your pages, you know it. But then you won't know whether they're still reading it hours later or they

Re: Django context translations with dynamic variables

2017-03-02 Thread Melvyn Sopacua
On Thursday 02 March 2017 20:54:07 Uri Even-Chen wrote: > > Then makemessages should generate a string with msgctxt for each of > > the choices. You could do this already, by rolling your own "trans" > > tag and "makemessages" command. > > > > > I don't understand, how can I do it already? I want

Re: Test Client response.json() UnicodeDecodeError

2017-03-02 Thread Aniruddha Maru
Running into the same issue - charset isn't correct, I think it ought to be hardcoded to `utf-8`. On Thursday, March 31, 2016 at 5:24:39 AM UTC-7, Tim Graham wrote: > > Looks reasonable, although I am not entirely clear what role charset has > in a JsonResponse. See https://code.djangoproject.co

Re: Test Client response.json() UnicodeDecodeError

2017-03-02 Thread Aniruddha Maru
Filed as https://code.djangoproject.com/ticket/27895 On Thursday, March 2, 2017 at 2:59:46 PM UTC-8, Aniruddha Maru wrote: > > Running into the same issue - charset isn't correct, I think it ought to > be hardcoded to `utf-8`. > > On Thursday, March 31, 2016 at 5:24:39 AM UTC-7, Tim Graham wrote:

How to keep track of online users?

2017-03-02 Thread Branko Zivanovic
I need to know online status for each user. How do I do that? -- 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

Custom Field Default Value Serialization

2017-03-02 Thread qilin qi
Hi All, Apologize if this question has been asked before. This is my first question into this mailing list. I am creating a custom field(MyCustomField) with a custom value class(MyValue). I do have a deconstruct() method for my *field* class. And I would like to have a default value of this fiel

Re: Advice: django deploy vps error 502

2017-03-02 Thread Antonis Christofides
350 concurrent requests for a single machine is really much. If your app is very fast (e.g. by caching stuff a lot) it might be possible, but again it might require some tuning (for example, you could increase the gunicorn workers, but you need to be monitoring RAM consumption). Do you really need

UI widget for contacting administrators

2017-03-02 Thread Branko Zivanovic
Hey Google, Is there any django app that would allow users to report bugs, or send messages instantly from my index page? I want it to be like UI widget and visitors can simply report bugs, speak their ideas or opinion. Something similar to Olark, but I don't want it to be live chat because I

Re: Django context translations with dynamic variables

2017-03-02 Thread Uri Even-Chen
> > > Then makemessages should generate a string with msgctxt for each of the > choices. You could do this already, by rolling your own "trans" tag and > "makemessages" command. > > > I don't understand, how can I do it already? I want makemessages to generate a string with all the possible context

Re: Django context translations with dynamic variables

2017-03-02 Thread Melvyn Sopacua
On Thursday 02 March 2017 19:43:07 Uri Even-Chen wrote: > Maybe this is a feature we can add to the next Django release? And > then we will not have to "cheat"? Something like this maybe: {%trans 'dancer' context_choices=gender_choices choice=request.user.gender %} Then makemessages should

Re: Advice: django deploy vps error 502

2017-03-02 Thread carlos
Hi, ok i change the uwsgi to gunicorn right now, the problem with error 502 in this moment he disappeared but the website in time it gets slow i dont now what is. this is the all syslog for today i this moments Mar 2 17:21:02 prueba gunicorn[1834]: [2017-03-02 17:21:02 +] [21405] [INFO] Booti

Re: Django context translations with dynamic variables

2017-03-02 Thread Uri Even-Chen
What if we "cheat" makemessages like this: {% if 0 %} {% trans 'This user blocked you.' context 'female' %} {% trans 'This user blocked you.' context 'male' %} {% trans 'This user blocked you.' context 'other' %} {% endif %} {% trans 'This user blocked you.' context user.gender %} (o

Re: Unique model field and case sensitivity (postgres)

2017-03-02 Thread George Orw
So if i add unique index to a column in PostgreSQL, do i need to do any other changes in the django itself ? I am asking this because, MySQL have this functionality enabled by default without creating any special methods. On Monday, December 7, 2009 at 5:33:11 PM UTC+5:30, David De La Harpe G

Re: Having trouble with Django tutorial

2017-03-02 Thread Vijay Khemlani
Did you do this step? The next step is to point the root URLconf at the polls.urls module. In mysite/urls.py, add an import for django.conf.urls.include and insert an include() in the urlpatterns list, so you have: mysite/

Re: attribute required and error XML

2017-03-02 Thread chun974
Thanks, ludovic coues, I have find the solution. I used eclipse whith django. In the setting.py I have modify (DEFAULT_CONTENT_TYPE='application/xhtml+xml') to (DEFAULT_CONTENT_TYPE='text/html'). It's OK with this. You're right!! Thanks :) ! Le mercredi 1 mars 2017 10:53:54 UTC+1, ludovic coues

Having trouble with Django tutorial

2017-03-02 Thread Yves S. Garret
Hi all, I'm going through this tutorial: https://docs.djangoproject.com/en/1.10/intro/tutorial01/ And the problem that I'm having is when I start the 'polls' application from inside my project and then go to localhost:8000/polls, I get a 404. Page not found (404) Request Method: GET Request URL

Re: Django context translations with dynamic variables

2017-03-02 Thread Jani Tiainen
Unfortunately makemessages can't guess what your context is if it's variable (I'm not sure would it even consider it as a translatable text at all) First version would guarantee you to have translatable strings with genders, latter one either generates one string (and you have to manually cre

Re: django-mongo-angularJs

2017-03-02 Thread mohamed shawky
no problem at all thanks every where -- 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 emai

Re: Django context translations with dynamic variables

2017-03-02 Thread Uri Even-Chen
Hi, I'm working with Gleb on Speedy Match [ https://github.com/urievenchen/speedy-net]. We need to translate to Hebrew according to context of the user's gender. Gleb suggested that the code will be something like this: {% if user.gender == GENDER_FEMALE %} {% trans 'This user blocked you.' c

Re: Django Migrations?

2017-03-02 Thread Melvyn Sopacua
On Thursday 02 March 2017 10:45:50 Michal Petrucha wrote: > On Wed, Mar 01, 2017 at 07:45:24PM -0500, Ed Sutherland wrote: > > The problem surrounded a textfield that had no default. I added the > > default string and migrate complained it was an int. I changed the > > string and migrate still comp

Re: django-mongo-angularJs

2017-03-02 Thread ludovic coues
Sorry, I have no experience with mongodb, I can't help you 2017-03-01 21:12 GMT+01:00 mohamed shawky : > am using mongodb which the project that i work on it deal with mongo if you > can help me thank ou in advance > > > بتاريخ الأربعاء، 1 مارس، 2017 3:43:47 م UTC+2، كتب mohamed shawky: >> >> am

Re: Django Migrations?

2017-03-02 Thread Michal Petrucha
On Wed, Mar 01, 2017 at 07:45:24PM -0500, Ed Sutherland wrote: > The problem surrounded a textfield that had no default. I added the > default string and migrate complained it was an int. I changed the > string and migrate still complains of the int default that no longer > exists. Hi Ed, When tr

Re: good 404 vs bad 404

2017-03-02 Thread Antonis Christofides
The Django documentation explains it nicely: [Django] doesn’t bother to email [the admins] for 404s that don’t have a referer – those are usually just people typing in broken URLs or broken Web bots. Antonis Christ

Re: good 404 vs bad 404

2017-03-02 Thread C Kirby
I'd argue that all of the 404s are bad - if your tools are generating broken links isn't it better to fix that than to band-aid it with what is a "good" vs "bad" 404? On Thu, Mar 2, 2017 at 11:10 AM, Antonis Christofides < anto...@djangodeployment.com> wrote: > If what you want is locate broken l

Re: good 404 vs bad 404

2017-03-02 Thread Antonis Christofides
If what you want is locate broken links and ignore 404s resulting from emails, then Django's broken link detection functionality is probably all that you need, unless you really need to do it in monitoring and you can't possibly

Re: Advice: django deploy vps error 502

2017-03-02 Thread Antonis Christofides
Your logs contain this: IOError: write error However, more information is needed in order to understand what is going on. A simple "write error" on its own is insufficient—is it a hardware error? Too many open files? Out of disk space? Something else? If your system writes nothing else in /va