title: Django's AppConfig.ready() seems to be called once per thread in Apache wsgi
body: <p>I have the following code in <code>apps.py</code>:</p>
  
  <pre><code>class Pqawv1Config(AppConfig):
      # ...
      def ready(self):
          env_run_main=os.environ.get('RUN_MAIN')
          print('IS_PRODUCTION=%s, RUN_MAIN=%s' % (settings.IS_PRODUCTION, env_run_main))
          if (not settings.IS_PRODUCTION) and (env_run_main != 'true'):
              print('Exiting because detected running in reloader.')
              return
  
          print('Starting up for PID=%s, argv=%s...' % (os.getpid(), sys.argv))
          # Initialization of a singleton object from a C++ DLL
          # Raise an exception if this library was already initialized in this process
  </code></pre>
  
  <p>In the evening I restarted the server and it printed the following in the log as expected:</p>
  
  <pre><code>[Sun Sep 15 22:50:34.928549 2019] [wsgi:error] [pid 11792:tid 1176] Starting up for PID=11792, argv=['mod_wsgi']...\r
  </code></pre>
  
  <p>However, in the morning I noticed that something strange has happened. It looks like Apache started a new thread for the web application:</p>
  
  <pre><code>[Mon Sep 16 04:10:41.224464 2019] [wsgi:error] [pid 11792:tid 1160] Starting up for PID=11792, argv=['mod_wsgi']...\r
  </code></pre>
  
  <p>And later:</p>
  
  <pre><code>[Mon Sep 16 07:16:21.028429 2019] [mpm_winnt:error] [pid 11792:tid 2272] AH00326: Server ran out of threads to serve requests. Consider raising the ThreadsPerChild setting
  </code></pre>
  
  <p>I think it's not the issue of calling <code>AppConfig.ready()</code> method twice because there were requests to the website in between and they were handled well. It rather looks like Django's <code>AppConfig.ready()</code> method is called once per worker thread of Apache process. Is this so? In this case, how to run the code once per process, rather than once per thread in Django powered by Apache and mod-wsgi?</p>