Re: Is Django logging multi-process safe?

2018-12-21 Thread Dan Davis
Eric, thanks for confirming.  I've written my share of logrotate.d files,
but I may push to do something else, like send them directly to
Elasticsearch with a delay of some sort.


On Fri, Dec 21, 2018 at 2:00 PM PASCUAL Eric  wrote:

> Hi,
>
>
> If you are running on a Linux system, you'd better using the standard
> stream logs and *logrotate* to manage file rotating.
>
>
> The later is the blessed tool for this kind of task, since it manages for
> free the compression of rotated files and removal of oldest ones if you
> want to.
>
>
> Regards
>
>
> Eric
>
>
> --
> *From:* django-users@googlegroups.com  on
> behalf of Dan Davis 
> *Sent:* Friday, December 21, 2018 5:55:35 PM
> *To:* Django users
> *Subject:* Re: Is Django logging multi-process safe?
>
> Looks like I should use a WatchedFileHandler and then have logrotate do
> the logging.   If the file pointer is moved by another process, then it
> will work.
> Does gunicorn patch this for me?   Will I be better off using syslog or
> something?
>
> On Friday, December 21, 2018 at 11:51:16 AM UTC-5, Dan Davis wrote:
>
>
> I just came across this:
>
>
> https://docs.python.org/3.5/howto/logging-cookbook.html#logging-to-a-single-file-from-multiple-processes
>
> This suggests that log messages sent to a StreamHandler will be processed
> properly, but log messages sent to a standard
> logging.handlers.TimedRotatingFileHandler are not process safe.
>
> What sayeth the group?
>
> --
> 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 https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/b1792c98-0373-42e6-93ac-8b0961ec83e6%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>
> --
> 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/1E1MuO08okk/unsubscribe.
> To unsubscribe from this group and all its topics, 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 https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/AM6P193MB042177E51A91076EAC03931E8CB80%40AM6P193MB0421.EURP193.PROD.OUTLOOK.COM
> 
> .
> 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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFzonYY5_uOiwn7xZUSzqKA3AX6J0V8TPD%2BRRZ%2B%3DdS5OpixGcw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: DJANGO FOR FINANCE !

2018-12-21 Thread Mohamed Hashi
i have a problem with models
i write the code
but still dont wanna makemigrartions
any help
thanks .

‫في الجمعة، 14 ديسمبر 2018 في 3:33 ص تمت كتابة ما يلي بواسطة ‪codesign web
za‬‏ <‪sh...@codesign.web.za‬‏>:‬

> I eventually chose django-chartjs and django-datatable for this
>
> On 13/12/2018 19:55, carlos wrote:
>
> yes, is posible in Django make forms for input user and output make grahp
> and table
>
> Cheers
>
> On Thu, Dec 13, 2018 at 9:35 AM Mamoudou Diallo 
> wrote:
>
>> Hey EVERYONE !
>>
>> I am working on a project where I am would like to use django to build a
>> site that computes certain financial formulas based on user inputs or even
>> better (based on Time series data set) and spits out the results in a form
>> of a graph or predisgned table. I have the formulas written out in python
>> already, but I am new to django, but I have watched a few tutorial videos
>> and how powerful it is. Most of the tutorials and content that I have come
>> accross with is primarily not related to finance but mouch more towads
>> building blog posts etc
>>
>>
>> Please checkout the attachement for a picture view of what I want to do.
>> --
>> 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 https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/bddac915-325e-4a1c-af18-4c4b8ef39993%40googlegroups.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
> --
> att.
> Carlos Rocha
> --
> 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 https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAM-7rO2Csx2bMZBO%3DfHzSxdEwbxfkdmZFsfh4mmOnQFu1JzWGw%40mail.gmail.com
> 
> .
> 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 https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/4000facf-e1cb-3aef-91cf-c33290f1bf9a%40codesign.web.za
> 
> .
> 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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAOiYw3tWudQtuxQBKVAY%3DSgu64F_Ao7NnfdA%3D1DEJUFyiSioAw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Not able to install Django in ubuntu 16.04

2018-12-21 Thread Sanjeev Singh
@
Dr. Sandeep Singh Sengar

Can you please show me your error.

On Fri, Dec 21, 2018 at 10:20 PM Sandeep Sengar <
sandeep.iitdhan...@gmail.com> wrote:

> done;
>
> On Fri, Dec 21, 2018 at 8:30 PM Gear Crew 
> wrote:
>
>> Hello the first one show us your message errors and the second prefer use
>> virtual environment like pipenv or virtualenv  and hold on until solve your
>> problem
>> On Friday, 21 December 2018 15:34:00 UTC+2, Dr. Sandeep Singh Sengar
>> wrote:
>>>
>>> Hi,
>>>
>>> I have tried lot to install Django framework from
>>> https://docs.djangoproject.com/en/2.1/topics/install/#installing-official-release
>>> . However every time there is new error, kindly support me in this regard
>>> by providing clear steps.
>>>
>>> I am using Python 3.7.1 and pip 18.1
>>>
>>>
>>> Your help will be highly appreciated.
>>>
>>> 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+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/f662458a-b7e7-4324-80b7-c5d4d3593e44%40googlegroups.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
> --
> Warm Regards,
> *Dr. Sandeep Singh Sengar,*
>
> *MTech (MNNIT-Allahabad), PhD (IIT-Dhanbad)*
>
> *Assistant Professor, Research Coordinator*
>
> *Department of Computer Science & Engineering,*
> *GL Bajaj Institute of Technology & Management,*
>
> *Gr. Noida, INDIA*
>
> **
> *Voice: +91-635492*
> *Email: sandeep.si...@glbitm.org *
>
>
> *Google Scholar: 
> https://scholar.google.co.in/citations?user=ULBn6XIJ=en=ao
>   *
> *Research Gate: *
> *https://www.researchgate.net/profile/Sandeep_Singh_Sengar
> *
> *Linkedin**: **https://www.linkedin.com/in/dr-sandeep-singh-sengar-8038717b/
> *
>
> --
> 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 https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAMabqZQeCR0dAYT2Og6wNixb8wkNaO%2BrRt3zUsYUKKjB8UMYEw%40mail.gmail.com
> 
> .
> 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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CA%2Btz_AAh2_fG2zLArcLtNGOJTXHBzejdqUPn3BbKir7ubJJC2g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Is Django logging multi-process safe?

2018-12-21 Thread PASCUAL Eric
Hi,


If you are running on a Linux system, you'd better using the standard stream 
logs and logrotate to manage file rotating.


The later is the blessed tool for this kind of task, since it manages for free 
the compression of rotated files and removal of oldest ones if you want to.


Regards


Eric



From: django-users@googlegroups.com  on behalf 
of Dan Davis 
Sent: Friday, December 21, 2018 5:55:35 PM
To: Django users
Subject: Re: Is Django logging multi-process safe?

Looks like I should use a WatchedFileHandler and then have logrotate do the 
logging.   If the file pointer is moved by another process, then it will work.
Does gunicorn patch this for me?   Will I be better off using syslog or 
something?

On Friday, December 21, 2018 at 11:51:16 AM UTC-5, Dan Davis wrote:

I just came across this:

https://docs.python.org/3.5/howto/logging-cookbook.html#logging-to-a-single-file-from-multiple-processes

This suggests that log messages sent to a StreamHandler will be processed 
properly, but log messages sent to a standard 
logging.handlers.TimedRotatingFileHandler are not process safe.

What sayeth the group?


--
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/b1792c98-0373-42e6-93ac-8b0961ec83e6%40googlegroups.com.
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/AM6P193MB042177E51A91076EAC03931E8CB80%40AM6P193MB0421.EURP193.PROD.OUTLOOK.COM.
For more options, visit https://groups.google.com/d/optout.


Re: Is Django logging multi-process safe?

2018-12-21 Thread Dan Davis
Looks like I should use a WatchedFileHandler and then have logrotate do the 
logging.   If the file pointer is moved by another process, then it will 
work.
Does gunicorn patch this for me?   Will I be better off using syslog or 
something?

On Friday, December 21, 2018 at 11:51:16 AM UTC-5, Dan Davis wrote:
>
>
> I just came across this:
>
>
> https://docs.python.org/3.5/howto/logging-cookbook.html#logging-to-a-single-file-from-multiple-processes
>
> This suggests that log messages sent to a StreamHandler will be processed 
> properly, but log messages sent to a standard 
> logging.handlers.TimedRotatingFileHandler are not process safe.
>
> What sayeth the group?
>
>

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/b1792c98-0373-42e6-93ac-8b0961ec83e6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Is Django logging multi-process safe?

2018-12-21 Thread Dan Davis

I just came across this:

https://docs.python.org/3.5/howto/logging-cookbook.html#logging-to-a-single-file-from-multiple-processes

This suggests that log messages sent to a StreamHandler will be processed 
properly, but log messages sent to a standard 
logging.handlers.TimedRotatingFileHandler are not process safe.

What sayeth the group?

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/3c141b58-ac35-450d-955b-7bddad0b3052%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Not able to install Django in ubuntu 16.04

2018-12-21 Thread Sandeep Sengar
done;

On Fri, Dec 21, 2018 at 8:30 PM Gear Crew 
wrote:

> Hello the first one show us your message errors and the second prefer use
> virtual environment like pipenv or virtualenv  and hold on until solve your
> problem
> On Friday, 21 December 2018 15:34:00 UTC+2, Dr. Sandeep Singh Sengar wrote:
>>
>> Hi,
>>
>> I have tried lot to install Django framework from
>> https://docs.djangoproject.com/en/2.1/topics/install/#installing-official-release
>> . However every time there is new error, kindly support me in this regard
>> by providing clear steps.
>>
>> I am using Python 3.7.1 and pip 18.1
>>
>>
>> Your help will be highly appreciated.
>>
>> 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+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/f662458a-b7e7-4324-80b7-c5d4d3593e44%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 
Warm Regards,
*Dr. Sandeep Singh Sengar,*

*MTech (MNNIT-Allahabad), PhD (IIT-Dhanbad)*

*Assistant Professor, Research Coordinator*

*Department of Computer Science & Engineering,*
*GL Bajaj Institute of Technology & Management,*

*Gr. Noida, INDIA*

**
*Voice: +91-635492*
*Email: sandeep.si...@glbitm.org *


*Google Scholar:
https://scholar.google.co.in/citations?user=ULBn6XIJ=en=ao
  *
*Research Gate: *
*https://www.researchgate.net/profile/Sandeep_Singh_Sengar
*
*Linkedin**: **https://www.linkedin.com/in/dr-sandeep-singh-sengar-8038717b/
*

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAMabqZQeCR0dAYT2Og6wNixb8wkNaO%2BrRt3zUsYUKKjB8UMYEw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Not able to install Django in ubuntu 16.04

2018-12-21 Thread Gear Crew
Hello the first one show us your message errors and the second prefer use 
virtual environment like pipenv or virtualenv  and hold on until solve your 
problem 
On Friday, 21 December 2018 15:34:00 UTC+2, Dr. Sandeep Singh Sengar wrote:
>
> Hi,
>
> I have tried lot to install Django framework from 
> https://docs.djangoproject.com/en/2.1/topics/install/#installing-official-release
>  
> . However every time there is new error, kindly support me in this regard 
> by providing clear steps.
>
> I am using Python 3.7.1 and pip 18.1
>
>
> Your help will be highly appreciated. 
>
> 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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/f662458a-b7e7-4324-80b7-c5d4d3593e44%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Not able to install Django in ubuntu 16.04

2018-12-21 Thread Dr. Sandeep Singh Sengar
Hi,

I have tried lot to install Django framework from 
https://docs.djangoproject.com/en/2.1/topics/install/#installing-official-release
 
. However every time there is new error, kindly support me in this regard 
by providing clear steps.

I am using Python 3.7.1 and pip 18.1


Your help will be highly appreciated. 

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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/ac9215ff-2f90-49aa-aab8-5af11d8d533f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Stored Procedures v/s ORM?

2018-12-21 Thread supriya . singla
Hi ,

Is it a good practice to use stored procedures in django ? What are the 
pros and cons for each approach?

Thanks,
Supriya

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/1ef60a40-7ea2-4f3e-8872-d2e5dc4eaebb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Can't add users to groups. No Groups Chosen Box in Admin

2018-12-21 Thread mab . mobile . 01
I've created an Employee group for my project but the Admin Group Chosen 
Box is not displayed. See screenshot
Need help on adding users to groups and getting the box to display. 

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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/1a24c960-ba0b-467d-85a7-f5c28f2983bf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


i am having problem with django translations

2018-12-21 Thread Bleron Uka

i have 3 languages in my site 

but when i call all *parts *in the index, it is not going to translate in 
the SHQIP language 

Please who knows how to call in current lang 

i am calling like this {*{  parts.category  }}* it returns base language 



parts = AutoPartsEntry.objects.all().filter(is_active=True)[:4]  # this calls 
all Auto Parts in the list 


cat = AutoCategory.objects.translate(translation.get_language()) # this calls 
all Translations category in the list



class AutoPartsEntry(models.Model):
user = models.ForeignKey(MyUser, on_delete=models.CASCADE)
*category = models.ForeignKey(AutoCategory, on_delete=models.CASCADE)*
brand = models.ForeignKey(CarBrands, on_delete=models.CASCADE)
model = models.ForeignKey(CarModels, on_delete=models.CASCADE)
submodel = models.CharField(max_length=255, blank=True)
description = models.TextField(blank=True)
state = models.CharField(max_length=200)
year = models.ForeignKey(CarYears, on_delete=models.CASCADE)
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_now=True)
agreement = models.BooleanField(default=False)
price = models.CharField(max_length=255, blank=True)
city = models.CharField(max_length=255)
address = models.CharField(max_length=255)
phone = models.CharField(max_length=255)
is_active = models.BooleanField(default=False)



class AutoCategory(Translatable):
value = models.CharField(
verbose_name='Category',
max_length=200,
)

class TranslatableMeta:
fields = ['value']

def __str__(self):  # __unicode__ on Python 2
return self.value

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/e3102911-166d-409a-81f3-4e222da69453%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.