On Mon, 27 Jul 2020 at 02:01, Mark Sapiro <mark@msapiro.net> wrote:
On 7/26/20 9:39 AM, Odhiambo Washington wrote:
Hi,
In my quest to create a superuser, I followed another HOWTO - https://docs.mailman3.org/en/latest/devsetup.html
(venv) [root@gw /opt/mailman/git/mailman-suite/mailman-suite_project]# python manage.py migrate Traceback (most recent call last):
manage.py migrate (or django-admin migrate) is part if the mailman-post-update script. It doesn't work here because when you run it this way, it doesn't get your settings.py.
I have taken note of that. Thank you.
ModuleNotFoundError: No module named '_sqlite3'
*<==============================================================* (venv) [root@gw /opt/mailman/git/mailman-suite/mailman-suite_project]#
And it's looking for sqlite3 because that's the default database. pip
install pysqlite3
You don't need this. You need to run django-admin with the correct settings.
Thanks for clarifying.
So I figured out that I need to put my own settings_local.py into the
directory and let the command rely on MySQL as the database backend since by default, it uses sqlite3 backend.
But the question then is WHY is this not documented on the above page???
Because that's not relevant to what you are doing. You are trying to install Mailman for production, not development.
Okay. That is true.
How can I delete the superuser after creating it??
The only django-admin or manage.py you should run is /opt/mailman/mm/bin/djhango-admin. You can run
django-admin createsuperuser
to create a superuser. If you want to delete one, you need to go to the Django admin web UI - should be http://your.server/admin - login as a superuser and go to the Users page and delete it. You should probably do this as a different superuser
The reason I asked for how to delete superuser came from the fact that from the above confusion, I needed to create a superuser.
So now I have tried to see if there is such option from django-admin, but:
(venv) [root@gw /opt/mailman/mm]# django-admin --help
Type 'django-admin help <subcommand>' for help on a specific subcommand.
Available subcommands:
[django] check compilemessages createcachetable dbshell diffsettings dumpdata flush inspectdb loaddata makemessages makemigrations migrate runserver sendtestemail shell showmigrations sqlflush sqlmigrate sqlsequencereset squashmigrations startapp startproject test testserver *Note that only Django core commands are listed as settings are not properly configured (error: Requested setting INSTALLED_APPS, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.).* (venv) [root@gw /opt/mailman/mm]#
So is something wrong with my settings???? I do not see the command to create the superuser listed.
My settings_local.py has got only the bits from settings.py that I have customized.
Thank you for your patience.
-- Best regards, Odhiambo WASHINGTON, Nairobi,KE +254 7 3200 0004/+254 7 2274 3223 "Oh, the cruft.", grep ^[^#] :-)