Re: Django + Nginx + X-Accel-Redirect

2016-03-31 Thread Kristofer Pettijohn
Try changing file_url to be relative: file_url = '/media/users/avatar.png' Also check the nginx error log to make sure the path is being constructed properly by nginx. From: "Neto" To: "Django users" Sent: Thursday, March 31,

Re: django admin_tools et file edition

2016-03-31 Thread Alex Heyden
CKEditor is appropriate for files that need solid typography and formatting. If you're looking for something simpler, Markdown is a common solution. Markdown is a markup syntax widespread on internet forums. None of those really address "configuration files," though. Is fancy formatting actually

Re: Issue with django docs translations and google indexing

2016-03-31 Thread Tim Graham
See https://github.com/django/djangoproject.com/issues/621 for some recent improvements we tried to fix this. Perhaps more needs to be done but things look better for me since that change. On Thursday, March 31, 2016 at 1:40:26 PM UTC-4, Piotr Gnus wrote: > > Hello, > > when translations were

Issue with django docs translations and google indexing

2016-03-31 Thread Piotr Gnus
Hello, when translations were implemented in django docs, there is an issue with google indexing documentation pages - all language versions are indexed as english language, so searching for particular documentation page from google gives results on non-english documentation versions if your

django admin_tools et file edition

2016-03-31 Thread vassilux
Hi alls, It is my first django project and I look for a solution to edit files, for exemple allow to an "advanced user" editing configuration files. I looked into django-ckeditor but it is not clear for the moment Where I can

Re: Redefine html properties in widget

2016-03-31 Thread Tim Graham
Some attributes such as IntegerField.min_value need to be customized on the field rather than the widget. This will ensure that validation is also done server-side. (see https://github.com/django/django/blob/f3595b25496691966d4ff858a3b395735ad85a6e/django/forms/fields.py#L278-L285 for

Django + Nginx + X-Accel-Redirect

2016-03-31 Thread Neto
How do I access protected directories using Django? I have the following configuration but is not working, there is always page 404 when I try to access the directory. *Django:* def test(request): file_url = 'http://mysite.com/media/users/avatar.png' response = HttpResponse()

Redefine html properties in widget

2016-03-31 Thread Denis Makarov
Hello! I have my own ModelForm with widgets in Meta class. class Meta: model = Foods fields = '__all__' widgets = { 'quantity': NumberInput(attrs={'min': 1, 'max': 10, 'name': "quantity2"}), 'comment': TextInput(), } My quantity field have NumberInput as standard. I want to

Re: run python function in output of annotated query

2016-03-31 Thread Fabio C. Barrionuevo da Luz
no specific reason. This value is later converted to json, and consumed by javascript from Ajax call.. this was the simplest way I thought, without being obliged to rewrite an one ton of code. ( yes it is a lovely project with spaghetti code, which I hope will one day be authorized to rewrite it

How to reference previous instance when looping in a template?

2016-03-31 Thread Richard Brockie
Hi, I'm doing a lot of this type of looping in my templates (from the docs: https://docs.djangoproject.com/en/1.9/ref/templates/builtins/#for): {% for athlete in athlete_list %} {{ athlete.name }} {% endfor %} In this context, I find myself occasionally wanting to refer to data of the

Q() chaining with & returns empty set

2016-03-31 Thread Bai Shun
I've got a problem in using Q() http://stackoverflow.com/questions/36299975/query-q-is-not-working-as-set-contain-for-related-field-in-django Let's say we have baskets of fruits. How to filter out those baskets that contains all fruits in a given basket? In this document

Re: run python function in output of annotated query

2016-03-31 Thread Simon Charette
Hi Fábio, Since the deprecation of `SubfieldBase`[1] you must implement a `from_db_value()`[2] method to convert the value as returned by the database to the correct Python object. Out of curiosity, is there a reason you are doing this the model level? It looks like something that belongs to the

Example to creatre a dataGrid with djblets

2016-03-31 Thread Cristina Martínez Ruedas
I would like to create a datagrid with Django. I have been reading about how to do that, but I can't find information about it, almost of them don't fix well with Django 1.8 I have read that this is possible with djblets, but I don't know how to begin. Could someone help me? Is there any

getting error while trying example part-4 in Django 1.9

2016-03-31 Thread Prabhjot Singh
NoReverseMatch: Reverse for 'vote' with arguments '(1,)' and keyword arguments '{}' not found. 0 pattern(s) tried: [] link to error -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group

run python function in output of annotated query

2016-03-31 Thread Fabio C. Barrionuevo da Luz
Hello django-users, I have a unmanaged model, of legacy database, used only to read. I need to clean the value of a field returned in a annotated query. I try created a new model field inherits from TextField and override to_python method to clean the value (remove all html using

Re: Model share question

2016-03-31 Thread moon jo
That sounds right. Thank you. On Thursday, March 31, 2016 at 2:19:45 AM UTC-4, Mike Dewhirst wrote: > > On 31/03/2016 8:38 AM, moon jo wrote: > > I'm new to django and have a question regarding model design. > > For practice, I'm working on a web app - a simplified version of imdb > > that

Re: Test Client response.json() UnicodeDecodeError

2016-03-31 Thread Tim Graham
Looks reasonable, although I am not entirely clear what role charset has in a JsonResponse. See https://code.djangoproject.com/ticket/23949. On Thursday, March 31, 2016 at 6:15:53 AM UTC-4, Daniel Blasco wrote: > > Hi, > > I'm testing the REST API of my application and I found an error that I >

Re: Why doesn't {{ form.field.value }} return cleaned data?

2016-03-31 Thread Jani Tiainen
On 31.03.2016 01:08, Ryan Prater wrote: Say I have a TypedMultipleChoiceField and I'm building a custom select multiple widget in my template. If I want to check a box based on an initial value (ie. default checked options), OR check a box based on form data that has been returned (ie.

Test Client response.json() UnicodeDecodeError

2016-03-31 Thread Daniel Blasco
Hi, I'm testing the REST API of my application and I found an error that I think that's a Django's issue. I'm using: - Django==1.9.4 - djangorestframework==3.3.3 I have set the rest framework setting UNICODE_JSON to True. When i'm testing a JSON response that contains a special

Re: Model share question

2016-03-31 Thread Mike Dewhirst
On 31/03/2016 8:38 AM, moon jo wrote: I'm new to django and have a question regarding model design. For practice, I'm working on a web app - a simplified version of imdb that handles movie and music. I've created 2 apps; Movies and Music. With main models in both having the usual fields (title,