Re: Proposal: FileSystemFinder and AppDirectoriesFinder shall serve unminimized assets in DEBUG mode

2020-04-23 Thread Carlton Gibson
It seems this thread ties in with the current discussion about static assets. For instance if we were to include a compression step, you’d always just reference the raw assets, these being processed, with source maps if we had that, for production. -- You received this message because you are

Re: Deadlock bug in logging? Reproducible case

2020-04-23 Thread Brian Tiemann
Hi — Thanks for looking into this. Adam, I skipped over details like the Python version because I noted them in the readme on my gitlab demo. But I was using Python 3.7.2 for the record. I used "deadlock" because my digging into this had previously turned up https://bugs.python.org/issue6721 ,

Re: Deadlock bug in logging? Reproducible case

2020-04-23 Thread René Fleschenberg
Hi, On 4/23/20 9:40 AM, Adam Johnson wrote: > Brian - You didn't describe the exact symptoms you're seeing. "Deadlock" > has a particular technical meaning around multiple processes requesting > locks mutually off each other, and normally ends in one process being > terminated. But I presume

Re: Deadlock bug in logging? Reproducible case

2020-04-23 Thread Brian Tiemann
It happens with Apache/mod_wsgi in prod. On Thursday, April 23, 2020 at 7:59:45 AM UTC-4, Tom Forbes wrote: > > Just to confirm - are you running into this issue while using the Django > development server in production, or does this occur with Gunicorn/uwsgi as > well? > > Tom > > On 23 Apr

Re: Deadlock bug in logging? Reproducible case

2020-04-23 Thread Adam Johnson
What version of Python René? On Thu, 23 Apr 2020 at 10:58, René Fleschenberg wrote: > Hi, > > On 4/23/20 9:40 AM, Adam Johnson wrote: > > Brian - You didn't describe the exact symptoms you're seeing. "Deadlock" > > has a particular technical meaning around multiple processes requesting > >

Re: Deadlock bug in logging? Reproducible case

2020-04-23 Thread Tom Forbes
Just to confirm - are you running into this issue while using the Django development server in production, or does this occur with Gunicorn/uwsgi as well? Tom > On 23 Apr 2020, at 12:40, Brian Tiemann wrote: > > It also happens in 3.6.9, which is my prod environment. > > FWIW, by way of

Re: Deadlock bug in logging? Reproducible case

2020-04-23 Thread Brian Tiemann
It also happens in 3.6.9, which is my prod environment. FWIW, by way of background context, this is not a heavily used app, not enough so to warrant logging to a custom buffered consumer or remote agent. It's just a small office using it. But the main home view's UI has 5 AJAX calls that cause

Proposal: FileSystemFinder and AppDirectoriesFinder shall serve unminimized assets in DEBUG mode

2020-04-23 Thread Jacob Rief
When specifying paths to assets like JavaScript files, but also CSS, the Django documentation states: > Any links to the file in the codebase should point to the compressed > version. >

Re: Hashing Session Keys in backends

2020-04-23 Thread mark
Hey Adam, thanks for the feedback, I'll make sure to credit Chris' original work in a new PR, I think I'm getting close to having one ready. Is there a way to avoid breaking third party backends, but raising > deprecation warnings? > I could create a new SessionBase child class (something

Re: Deadlock bug in logging? Reproducible case

2020-04-23 Thread Adam Johnson
Brian - You didn't describe the exact symptoms you're seeing. "Deadlock" has a particular technical meaning around multiple processes requesting locks mutually off each other, and normally ends in one process being terminated. But I presume you're experiencing more of a "standstill" and future

Re: Deadlock bug in logging? Reproducible case

2020-04-23 Thread Adam Johnson
Actually that might not work entirely, since your settings file will be imported before the environment variables are copied over. Instead you can lazily construct the django application on the first request: django_application = None def application(environ, start_response): global

Re: Deadlock bug in logging? Reproducible case

2020-04-23 Thread Adam Johnson
https://adamj.eu/tech/2019/05/27/the-simplest-wsgi-middleware/ django_application = get_wsgi_application() def application(environ, start_response): # pass the WSGI environment variables on through to os.environ for var in env_variables_to_pass: os.environ[var] = environ.get(var,

Re: Deadlock bug in logging? Reproducible case

2020-04-23 Thread Brian Tiemann
True, I did notice it needed some more tweaking. I've got a long evening of rewriting years' worth of wsgi.py's and Apache configs ahead of me. I'll probably just jump straight to the envparse approach because (as you noted) my celery env var handling was making the WSGI approach moot anyway.

Re: New Merger nomination.

2020-04-23 Thread Carlton Gibson
Hi all, thanks. I think that's everyone, so I'll add Claude to the team.  Kind Regards, Carlton -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group. To unsubscribe from this group and stop receiving

Re: Deadlock bug in logging? Reproducible case

2020-04-23 Thread Brian Tiemann
Beautiful. That does the trick. Thank you! And I certainly can see there's plenty of other approaches such as envparse or django-environ that I could be using, that keeps the vars out of my Apache config. Quick fix and a slighly longer better fix. This'll change how I do all my new projects

Re: Deadlock bug in logging? Reproducible case

2020-04-23 Thread Adam Johnson
I ran it on Python 3.7.6 and Python 3.8.2 and found the deadlock issue on both. I then adjusted the settings to *only* have the console logger, and added these lines at the end of the settings file: import faulthandler faulthandler.enable() print(os.getpid()) faulthandler allows getting a

Re: Deadlock bug in logging? Reproducible case

2020-04-23 Thread Brian Tiemann
Ah, interesting. Let me show you what my non-trimmed-down wsgi.py looked like -- import os, sys from django.core.wsgi import get_wsgi_application env_variables_to_pass = [ 'SECRET_KEY', ... other env vars ... ] def application(environ, start_response): # pass the WSGI environment

Re: Deadlock bug in logging? Reproducible case

2020-04-23 Thread Brian Tiemann
FYI, here's where that approach came from -- http://ericplumb.com/blog/passing-apache-environment-variables-to-django-via-mod_wsgi.html > > It's the top hit for "django apache environment variable" Which is literally an old friend of mine from grade school. Maybe that's a red flag ... -- You

Re: Proposal: FileSystemFinder and AppDirectoriesFinder shall serve unminimized assets in DEBUG mode

2020-04-23 Thread Adam Johnson
Maybe we can move to always serving minimized assets with corresponding source maps? I was under the impression this is the "best practice" these days. On Thu, 23 Apr 2020 at 10:09, Jacob Rief wrote: > When specifying paths to assets like JavaScript files, but also CSS, the > Django

Re: Proposal: Allow stopwords in slugs generated by ModelAdmin.prepopulated_fields

2020-04-23 Thread Andy Chosak
Thanks, Adam, for your reply. I've opened a ticket at https://code.djangoproject.com/ticket/31511, which includes a link to a PR that makes this change. Any advice on documenting how to wrap window.URLify? Thanks, Andy On Thursday, April 9, 2020 at 1:41:30 PM UTC-4, Adam Johnson wrote: > > I

Re: Remove automatic date-naming of migrations (00XX_auto_YYYMMDD)

2020-04-23 Thread Adam Johnson
Thank you all for the feedback. Re: Andrew: > (60 is a bit long though, maybe we can bump it down to something a bit > shorter?) > Sure, how about 42?  Re: Jon: > Did you have a suggestion for this situation? Revert back to auto-naming > or request the user to name the migration? > The