Tuesday, December 31, 2013

Re: Displaying HTML forms through AJAX

Well Thank you very much Aaron for your suggestions, I am working on them. I am stuck in another problem here, please suggest your opinion

I am using jquery to load specific HTML Form on page (in a div).
I am using django Template generation technique to render them.

Here is the problem: I want to send a parameter in my ajax call, as form-fields need to be auto-populated with some values from DB specific to that parameter. My intention is to use .load function of jquery which passes parameters through POST (am i right?). But it is not working at all. without passing any parameter it works fine.

What I am doing:

Jquery function:
<script>
$(document).ready(function(){
  $("button").click(function(event){
  alert("ok1");
  event.preventDefault();
  var target = "{% url 'polls:demo_test'%}";
  $("#rightpan").load(target, {
  username : "arun_kaushik"
  }); 
  });
});
</script>

views.py:
def demo_test(request):
member = get_object_or_404(Userobject, username=request.POST['username'])
return render(request, 'polls/form_personal.html',{'member': member})

If I do not pass any variable in .load function it works fine and load the form (not populated ofcourse).


--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/fca5b57e-d110-40e3-bc95-e7f27fb61d03%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Monday, December 30, 2013

Re: New to Django; Question

Cognitive advice:
Since you are new to django and since figuring out how to deal with the legacy database interacting with the django ORM, ignore templates at first.
Focus on writing a function that you can run from `manage.py shell` to extract and display the data, even in just a python dictionary. Then, you can focus on displaying it with templates.

ORM advice:
You need some way to tell which row in the table in your database matches a row in the legacy database. Then you can do something like

oldpatients = dict(oldpatient.useful_id_weirdly_named, oldpatient for oldpatient in LegacyPatients.objects.all())
for patient in Patients.objects.all():
    print patient.full_name, oldpatients[patient.useful_id].relevant_info

-- Andrew

(Feedback on my advice appreciated. I hope I don't sound like a tireboot)

On Monday, December 30, 2013, Karthik Kannan wrote:
There seems to be no correlation between your User model and your Data model. And also I dont see a field called patientid in any of the forms. Do you mean userid by any chance? 
So think about your schema and rebuild your models. 

The way to display data in Django is through templates. You could write a view the same way you write a query in the python shell to query data and return those values you want using the render function. The use a template to display the data. 


On Monday, December 30, 2013 11:56:48 PM UTC+5:30, Frank Jaworski wrote:
I am new to Django; I have a legacy database I do not control with some information regarding a user and a database on my server with data pertaining to something that user is doing.  I want to take some information from each database via the ORM methodology Django employs and display it on a webform, but I am struggling.  I search on the patient id and can find what codes they have associated with them, but when it comes to displaying the cost for each code with the associated data, I do not know the best way to do so.  Thanks.

(my database)

class Data(models.Model):
    code = models.CharField(max_length=12)
    cost = models.FloatField()
    unit = models.CharField(max_length=2)

(legacy)

class UserHistory(models.Model)
   userid= models.IntegerField(db_column='userid', blank=True, null=True) 
   code = models.CharField(db_column='code', max_length=11, blank=True)
   firstname = models.CharField(db_column='FirstName', max_length=35, blank=True) 
   middlename = models.CharField(db_column='MiddleName', max_length=35, blank=True) 
   lastname = models.CharField(db_column='LastName', max_length=35, blank=True) 

   

Desired Output:

Here is the cost for user First Name Last Name

Last Name  First Name Code Cost

xxx            zzzzz          2      10.00
xxx            zzzzz          6      10.00
xxx            zzzzz          7      10.00
xxx            zzzzz          11    10.00

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/a52f20f6-9d94-44ce-85de-dbe6a3a17cca%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


--
Pardon brevity; I am on a mobile phone; and quite like haiku

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CA%2By5TLaZGbujMYMhSrUbO2vwhmH3AmodwLpU2GjTYFrn5CBx_Q%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Re: New to Django; Question

There seems to be no correlation between your User model and your Data model. And also I dont see a field called patientid in any of the forms. Do you mean userid by any chance? 
So think about your schema and rebuild your models. 

The way to display data in Django is through templates. You could write a view the same way you write a query in the python shell to query data and return those values you want using the render function. The use a template to display the data. 


On Monday, December 30, 2013 11:56:48 PM UTC+5:30, Frank Jaworski wrote:
I am new to Django; I have a legacy database I do not control with some information regarding a user and a database on my server with data pertaining to something that user is doing.  I want to take some information from each database via the ORM methodology Django employs and display it on a webform, but I am struggling.  I search on the patient id and can find what codes they have associated with them, but when it comes to displaying the cost for each code with the associated data, I do not know the best way to do so.  Thanks.

(my database)

class Data(models.Model):
    code = models.CharField(max_length=12)
    cost = models.FloatField()
    unit = models.CharField(max_length=2)

(legacy)

class UserHistory(models.Model)
   userid= models.IntegerField(db_column='userid', blank=True, null=True) 
   code = models.CharField(db_column='code', max_length=11, blank=True)
   firstname = models.CharField(db_column='FirstName', max_length=35, blank=True) 
   middlename = models.CharField(db_column='MiddleName', max_length=35, blank=True) 
   lastname = models.CharField(db_column='LastName', max_length=35, blank=True) 

   

Desired Output:

Here is the cost for user First Name Last Name

Last Name  First Name Code Cost

xxx            zzzzz          2      10.00
xxx            zzzzz          6      10.00
xxx            zzzzz          7      10.00
xxx            zzzzz          11    10.00

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/a52f20f6-9d94-44ce-85de-dbe6a3a17cca%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Re: Which Real Time Communications Protocol

Thanks!


Dtb/Gby
=======
Mario R. Osorio

“If I had asked people what they wanted, they would have said faster horses.”
 ― Henry Ford

http://www.google.com/profiles/nimbiotics


On Fri, Dec 20, 2013 at 12:49 PM, Bill Freeman <ke1g.nh@gmail.com> wrote:
WebSockets runs over standard HTTP or HTTPS connections, getting past firewalls and other restrictions (e.g.; the hotel WiFi will let you web browse, but not use other ports).  Since WebSockets is standard HTML5, libraries for it will become more and more common.  There are also older "push" technologies (COMET, long poll, etc.).

You can also ad hoc something on these ports.


On Fri, Dec 20, 2013 at 12:10 PM, Mario R. Osorio <nimbiotics@gmail.com> wrote:
Thanks a lot Serge!


Dtb/Gby
=======
Mario R. Osorio

“If I had asked people what they wanted, they would have said faster horses.”
 ― Henry Ford

http://www.google.com/profiles/nimbiotics


On Fri, Dec 20, 2013 at 12:01 PM, Sergiy Khohlov <skhohlov@gmail.com> wrote:
telnet and xmlrpc is a good choice.  I'm working on the similar project
Many thanks,

Serge


+380 636150445
skype: skhohlov


On Fri, Dec 20, 2013 at 6:58 PM, Mario Osorio <nimbiotics@gmail.com> wrote:
> My app will have to communicate different customers (Linux devices, Windoze
> devices, iOS devices and Android devices at least).
>
> Overall, any of these customer devices will start one of many processes and
> some of the other devices are required to respond by letting their users
> know about the just initialized event. The original event might in turn
> start related events with more or less the same behavior.
>
> I will be using email and SMS as 'secondary weapons', but I need some sort
> of real time communications protocol as primary so whatever devices that are
> connected and need, will be notified immediately. (I'm not sure I'm making
> much sense at this point)
>
> What communications protocol can I use so that it:
>
> offers real time response
> is as simple as possible
> works in as many different customers as possible
>
> Thanks a lot in advanced!
>
> --
> 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+unsubscribe@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/17ffdba6-041f-49b8-b688-aa5cdb4a7130%40googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to a topic in the Google Groups "Django users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/django-users/vZQ3C4DS73g/unsubscribe.
To unsubscribe from this group and all its topics, send an email to django-users+unsubscribe@googlegroups.com.

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAO2PNV6N-gJ%3DW-PxqnrWj8D6JMqJPnLgshUV3_EdVn0SSA09bQ%40mail.gmail.com.

For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to a topic in the Google Groups "Django users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/django-users/vZQ3C4DS73g/unsubscribe.
To unsubscribe from this group and all its topics, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAB%2BAj0vuDf7iB387j8xSp1BY4R1epgjEpNkhPE9ghif0RuDXWA%40mail.gmail.com.

For more options, visit https://groups.google.com/groups/opt_out.

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAO2PNV6ih-6GnA1vDi3xJ44-TZuL%2Bs8dg6pHz50i-qQnPti2zA%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Re: Which Real Time Communications Protocol

I would suggest using another framework or tool for this specific purpose. For example, I use the nginx-push-stream-module (https://github.com/wandenberg/nginx-push-stream-module) and have been happy with it. It's very lightweight, easy to use, and supports WebSockets and Long Polling. When I have a background task (Celery) which needs to push data to the client, it simply sends a POST request to Nginx with a channel id and the payload and the Nginx module handles the rest.

The reason for this (someone please correct me if I'm wrong on this) is that Django isn't meant to hold connections indefinitely. Ideally you want to get a request and turn around a response as quick as possible. Using the nginx-push-stream-module, you let Nginx handle all the persistent connections (which it does very well with 10k+ connections).

_Nik

On 12/21/2013 4:55 AM, Dig wrote:

Hi Bill,

  Is there any django project support websocket? Thanks.

Regards,
Dig

On Dec 21, 2013 1:50 AM, "Bill Freeman" <ke1g.nh@gmail.com> wrote:
WebSockets runs over standard HTTP or HTTPS connections, getting past firewalls and other restrictions (e.g.; the hotel WiFi will let you web browse, but not use other ports).  Since WebSockets is standard HTML5, libraries for it will become more and more common.  There are also older "push" technologies (COMET, long poll, etc.).

You can also ad hoc something on these ports.


On Fri, Dec 20, 2013 at 12:10 PM, Mario R. Osorio <nimbiotics@gmail.com> wrote:
Thanks a lot Serge!


Dtb/Gby
=======
Mario R. Osorio

“If I had asked people what they wanted, they would have said faster horses.”
 ― Henry Ford

http://www.google.com/profiles/nimbiotics


On Fri, Dec 20, 2013 at 12:01 PM, Sergiy Khohlov <skhohlov@gmail.com> wrote:
telnet and xmlrpc is a good choice.  I'm working on the similar project
Many thanks,

Serge


+380 636150445
skype: skhohlov


On Fri, Dec 20, 2013 at 6:58 PM, Mario Osorio <nimbiotics@gmail.com> wrote:
> My app will have to communicate different customers (Linux devices, Windoze
> devices, iOS devices and Android devices at least).
>
> Overall, any of these customer devices will start one of many processes and
> some of the other devices are required to respond by letting their users
> know about the just initialized event. The original event might in turn
> start related events with more or less the same behavior.
>
> I will be using email and SMS as 'secondary weapons', but I need some sort
> of real time communications protocol as primary so whatever devices that are
> connected and need, will be notified immediately. (I'm not sure I'm making
> much sense at this point)
>
> What communications protocol can I use so that it:
>
> offers real time response
> is as simple as possible
> works in as many different customers as possible
>
> Thanks a lot in advanced!
>
> --
> 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+unsubscribe@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/17ffdba6-041f-49b8-b688-aa5cdb4a7130%40googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to a topic in the Google Groups "Django users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/django-users/vZQ3C4DS73g/unsubscribe.
To unsubscribe from this group and all its topics, send an email to django-users+unsubscribe@googlegroups.com.

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAO2PNV6N-gJ%3DW-PxqnrWj8D6JMqJPnLgshUV3_EdVn0SSA09bQ%40mail.gmail.com.

For more options, visit https://groups.google.com/groups/opt_out.

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAB%2BAj0vuDf7iB387j8xSp1BY4R1epgjEpNkhPE9ghif0RuDXWA%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.
--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAObE2pHoU-1B3WyrZgD%3DCm3VnQ63b5NJPUZ9G_K2RY_JmnZHrw%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

New to Django; Question

I am new to Django; I have a legacy database I do not control with some information regarding a user and a database on my server with data pertaining to something that user is doing.  I want to take some information from each database via the ORM methodology Django employs and display it on a webform, but I am struggling.  I search on the patient id and can find what codes they have associated with them, but when it comes to displaying the cost for each code with the associated data, I do not know the best way to do so.  Thanks.

(my database)

class Data(models.Model):
    code = models.CharField(max_length=12)
    cost = models.FloatField()
    unit = models.CharField(max_length=2)

(legacy)

class UserHistory(models.Model)
   userid= models.IntegerField(db_column='userid', blank=True, null=True) 
   code = models.CharField(db_column='code', max_length=11, blank=True)
   firstname = models.CharField(db_column='FirstName', max_length=35, blank=True) 
   middlename = models.CharField(db_column='MiddleName', max_length=35, blank=True) 
   lastname = models.CharField(db_column='LastName', max_length=35, blank=True) 

   

Desired Output:

Here is the cost for user First Name Last Name

Last Name  First Name Code Cost

xxx            zzzzz          2      10.00
xxx            zzzzz          6      10.00
xxx            zzzzz          7      10.00
xxx            zzzzz          11    10.00

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/d9c1494a-1610-43fb-b74e-b500a55cf5bb%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

django_tables2: TemplateSyntaxError: Caught ValueError while rendering: Expected table or queryset

Hi everyone.

I'm getting an error when I {% render_table table %} -- it seems that my calls to tables I define (i.e. table = CourseTable(<queryset>) are not actually returning Table objects.

I've posted more on StackOverflow for the sake of exposure and accessibility to people who may run into this problem in the future.


Would very much appreciate your thoughts!

Happy New Year's.

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/c685004a-6628-4f31-8355-052e93077e4b%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Re: Which Real Time Communications Protocol

I'm not aware of one, but I haven't been doing much Django lately.  I guess nobody else reading this thread knows of one either.

There may be a problem making websockets be passed through by (the current implementations of) mod_wsgi, Apache httpd, nginx, etc.  I'm using it with Tornado (which supports websockets out of the box) and no front end server.


On Sat, Dec 21, 2013 at 7:55 AM, Dig <dig.ge.cn@gmail.com> wrote:

Hi Bill,

  Is there any django project support websocket? Thanks.

Regards,
Dig

On Dec 21, 2013 1:50 AM, "Bill Freeman" <ke1g.nh@gmail.com> wrote:
WebSockets runs over standard HTTP or HTTPS connections, getting past firewalls and other restrictions (e.g.; the hotel WiFi will let you web browse, but not use other ports).  Since WebSockets is standard HTML5, libraries for it will become more and more common.  There are also older "push" technologies (COMET, long poll, etc.).

You can also ad hoc something on these ports.


On Fri, Dec 20, 2013 at 12:10 PM, Mario R. Osorio <nimbiotics@gmail.com> wrote:
Thanks a lot Serge!


Dtb/Gby
=======
Mario R. Osorio

“If I had asked people what they wanted, they would have said faster horses.”
 ― Henry Ford

http://www.google.com/profiles/nimbiotics


On Fri, Dec 20, 2013 at 12:01 PM, Sergiy Khohlov <skhohlov@gmail.com> wrote:
telnet and xmlrpc is a good choice.  I'm working on the similar project
Many thanks,

Serge


+380 636150445
skype: skhohlov


On Fri, Dec 20, 2013 at 6:58 PM, Mario Osorio <nimbiotics@gmail.com> wrote:
> My app will have to communicate different customers (Linux devices, Windoze
> devices, iOS devices and Android devices at least).
>
> Overall, any of these customer devices will start one of many processes and
> some of the other devices are required to respond by letting their users
> know about the just initialized event. The original event might in turn
> start related events with more or less the same behavior.
>
> I will be using email and SMS as 'secondary weapons', but I need some sort
> of real time communications protocol as primary so whatever devices that are
> connected and need, will be notified immediately. (I'm not sure I'm making
> much sense at this point)
>
> What communications protocol can I use so that it:
>
> offers real time response
> is as simple as possible
> works in as many different customers as possible
>
> Thanks a lot in advanced!
>
> --
> 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+unsubscribe@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/17ffdba6-041f-49b8-b688-aa5cdb4a7130%40googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to a topic in the Google Groups "Django users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/django-users/vZQ3C4DS73g/unsubscribe.
To unsubscribe from this group and all its topics, send an email to django-users+unsubscribe@googlegroups.com.

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAO2PNV6N-gJ%3DW-PxqnrWj8D6JMqJPnLgshUV3_EdVn0SSA09bQ%40mail.gmail.com.

For more options, visit https://groups.google.com/groups/opt_out.

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAB%2BAj0vuDf7iB387j8xSp1BY4R1epgjEpNkhPE9ghif0RuDXWA%40mail.gmail.com.

For more options, visit https://groups.google.com/groups/opt_out.

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAObE2pHoU-1B3WyrZgD%3DCm3VnQ63b5NJPUZ9G_K2RY_JmnZHrw%40mail.gmail.com.

For more options, visit https://groups.google.com/groups/opt_out.

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAB%2BAj0tXSJDecXDSrZZaCiK6wQE2edxa%3DL6Q%3DS%3D6szV%2Bs9FS3A%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

howto copy content of upload image into BytesIO object (without create tmp file)

Hello all,
i need process uploaded image on the fly - in memory. I don't need create temp file.
I try something like...

.....
userform = UserForm(request.POST, request.FILES)  raw_image = userform.cleaned_data["image"]  content = BytesIO(raw_image.read())  image = Img.open(content)  
.....
But i received the result...
.....
Exception Type: OSError  Exception Value: 	  cannot identify image file  

Thanks for the advice
Hanz

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/1b8b38d2-69b8-49cf-8b9e-0b1c95e98d48%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Pycharm professtional can't create django project in linux mint 16

Here is my problem

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/ded3a93a-66e2-4618-8d8a-f6ba7914475a%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Sunday, December 29, 2013

Re: Media files django 1.5

On 30/12/2013 3:18am, Carlos Andre wrote:
> hello guys, i have a problem in django 1.5!
> I did a migration from version 1.3 to this and when I migrated projects
> that have worked in version 1.3 there was no recognition of the media in
> version 1.5!
> I made the steps of the tutorial, but the problem still insists! have
> something new to be configured?

Try inserting some print or logging statements which output your media
directories and urls so you can see the differences between 1.3 and 1.5

This might say more about my memory than anything else but I don't
remember any problems going from 1.3 to 1.4 to 1.5.

Good luck

> thank you
>
> --
> 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+unsubscribe@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAA8yBMzSyXLoKAoNWvOA%2BpJkJHVMyGujnG7nH7ctjm3%3DWjTVcA%40mail.gmail.com.
> For more options, visit https://groups.google.com/groups/opt_out.

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/52C0DBA1.9060207%40dewhirst.com.au.
For more options, visit https://groups.google.com/groups/opt_out.

Re: Server Sent Event to a specific user

On 30/12/2013 12:59pm, Thai Tran wrote:
> Yes, that was what I thought. But letting the user subscribe to a
> channel without any validation / authorization is a bit scary. That is
> why I wanna push the message based on the user session, not through a
> user name or strings like that

If timing requirements permit, you could let the client side request
messages frequently enough to satisfy users. I think that would be
nicely low-tech and somewhat tune-able.

>
> On 12/30/2013 2:03 AM, Nevio Vesic wrote:
>> Well You can always send custom events for some specific channel. Example:
>>
>> socket.on("global_event",function(channel,data){});
>> socket.on("user_XYZ",function(channel,data){});
>>
>> emit_to_channel('some_room', 'gobal_event', 'hello')
>> emit_to_channel('some_room', 'user_XYZ', 'hello XYZ')
>>
>> I understand this is not the most secure way but you can ensure
>> additional encryption like hashing on every request or shit like that
>> or even have every user connects to its own "secured" channel.
>>
>> Hope this helps.
>>
>>
>> Hi,
>>
>> I am working on a message sending/reading app atm. Is there any
>> way to push a message to a particular user session by using Redis
>> and SSE ? I am using the tutorial at
>> https://github.com/fcurella/django-push-demo and it works great
>> with the current setup (which means I can send the whole bunks of
>> new messages to all users but this is not what I wish for,
>> obviously). When a user A composes a message and send to user B,
>> how can I just "push" that new message to that particular user B ?
>> --
>> 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+unsubscribe@googlegroups.com
>> <mailto:django-users%2Bunsubscribe@googlegroups.com>.
>> To post to this group, send email to django-users@googlegroups.com
>> <mailto:django-users@googlegroups.com>.
>> Visit this group at http://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAM3VocpM%2Bn1Xw0mhMf3iWbQD%2BjZ%2BGini5v5XjPXYipXjnLTJzg%40mail.gmail.com.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>> --
>> 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+unsubscribe@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAD1DFf1T0nTLPV2fO5Y4RDgmZ%3DWQziFCeORearNi1ioX43Zg5w%40mail.gmail.com.
>> For more options, visit https://groups.google.com/groups/opt_out.
>
> --
> 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+unsubscribe@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/52C0D381.3060100%40gmail.com.
> For more options, visit https://groups.google.com/groups/opt_out.

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/52C0DA03.5060604%40dewhirst.com.au.
For more options, visit https://groups.google.com/groups/opt_out.

Re: Server Sent Event to a specific user

Yes, that was what I thought. But letting the user subscribe to a channel without any validation / authorization is a bit scary. That is why I wanna push the message based on the user session, not through a user name or strings like that

On 12/30/2013 2:03 AM, Nevio Vesic wrote:
Well You can always send custom events for some specific channel. Example:

socket.on("global_event", function(channel, data) {});
socket.on("user_XYZ", function(channel, data) {});

emit_to_channel('some_room', 'gobal_event', 'hello')
emit_to_channel('some_room', 'user_XYZ', 'hello XYZ')

I understand this is not the most secure way but you can ensure additional encryption like hashing on every request or shit like that or even have every user connects to its own "secured" channel. 

Hope this helps.


Hi,

I am working on a message sending/reading app atm. Is there any way to push a message to a particular user session by using Redis and SSE ? I am using the tutorial at https://github.com/fcurella/django-push-demo and it works great with the current setup (which means I can send the whole bunks of new messages to all users but this is not what I wish for, obviously). When a user A composes a message and send to user B, how can I just "push" that new message to that particular user B ?
--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAM3VocpM%2Bn1Xw0mhMf3iWbQD%2BjZ%2BGini5v5XjPXYipXjnLTJzg%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAD1DFf1T0nTLPV2fO5Y4RDgmZ%3DWQziFCeORearNi1ioX43Zg5w%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Re: dumpdata --format=yaml, dates, and USE_TZ

It's a bug in PyYAML: https://code.djangoproject.com/ticket/18867

--
Aymeric.

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/e04d2594-24f3-4886-8c06-f21f0b2fde5b%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Re: Server Sent Event to a specific user

Well You can always send custom events for some specific channel. Example:

socket.on("global_event", function(channel, data) {});
socket.on("user_XYZ", function(channel, data) {});

emit_to_channel('some_room', 'gobal_event', 'hello')
emit_to_channel('some_room', 'user_XYZ', 'hello XYZ')

I understand this is not the most secure way but you can ensure additional encryption like hashing on every request or shit like that or even have every user connects to its own "secured" channel. 

Hope this helps.


Hi,

I am working on a message sending/reading app atm. Is there any way to push a message to a particular user session by using Redis and SSE ? I am using the tutorial at https://github.com/fcurella/django-push-demo and it works great with the current setup (which means I can send the whole bunks of new messages to all users but this is not what I wish for, obviously). When a user A composes a message and send to user B, how can I just "push" that new message to that particular user B ?

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAM3VocpM%2Bn1Xw0mhMf3iWbQD%2BjZ%2BGini5v5XjPXYipXjnLTJzg%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAD1DFf1T0nTLPV2fO5Y4RDgmZ%3DWQziFCeORearNi1ioX43Zg5w%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Server Sent Event to a specific user

Hi,

I am working on a message sending/reading app atm. Is there any way to push a message to a particular user session by using Redis and SSE ? I am using the tutorial at https://github.com/fcurella/django-push-demo and it works great with the current setup (which means I can send the whole bunks of new messages to all users but this is not what I wish for, obviously). When a user A composes a message and send to user B, how can I just "push" that new message to that particular user B ?

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAM3VocpM%2Bn1Xw0mhMf3iWbQD%2BjZ%2BGini5v5XjPXYipXjnLTJzg%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Media files django 1.5

hello guys, i have a problem in django 1.5!
I did a migration from version 1.3 to this and when I migrated projects that have worked in version 1.3 there was no recognition of the media in version 1.5!
I made the steps of the tutorial, but the problem still insists! have something new to be configured?
thank you

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAA8yBMzSyXLoKAoNWvOA%2BpJkJHVMyGujnG7nH7ctjm3%3DWjTVcA%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Dropdown.html - center links around brand in navbar

Hi,

I am trying to create a navbar in dropdown.html that is centered around a middle brand/logo using bootstrap.
Eks.

I have tried using the page_menu template tags, but since I cannot find a way to say, I.e. render 3 links then create a space for the brand/logo. then render 3 more links.
I am starting to believe that I have to hard code the links into dropdown.html... 

Does anyone have experience with solving this problem using the page_menu template tags in dropdown.html? 


Thanks in advanced!

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/3b01fbb1-6542-43a8-a58e-cdde47305985%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Re: How to migrate a project from one DB to another

I recommend using South http://south.aeracode.org/  and just follow the tutorial as if it is a new project.  Do you need to migrate data as well as the schema?  That may require more manual intervention. 

HTH,
Tim


On Sun, Dec 29, 2013 at 3:10 AM, Don Fox <foxdon31@gmail.com> wrote:
I've started a small project and would like to change from sqlite to postgresql. Is there any established systematic method  to carry this out?

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/8a1c6d46-fb05-440c-b7bb-d13e3fe82f9f%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--
MLHIM VIP Signup: http://goo.gl/22B0U
============================================
Timothy Cook, MSc           +55 21 94711995
MLHIM http://www.mlhim.org
Like Us on FB: https://www.facebook.com/mlhim2
Circle us on G+: http://goo.gl/44EV5
Google Scholar: http://goo.gl/MMZ1o
LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CA%2B%3DOU3UQMLtLuFPvock8%3DpJHbXQb%3DDNKjdSQb4yJR-rEDLcxrQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.