Django docs confusing about timestamps and timezones

2016-04-28 Thread Torsten Bronger
Hallöchen! On , it says: For instance, use utcfromtimestamp() instead of fromtimestamp() – and don’t forget to set tzinfo to utc. But isn't it more senseful to say fromtimestamp(time.time(), utc)

Complex content type

2016-04-28 Thread Said Akhmedbayev
Need to build a content type that accepts inputs from users. Those inputs must be stored in database alone with information who entered it (user's information like user name). Here is what I am looking to build:

Re: hanging django/postgres idle connections

2016-04-28 Thread Andrew Grigorev
Same problem with postgis database backend when running a development server. среда, 30 июля 2014 г., 17:41:58 UTC+3 пользователь Jani Kajala написал: > > Hi, > > I have a problem with leaking Postgres DB connections even if I > have CONN_MAX_AGE=0. Every time I start the server and stop it by

Re: Django StaticFiles

2016-04-28 Thread Mike Dewhirst
On 29/04/2016 1:24 AM, Omar wrote: Hello I am new in Django in Linux, I have already config the apache2 server to run Django and it works but It does’nt load me the static files, when I open the Django’s Admin it just plane text (just html). I need to know how config it. thanks Here is a workin

Possible bug in walk_items, django admin delete confirmation use case

2016-04-28 Thread ristretto . rb
Hi, On Django 1.8 (at least, all I can currently check.) The method walk_items at django/template/defaultfilters.py:682, uses a look ahead that technically doesn't always work. If you look at the function, and notice at the end this if next_item: yield next_item, None That will yield back

Re: Csrf: when is it updated/generated?

2016-04-28 Thread Michal Petrucha
On Thu, Apr 28, 2016 at 12:16:10PM -0700, Stefano Tranquillini wrote: > it says "A CSRF cookie that is set to a random value (a session independent > nonce, as it is called)," and later "For security reasons, the value of > the CSRF cookie is changed each time a user logs in." > > The value is

Re: Csrf: when is it updated/generated?

2016-04-28 Thread Stefano Tranquillini
it says "A CSRF cookie that is set to a random value (a session independent nonce, as it is called)," and later "For security reasons, the value of the CSRF cookie is changed each time a user logs in." The value is the same in the two tabs because i've not performed the login, right? (and it r

Re: Django Session IDs

2016-04-28 Thread Ezequiel Bertti
Did you already read this: https://docs.djangoproject.com/en/1.9/topics/http/sessions/#using-cookie-based-sessions https://docs.djangoproject.com/en/1.9/topics/signing/ On Thu, Apr 28, 2016 at 12:43 AM, Supriya wrote: > Hello, > > Can someone please answer the following questions regarding Dja

Re: New to Django (stuck at the end of the tutorial)

2016-04-28 Thread Cronos Cto
Nikhil Beniwal , I tried I get an error that says __init__() takes 1 positional argument but 2 were given. I don't understand, I must be doing something wrong since this was done with the help of the Django official tutorial. -- You received this message because you are subscribed to the Googl

Re: (Newbie) Stuck with annotate() docs

2016-04-28 Thread Ankush Thakur
Yup! Makes sense now. I hope it saves someone some trouble someday. :-) Thanks a lot, Tim! Best, Ankush On Thursday, April 28, 2016 at 12:21:35 AM UTC+5:30, Tim Graham wrote: > > Please give this a try: https://github.com/django/django/pull/6524 > > On Wednesday, April 27, 2016 at 10:45:03 AM UT

Re: Csrf: when is it updated/generated?

2016-04-28 Thread Tim Graham
Did you read https://docs.djangoproject.com/en/stable/ref/csrf/#how-it-works ? On Thursday, April 28, 2016 at 11:24:40 AM UTC-4, Stefano Tranquillini wrote: > > Hello, > i was running a test on a website i dev with django and the system pointed > out that "There are indications that attempts to

Django StaticFiles

2016-04-28 Thread Omar
Hello I am new in Django in Linux, I have already config the apache2 server to run Django and it works but It does'nt load me the static files, when I open the Django's Admin it just plane text (just html). I need to know how config it. thanks -- Este mensaje le ha llegado mediante el servicio d

Csrf: when is it updated/generated?

2016-04-28 Thread Stefano Tranquillini
Hello, i was running a test on a website i dev with django and the system pointed out that "There are indications that attempts to protect against CSRF is in place. By using two different sessions the same tokens were retrieved. This may indicate a buggy behavior in the protection mechanism." .

Django Session IDs

2016-04-28 Thread Supriya
Hello, Can someone please answer the following questions regarding Django Session IDs (session_keys) ? 1. How session_key in the django_session table is generated? Or how session IDs are generated in Django? 2. Which cryptographic algorithms are used to generate Session IDs? 3. How many bits

Re: using AWS cloudfront with Django - CSRF failures

2016-04-28 Thread João Figueiredo
Hi John, Even though I'm two years late, in case someone runs into this problem I managed to solve it by: Whitelisting the 'x-csrfmiddlewaretoken' header (i.e. gets properly forwarded to origin) in the distribution settings. Whitelisting the 'csrftoken' cookie in the distribution behaviour. B

Re: Generation of Session IDs in Django

2016-04-28 Thread Remco Gerlich
Yes, it randomly chooses a 32-character string with characters from VALID_KEY_CHARS (which contains the lower-case characters 'a' to 'z', plus digits '0' to '9', so 36 elements). It uses Python's random.SystemRandom if available (/dev/urandom on Linux, CryptGenRandom() on Windows), and otherwise P