On 1/30/23 10:32, Jeremy Stanley wrote:
I'm not having any luck finding an API or CLI which I can use to create sites and domains rather than manually doing it in the Django admin WebUI. Does such a thing exist, or an I going to need to resort to directly performing database inserts (which I'd rather avoid since it could break if the schema changes). It appears there's a foreign key relationship involved, which could make DB manipulation like this even more fragile.
Domains can be created via Postorius or via the Mailman Core REST API
that postorius uses or implicitly by the mailman create
command when
creating a list in a new domain. However, none of this can create a new
site. You can do this through the Django admin site at sites/site/add/.
See https://docs.djangoproject.com/en/4.1/ref/contrib/sites/ for methods you can use to do this programmatically.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan