On 6/8/19 4:04 AM, Andrew Bernard wrote:
Where is the Django config area for the pip installed modules? It is this that I find obscure.
The short answer is wherever you put it. If you look at <https://wiki.list.org/DOC/Mailman%203%20installation%20experience> which Abhilash mentioned, you'll see what I do.
Abhilash mentioned creating the virtualenv in /opt/mailman/. I actually have another level below that, /opt/mailman/mm/, but this is only for convenience to separate things as I also have directories for the git branches and for local patches, so if we are just working with /opt/mailman/, you can put your Django settings.py and settings_local.py files there. I also put various other config things there like
Mailman's var/ directory Django's static/ directory mailman.cfg mailman-hyperkitty.cfg gunicorn.conf and an empty __init__.py file so Django can import settings.
Then I create a /opt/mailman/bin/ directory and in that I put small bash scripts to run things.
for example:
opt/mailman/bin/mailman contains
#!/bin/bash unset PYTHONSTARTUP
exec /opt/mailman/venv/bin/mailman
-C "/opt/mailman/mm/mailman.cfg"
$@
opt/mailman/bin/django-admin contains
#!/bin/bash . /opt/mailman/venv/bin/activate cd /opt/mailman/ export PYTHONPATH=/opt/mailman/ export DJANGO_SETTINGS_MODULE=settings django-admin $@
and opt/mailman/bin/gunicorn contains
#!/opt/mailman/venv/bin/python
import sys sys.path[0:0] = [ '/opt/mailman/', ]
import os os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
import gunicorn.app.wsgiapp
if __name__ == '__main__': sys.exit(gunicorn.app.wsgiapp.run())
Then I use those commands to run Mailman, Django and gunicorn. Some of this may not be directly applicable to you, but I hope it gives you the basic idea.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan