title: How can I load my Django project into celery workers AFTER they fork?
body: <p>This question might seem odd to folks, but it's actually a creative question.</p>
  <p>I'm using <code>Django</code> (v3.2.3) and <code>celery</code> (v5.2.3) for a project. I've noticed that the workers and master process all share the same code (probably b/c <code>celery</code> loads my app modules before it forks the child processes for configuration reasons). While this would normally be fine, I want to do something more unreasonable :smile: — I want the celery workers to each load my project code <strong>after</strong> they fork (similar to how <code>uwsgi</code> does with <code>lazy-apps</code> configuration).</p>
  <p>Some responses here will ask why, but let's not focus on that (remember, I'm being unreasonable). Let's just assume I don't want to write thread-safe code. The risks are understood, namely that each child worker would load more memory and be slow at restart.</p>
  <p>It's not clear to me from reading the <code>celery</code> code how this would be possible. I've tried this to no avail:</p>
  <ol>
  <li>listen to the signal <code>worker_process_init</code> (<a href="https://github.com/celery/celery/blob/master/celery/signals.py#L108" rel="nofollow noreferrer">source here</a>)</li>
  <li>then use my project's instantiated <code>app</code> ref and talk to the <code>DjangoFixup</code> interface <code>app._fixups[0]</code> <a href="https://github.com/celery/celery/blob/master/celery/app/base.py#L288" rel="nofollow noreferrer">here</a></li>
  <li>and try to manually call all the registered signal callbacks for the <code>DjangoFixupWorker</code> <a href="https://github.com/celery/celery/blob/master/celery/fixups/django.py#L123-L131" rel="nofollow noreferrer">here</a></li>
  </ol>
  <p>Any ideas on the steps to get this to work would be much appreciated?</p>