Skip to content

Django. DEBUG in production

I’m writing my first real project in Django and I have a problem with properly setting DEBUG in development and production. In my settings.py project file I have: So I expect that it should work as follows. By default DEBUG is set to True (I use this in my development). But on my production server I hav…

Python counting the trailing zero of factorial

Working on an example but it does not work. There must be a function which counts trailing zero in n! the factorial formula. where, n is the number for whose factorial we want to find the number of trailing zeros. Used some imports but it did not work. My code: Ex: Output must be: Answer This code can do the

math module not working in a string for eval

Suppose I have this code: but I only get this error: NameError: name ‘math’ is not defined How can I fix this? Answer The second parameter to eval, if present, should reference the global namespace. Here, you explicitely assigned an empty dict to it, so you don’t have any access to the name …

Multiple lines chart from dataframe with looping samples

I have a big dataframe which includes 30 samples, measured one every 6 sec over days. It looks something like this: DATE_TIME SAMPLE VALUE 2020-12-10 10:52:48 1 3.22 2020-12-10 10:52:54 2 2.93 2020-12-10 10:53:00 3 2.27 … … … 2020-12-10 16:27:13 1 1.66 2020-12-10 16:27:19 2 1.15 2020-12-10 1…