Re: django 1.8.1 : A server error occurred. Please contact the administrator.

2015-04-24 Thread Mike Dewhirst
On 25/04/2015 3:13 AM, JMKoushyar wrote: Ho guys, I'm new to django framework. According to Instructions in the djangoproject.com I did all the things and everything was pretty good but when I tried to open my django project in browser by "python manage.py runserver", I got some errors. The page

ModelForm not creating field with required options

2015-04-24 Thread victor menezes
Hi all, I'm using Django 1.8 and having trouble to because my form does not generate fields with required option even though they have the property "blank=False" in the model. In the example bellow, shouldn't the field "description" have the "required" attribute in the html generated using

Re: Slowness of the resulting squashed migration

2015-04-24 Thread Markus Holtermann
Hi, In principle it is possible to write your own or modify existing migrations unless they are already applied. Regarding the additional AddField() operations: in case you have e.g. circular references between two models Django cannot add both models with their full columns at the same time.

Re: Database and migrations are out of sync.

2015-04-24 Thread felix
El 24/04/15 12:16, Tim Graham escribió: I don't think so. When you create your initial migrations, you need to ensure they match the scheme of your database. After that, things shouldn't get out of sync. Any idea how that happened in the first place? On Friday, April 24, 2015 at 8:54:19 AM

Slowness of the resulting squashed migration

2015-04-24 Thread aRkadeFR
Hello, After working on a project and having around 10 migrations per app, I wanted to refactor some migrations (of the same app) into only one and have a faster migrations while testing. I did squashmigrations on many of the migrations, but the resulting squased migration is still pretty slow

django 1.8.1 : A server error occurred. Please contact the administrator.

2015-04-24 Thread JMKoushyar
Ho guys, I'm new to django framework. According to Instructions in the djangoproject.com I did all the things and everything was pretty good but when I tried to open my django project in browser by "python manage.py runserver", I got some errors. The page error is : A server error occurred.

Django restframework based app on heroku showing error HTTP/1.1 505 HTTP Version Not Supported

2015-04-24 Thread Anand Singh
I need to send some data from an arduino to an rest based web application. To test I have created an django based web application on heroku http://obttracker.herokuapp.com/api/ Now when I trying to send the data from arduino using GSM AT commands it's showing below error HTTP/1.1 505 HTTP

Re: annotate() questions

2015-04-24 Thread Carsten Fuchs
Am 17.04.2015 um 21:14 schrieb Carsten Fuchs: Now if only I knew how to obtain the actual book objects related to the min/max prices... Just for future reference, the best answer that I've found so far is: http://blog.roseman.org.uk/2010/08/14/getting-related-item-aggregate/ Best regards,

Re: Database and migrations are out of sync.

2015-04-24 Thread Tim Graham
I don't think so. When you create your initial migrations, you need to ensure they match the scheme of your database. After that, things shouldn't get out of sync. Any idea how that happened in the first place? On Friday, April 24, 2015 at 8:54:19 AM UTC-4, Андрей Лукьянов wrote: > > Hi

Re: Best practice for passing JSON objects to a template

2015-04-24 Thread Piper Merriam
Look at django-argonauts https://github.com/fusionbox/django-argonauts It provides a nice (safe) template tag you can use to filter json serializable python objects into safe javascript objects. On Thursday, April 9, 2015 at 11:50:50 AM UTC-6, Eric Plumb wrote: > > Hi Djangoers! > > Sometimes

Re: form_invalid redirection with CBVs

2015-04-24 Thread David
This is what I am working from btw: https://docs.djangoproject.com/en/1.8/topics/class-based-views/mixins/#an-alternative-better-solution -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails

Database and migrations are out of sync.

2015-04-24 Thread Андрей Лукьянов
Hi everyone. In my current project there is a great confusion of migrations and it often ends up in an error when I try to apply migrations because the fields the migrate tries to create are already in the database. Is there any way for migrate to create fields that are not in the database and

Re: ListView CBV and a form

2015-04-24 Thread felix
El 24/04/15 06:08, David escribió: This appears to work. Using a view for 2 functions seems pretty fugly though. Are there better ways to achieve this? class CreateComment(ListView, FormMixin): model = Comment paginate_by = 2 form_class = CommentForm def post(self, request, *args, **kwargs):

form_invalid redirection with CBVs

2015-04-24 Thread David
Following a form_invalid I need to redirect to the CreateComment view below with the errors shown in the form. Is this possible please? Highlighted is where I need help. Thank you for any assistance. class Comments(View): def get(self, request, *args, **kwargs): view = CreateComment.as_view()

Re: ListView CBV and a form

2015-04-24 Thread David
This appears to work. Using a view for 2 functions seems pretty fugly though. Are there better ways to achieve this? class CreateComment(ListView, FormMixin): model = Comment paginate_by = 2 form_class = CommentForm def post(self, request, *args, **kwargs): form = CommentForm(self.request.POST)

Lone CR LF in email messages

2015-04-24 Thread Aron Podrigal
Hi, I'm using django 1.6 with python3.2. I'm getting errors sending emails. Mail servers reject the emails due to lone CR or LF violating rfc2822. I searched with a hex editor where that is, and i found it has a single \r at the end of the message. When I tried to debug outputting the message

ListView CBV and a form

2015-04-24 Thread David
Hi I am using the following: class CreateComment(ListView): model = Comment paginate_by = 2 form_class = CommentForm def post(self, request, *args, **kwargs): if not request.user.is_authenticated(): return HttpResponseForbidden() self.object = self.get_object() self.object.creator =

Re: Best practice for passing JSON objects to a template

2015-04-24 Thread florent . pastor
I guess both methods are valid. Method one could be useful if it makes sense to have a data attribute. Although, if it makes sense to have a data attribute filled up with JSON, and if the json is simple enough, then you can surely convert the json file to "data-" element (for exemple, {"name"