mailman admin (django) interface does not work anymore after deleting website example.com
Hi,
I've just installed successfully mailman3 and started with basic configuration. When adding a new domain it gives me a link to a django admin page where I have to configure the available websites.
I deleted the existing "example.com" and added a new one "lists.mydomain.de".
Now the admin (django) interface always gives "An error occurred while processing your request". After one of the first navigation clicks I saw a message that "site with id 1 is missing".
Can you point me to where the problem is and how to solve it? Maybe it was not a good idea to delete the existing one, but I would have expected that django will prevent this, if it will fail afterwards.
Thanks and regards Torge
The logs:
Traceback (most recent call last): File "/opt/mailman/web/venv/lib/python3.6/site-packages/django/core/handlers/exception.py", line 34, in inner response = get_response(request) File "/opt/mailman/web/venv/lib/python3.6/site-packages/django/core/handlers/base.py", line 156, in _get_response response = self.process_exception_by_middleware(e, request) File "/opt/mailman/web/venv/lib/python3.6/site-packages/django/core/handlers/base.py", line 154, in _get_response response = response.render() File "/opt/mailman/web/venv/lib/python3.6/site-packages/django/template/response.py", line 106, in render self.content = self.rendered_content File "/opt/mailman/web/venv/lib/python3.6/site-packages/django/template/response.py", line 83, in rendered_content content = template.render(context, self._request) File "/opt/mailman/web/venv/lib/python3.6/site-packages/django/template/backends/django.py", line 61, in render return self.template.render(context) File "/opt/mailman/web/venv/lib/python3.6/site-packages/django/template/base.py", line 169, in render with context.bind_template(self): File "/usr/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/opt/mailman/web/venv/lib/python3.6/site-packages/django/template/context.py", line 246, in bind_template updates.update(processor(self.request)) File "/opt/mailman/web/venv/lib/python3.6/site-packages/django_mailman3/context_processors.py", line 32, in common context["site_name"] = get_current_site(request).name File "/opt/mailman/web/venv/lib/python3.6/site-packages/django/contrib/sites/shortcuts.py", line 13, in get_current_site return Site.objects.get_current(request) File "/opt/mailman/web/venv/lib/python3.6/site-packages/django/contrib/sites/models.py", line 60, in get_current return self._get_site_by_id(site_id) File "/opt/mailman/web/venv/lib/python3.6/site-packages/django/contrib/sites/models.py", line 32, in _get_site_by_id site = self.get(pk=site_id) File "/opt/mailman/web/venv/lib/python3.6/site-packages/django/db/models/manager.py", line 82, in manager_method return getattr(self.get_queryset(), name)(*args, **kwargs) File "/opt/mailman/web/venv/lib/python3.6/site-packages/django/db/models/query.py", line 399, in get self.model._meta.object_name django.contrib.sites.models.Site.DoesNotExist: Site matching query does not exist.
On 3/10/19 8:18 AM, Torge Riedel wrote:
I deleted the existing "example.com" and added a new one "lists.mydomain.de".
Now the admin (django) interface always gives "An error occurred while processing your request". After one of the first navigation clicks I saw a message that "site with id 1 is missing".
In your Django settings your have
SITE_ID = 1
which pointed to the example.com domain you deleted.
You need to override this in settings_local.py. Probably
SITE_ID = 2
but if that doesn't work, try '0'
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
Am 10.03.19 um 16:44 schrieb Mark Sapiro:
On 3/10/19 8:18 AM, Torge Riedel wrote:
I deleted the existing "example.com" and added a new one "lists.mydomain.de".
Now the admin (django) interface always gives "An error occurred while processing your request". After one of the first navigation clicks I saw a message that "site with id 1 is missing".
In your Django settings your have
SITE_ID = 1
which pointed to the example.com domain you deleted.
You need to override this in settings_local.py. Probably
SITE_ID = 2
but if that doesn't work, try '0'
Ah, thank you Mark. That makes a kind of sense. I changed the database directly to fix it. And renamed example.com to lists.mydomain.de. Now the error is gone.
I'm wondering why the initial database set up of postorius (?) adds "example.com". Is there a way to directly add my domain instead? Somewhere in settings_local.py?
On Sun, Mar 10, 2019, at 9:00 AM, Torge Riedel wrote:
Am 10.03.19 um 16:44 schrieb Mark Sapiro:
On 3/10/19 8:18 AM, Torge Riedel wrote:
I deleted the existing "example.com" and added a new one "lists.mydomain.de".
Now the admin (django) interface always gives "An error occurred while processing your request". After one of the first navigation clicks I saw a message that "site with id 1 is missing".
In your Django settings your have
SITE_ID = 1
which pointed to the example.com domain you deleted.
You need to override this in settings_local.py. Probably
SITE_ID = 2
but if that doesn't work, try '0'
Ah, thank you Mark. That makes a kind of sense. I changed the database directly to fix it. And renamed example.com to lists.mydomain.de. Now the error is gone.
I'm wondering why the initial database set up of postorius (?) adds "example.com". Is there a way to directly add my domain instead? Somewhere in settings_local.py?
Django does that and there doesn't seem to be a way to override that to something else during initial migration. Or nothing I have found yet.
Only way is to edit "example.com" to something you'd like or add another domain entry and change SITE_ID to point o that.
Mailman-users mailing list -- mailman-users@mailman3.org To unsubscribe send an email to mailman-users-leave@mailman3.org https://lists.mailman3.org/mailman3/lists/mailman-users.mailman3.org/
-- thanks, Abhilash Raj (maxking)
participants (3)
-
Abhilash Raj
-
Mark Sapiro
-
Torge Riedel