Sending email using EmailMultiAlternatives where from_email contains comma

2014-04-21 Thread Erol Merdanović
Hi all

I'm using EmailMultiAlternatives to send email. I defined from_email as

Mike  


and it works great. But, if I try to send with

Mike, CEO 


I get an error that Mike is not valid email. How to correctly send email 
which contains comma in sender?

-- 
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 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/a604e93a-6a05-4490-926f-45682af54090%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Integrating RabbitMQ with Django

2015-09-16 Thread Erol Merdanović
Hi all

I'm using Django to develop a service. Service connects to RabbitMQ and 
receives events that are translated to creating/updating/deleting of the 
database records. 

What is the best way to run RabbitMQ consumer with Django? I'm using Pika 
library and I run consumer as a management command (python manage.py 
listen_to_changes). Is this a good solution? I don't see it so. I'm running 
Django as WSGI so I presume there are no start/stop Django events that I 
could plugin in to start/stop consumer.

I'm aware of the Celery and how it nicely integrates into Django, but for 
me it's not an option.

What do you suggest? How to run RabbitMQ with Django (stability is the main 
objective).

-- 
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 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/e2b0cfd3-f33f-485c-9497-98fd281c9cd2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Integrating RabbitMQ with Django

2015-09-16 Thread Erol Merdanović
Hello Vijay

The differences are
1. Celery message and our message has different format
2. Celery uses custom queues

Is this correct?

On Wednesday, 16 September 2015 15:28:33 UTC+2, Vijay Khemlani wrote:
>
> Celery would be the usual choice for this, why is it not an option? Seems 
> far easier and more stable than trying to use a webserver as a queue worker.
>
> On Wed, Sep 16, 2015 at 10:22 AM, Erol Merdanović  > wrote:
>
>> Hi all
>>
>> I'm using Django to develop a service. Service connects to RabbitMQ and 
>> receives events that are translated to creating/updating/deleting of the 
>> database records. 
>>
>> What is the best way to run RabbitMQ consumer with Django? I'm using Pika 
>> library and I run consumer as a management command (python manage.py 
>> listen_to_changes). Is this a good solution? I don't see it so. I'm running 
>> Django as WSGI so I presume there are no start/stop Django events that I 
>> could plugin in to start/stop consumer.
>>
>> I'm aware of the Celery and how it nicely integrates into Django, but for 
>> me it's not an option.
>>
>> What do you suggest? How to run RabbitMQ with Django (stability is the 
>> main objective).
>>
>> -- 
>> 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...@googlegroups.com .
>> To post to this group, send email to django...@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/e2b0cfd3-f33f-485c-9497-98fd281c9cd2%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/e2b0cfd3-f33f-485c-9497-98fd281c9cd2%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
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 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/249b4f0e-b817-4a1f-8ad0-4dabc64d554d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Integrating RabbitMQ with Django

2015-09-16 Thread Erol Merdanović
@Vijay

Yes, source of the messages is outside of the Django application. I could 
use some transformers, but again, it's extra moving part.

@Sadaf

Ok, thank you for the blog. I will check it out. But again, Celery is great 
but I'm not really sure it solves my problem.

On Wednesday, 16 September 2015 15:34:54 UTC+2, Sadaf Noor wrote:
>
> Instead you can try using celery. For demonstration purpose I have tried 
> an image processing app using rabbitmq, celery with flask. It worked great. 
> It can be found at my blog ( 
> http://www.sadafnoor.com/blog/rabbitmq-celery-demonstration-using-image-processing-app-on-flask/
>  
> ).
> On 16-Sep-2015 6:53 PM, "Erol Merdanović" > 
> wrote:
>
>> Hi all
>>
>> I'm using Django to develop a service. Service connects to RabbitMQ and 
>> receives events that are translated to creating/updating/deleting of the 
>> database records. 
>>
>> What is the best way to run RabbitMQ consumer with Django? I'm using Pika 
>> library and I run consumer as a management command (python manage.py 
>> listen_to_changes). Is this a good solution? I don't see it so. I'm running 
>> Django as WSGI so I presume there are no start/stop Django events that I 
>> could plugin in to start/stop consumer.
>>
>> I'm aware of the Celery and how it nicely integrates into Django, but for 
>> me it's not an option.
>>
>> What do you suggest? How to run RabbitMQ with Django (stability is the 
>> main objective).
>>
>> -- 
>> 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...@googlegroups.com .
>> To post to this group, send email to django...@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/e2b0cfd3-f33f-485c-9497-98fd281c9cd2%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/e2b0cfd3-f33f-485c-9497-98fd281c9cd2%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
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 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/a1b78c97-eddb-4330-96e9-b442fe6609bd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Integrating RabbitMQ with Django

2015-09-16 Thread Erol Merdanović
@Tom

Yes, it was also thinking about using supervisord. But I'm interested if 
there is anything else that nicely integrates into Django.

@Felipe

Yes, I'm using pika. Afaik there are no decent tutorials how to implement 
consumers into Django.

On Wednesday, 16 September 2015 16:05:26 UTC+2, Felipe Tomaz wrote:
>
> For manual manipulation recommend Pika[1]
>
> [1] https://pypi.python.org/pypi/pika
>
> --
> Felipe Arenhardt Tomaz
> Systems Developer
> Curitiba - Paraná
> www.felipetomaz.com
>
> On Wed, Sep 16, 2015 at 10:53 AM, Erol Merdanović  > wrote:
>
>> @Vijay
>>
>> Yes, source of the messages is outside of the Django application. I could 
>> use some transformers, but again, it's extra moving part.
>>
>> @Sadaf
>>
>> Ok, thank you for the blog. I will check it out. But again, Celery is 
>> great but I'm not really sure it solves my problem.
>>
>> On Wednesday, 16 September 2015 15:34:54 UTC+2, Sadaf Noor wrote:
>>>
>>> Instead you can try using celery. For demonstration purpose I have tried 
>>> an image processing app using rabbitmq, celery with flask. It worked great. 
>>> It can be found at my blog ( 
>>> http://www.sadafnoor.com/blog/rabbitmq-celery-demonstration-using-image-processing-app-on-flask/
>>>  
>>> ).
>>> On 16-Sep-2015 6:53 PM, "Erol Merdanović"  wrote:
>>>
>>>> Hi all
>>>>
>>>> I'm using Django to develop a service. Service connects to RabbitMQ and 
>>>> receives events that are translated to creating/updating/deleting of the 
>>>> database records. 
>>>>
>>>> What is the best way to run RabbitMQ consumer with Django? I'm using 
>>>> Pika library and I run consumer as a management command (python manage.py 
>>>> listen_to_changes). Is this a good solution? I don't see it so. I'm 
>>>> running 
>>>> Django as WSGI so I presume there are no start/stop Django events that I 
>>>> could plugin in to start/stop consumer.
>>>>
>>>> I'm aware of the Celery and how it nicely integrates into Django, but 
>>>> for me it's not an option.
>>>>
>>>> What do you suggest? How to run RabbitMQ with Django (stability is the 
>>>> main objective).
>>>>
>>>> -- 
>>>> 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...@googlegroups.com.
>>>> To post to this group, send email to django...@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/e2b0cfd3-f33f-485c-9497-98fd281c9cd2%40googlegroups.com
>>>>  
>>>> <https://groups.google.com/d/msgid/django-users/e2b0cfd3-f33f-485c-9497-98fd281c9cd2%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>> .
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>> -- 
>> 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...@googlegroups.com .
>> To post to this group, send email to django...@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/a1b78c97-eddb-4330-96e9-b442fe6609bd%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/a1b78c97-eddb-4330-96e9-b442fe6609bd%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
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 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/ec65ffec-0b14-4a17-a15f-6899a3575cca%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Integrating RabbitMQ with Django

2015-09-17 Thread Erol Merdanović
@Felipe

Yes, I use very similar approach. Thank you for the example.

I found a great project https://github.com/rfk/django-supervisor that 
enables me to run Django commands under supervisor. I will test it and let 
you know how it goes.

On Wednesday, 16 September 2015 19:38:59 UTC+2, Felipe Tomaz wrote:
>
> I create and use this class to manipulate the queues
>
> https://gist.github.com/Arenhardt/8ac7e7667134c28eceed
>
> --
> Felipe Arenhardt Tomaz
> Systems Developer
> Curitiba - Paraná
> www.felipetomaz.com
>
> On Wed, Sep 16, 2015 at 2:01 PM, Erol Merdanović  > wrote:
>
>> @Tom
>>
>> Yes, it was also thinking about using supervisord. But I'm interested if 
>> there is anything else that nicely integrates into Django.
>>
>> @Felipe
>>
>> Yes, I'm using pika. Afaik there are no decent tutorials how to implement 
>> consumers into Django.
>>
>> On Wednesday, 16 September 2015 16:05:26 UTC+2, Felipe Tomaz wrote:
>>>
>>> For manual manipulation recommend Pika[1]
>>>
>>> [1] https://pypi.python.org/pypi/pika
>>>
>>> --
>>> Felipe Arenhardt Tomaz
>>> Systems Developer
>>> Curitiba - Paraná
>>> www.felipetomaz.com
>>>
>>> On Wed, Sep 16, 2015 at 10:53 AM, Erol Merdanović  
>>> wrote:
>>>
>>>> @Vijay
>>>>
>>>> Yes, source of the messages is outside of the Django application. I 
>>>> could use some transformers, but again, it's extra moving part.
>>>>
>>>> @Sadaf
>>>>
>>>> Ok, thank you for the blog. I will check it out. But again, Celery is 
>>>> great but I'm not really sure it solves my problem.
>>>>
>>>> On Wednesday, 16 September 2015 15:34:54 UTC+2, Sadaf Noor wrote:
>>>>>
>>>>> Instead you can try using celery. For demonstration purpose I have 
>>>>> tried an image processing app using rabbitmq, celery with flask. It 
>>>>> worked 
>>>>> great. It can be found at my blog ( 
>>>>> http://www.sadafnoor.com/blog/rabbitmq-celery-demonstration-using-image-processing-app-on-flask/
>>>>>  
>>>>> ).
>>>>> On 16-Sep-2015 6:53 PM, "Erol Merdanović"  wrote:
>>>>>
>>>>>> Hi all
>>>>>>
>>>>>> I'm using Django to develop a service. Service connects to RabbitMQ 
>>>>>> and receives events that are translated to creating/updating/deleting of 
>>>>>> the database records. 
>>>>>>
>>>>>> What is the best way to run RabbitMQ consumer with Django? I'm using 
>>>>>> Pika library and I run consumer as a management command (python 
>>>>>> manage.py 
>>>>>> listen_to_changes). Is this a good solution? I don't see it so. I'm 
>>>>>> running 
>>>>>> Django as WSGI so I presume there are no start/stop Django events that I 
>>>>>> could plugin in to start/stop consumer.
>>>>>>
>>>>>> I'm aware of the Celery and how it nicely integrates into Django, but 
>>>>>> for me it's not an option.
>>>>>>
>>>>>> What do you suggest? How to run RabbitMQ with Django (stability is 
>>>>>> the main objective).
>>>>>>
>>>>>> -- 
>>>>>> 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...@googlegroups.com.
>>>>>> To post to this group, send email to django...@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/e2b0cfd3-f33f-485c-9497-98fd281c9cd2%40googlegroups.com
>>>>>>  
>>>>>> <https://groups.google.com/d/msgid/django-users/e2b0cfd3-f33f-485c-9497-98fd281c9cd2%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>>> .
>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>>
>>>>> -- 
>>>> You received this message because you are subscribed to the Google 
>>>> Groups "Django users" gro

Re: Integrating RabbitMQ with Django

2015-09-17 Thread Erol Merdanović
@Felipe

Can you show an example what you mean by init script?

On Thursday, 17 September 2015 15:18:02 UTC+2, Felipe Tomaz wrote:
>
> I don't like to put the commands on supervisor. You can create an init 
> script.
>
> --
> Felipe Arenhardt Tomaz
> Systems Developer
> Curitiba - Paraná
> www.felipetomaz.com
>
> On Thu, Sep 17, 2015 at 4:48 AM, Erol Merdanović  > wrote:
>
>> @Felipe
>>
>> Yes, I use very similar approach. Thank you for the example.
>>
>> I found a great project https://github.com/rfk/django-supervisor that 
>> enables me to run Django commands under supervisor. I will test it and let 
>> you know how it goes.
>>
>> On Wednesday, 16 September 2015 19:38:59 UTC+2, Felipe Tomaz wrote:
>>>
>>> I create and use this class to manipulate the queues
>>>
>>> https://gist.github.com/Arenhardt/8ac7e7667134c28eceed
>>>
>>> --
>>> Felipe Arenhardt Tomaz
>>> Systems Developer
>>> Curitiba - Paraná
>>> www.felipetomaz.com
>>>
>>> On Wed, Sep 16, 2015 at 2:01 PM, Erol Merdanović  
>>> wrote:
>>>
>>>> @Tom
>>>>
>>>> Yes, it was also thinking about using supervisord. But I'm interested 
>>>> if there is anything else that nicely integrates into Django.
>>>>
>>>> @Felipe
>>>>
>>>> Yes, I'm using pika. Afaik there are no decent tutorials how to 
>>>> implement consumers into Django.
>>>>
>>>> On Wednesday, 16 September 2015 16:05:26 UTC+2, Felipe Tomaz wrote:
>>>>>
>>>>> For manual manipulation recommend Pika[1]
>>>>>
>>>>> [1] https://pypi.python.org/pypi/pika
>>>>>
>>>>> --
>>>>> Felipe Arenhardt Tomaz
>>>>> Systems Developer
>>>>> Curitiba - Paraná
>>>>> www.felipetomaz.com
>>>>>
>>>>> On Wed, Sep 16, 2015 at 10:53 AM, Erol Merdanović  
>>>>> wrote:
>>>>>
>>>>>> @Vijay
>>>>>>
>>>>>> Yes, source of the messages is outside of the Django application. I 
>>>>>> could use some transformers, but again, it's extra moving part.
>>>>>>
>>>>>> @Sadaf
>>>>>>
>>>>>> Ok, thank you for the blog. I will check it out. But again, Celery is 
>>>>>> great but I'm not really sure it solves my problem.
>>>>>>
>>>>>> On Wednesday, 16 September 2015 15:34:54 UTC+2, Sadaf Noor wrote:
>>>>>>>
>>>>>>> Instead you can try using celery. For demonstration purpose I have 
>>>>>>> tried an image processing app using rabbitmq, celery with flask. It 
>>>>>>> worked 
>>>>>>> great. It can be found at my blog ( 
>>>>>>> http://www.sadafnoor.com/blog/rabbitmq-celery-demonstration-using-image-processing-app-on-flask/
>>>>>>>  
>>>>>>> ).
>>>>>>> On 16-Sep-2015 6:53 PM, "Erol Merdanović"  wrote:
>>>>>>>
>>>>>>>> Hi all
>>>>>>>>
>>>>>>>> I'm using Django to develop a service. Service connects to RabbitMQ 
>>>>>>>> and receives events that are translated to creating/updating/deleting 
>>>>>>>> of 
>>>>>>>> the database records. 
>>>>>>>>
>>>>>>>> What is the best way to run RabbitMQ consumer with Django? I'm 
>>>>>>>> using Pika library and I run consumer as a management command (python 
>>>>>>>> manage.py listen_to_changes). Is this a good solution? I don't see it 
>>>>>>>> so. 
>>>>>>>> I'm running Django as WSGI so I presume there are no start/stop Django 
>>>>>>>> events that I could plugin in to start/stop consumer.
>>>>>>>>
>>>>>>>> I'm aware of the Celery and how it nicely integrates into Django, 
>>>>>>>> but for me it's not an option.
>>>>>>>>
>>>>>>>> What do you suggest? How to run RabbitMQ with Django (stability is 
>>>>>>>> the main objective).
>>>>>>>>
>>>>>>>> -- 
>>>>>>>> You re

Re: How to solve this problem: Custom User with ForeinKey to another model. (model does not exist)

2015-10-06 Thread Erol Merdanović
If the order is the problem, then you can define dependencies

https://docs.djangoproject.com/en/1.8/howto/writing-migrations/#controlling-the-order-of-migrations

On Tuesday, 6 October 2015 16:34:04 UTC+2, Fellipe Henrique wrote:
>
> Just to update... these error occurs  when I use PostgreSQL, using SQLite 
> works perfect...
>
> T.·.F.·.A.·. S+F
> *Fellipe Henrique P. Soares*
>
> e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ 
> 's/(.)/chr(ord($1)-2*3)/ge'
> *Blog: http://fhbash.wordpress.com/ *
> *GitHub: https://github.com/fellipeh *
> *Twitter: @fh_bash*
>
> On Tue, Oct 6, 2015 at 10:08 AM, Fellipe Henrique  > wrote:
>
>> Hello,
>>
>> I have my custom user model in my "account" app, and I have in my "core" 
>> app..
>>
>> Inside my "core app" I have my City Model...
>>
>> But I need each user has to be set the user City... 
>>
>> My problem: when I apply the migration, I give the error:  "city model" 
>> does not exist. even I put the "core app" abouve the "account app" in 
>> settings.py.
>>
>> It's appears django try to make the account migration first, but It's 
>> doesn't create yet my "city app"...
>>
>> What's the better approach to solve these problem?
>>
>> Regards.  
>>
>> T.·.F.·.A.·. S+F
>> *Fellipe Henrique P. Soares*
>>
>> e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ 
>> 's/(.)/chr(ord($1)-2*3)/ge'
>> *Blog: http://fhbash.wordpress.com/ *
>> *GitHub: https://github.com/fellipeh *
>> *Twitter: @fh_bash*
>>
>
>

-- 
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 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/871a9717-9c66-4417-8cbe-3d7f89141313%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.