On 12/25/22 01:14, Odhiambo Washington wrote:
On Sat, Dec 24, 2022 at 9:40 PM Mark Sapiro <mark@msapiro.net> wrote:
How about https://mm3-lists.kictanet.or.ke/user_profile/ ?
I have uncommented the line "WSGIScriptAlias /user-profile /opt/mailman/mm/wsgi.py", I don't see any definition for it in urls.py as well. Perhaps that's the issue?
It is defined in django_mailman3/urls.py which is referenced by
re_path(r'', include('django_mailman3.urls')),
When I uncomment /user-profile, I end up with an ugly URL: https://mm3-lists.kictanet.or.ke/user-profile/user-profile/
So instead of aliasing the /user-profile, I have decided to add another definition to urls.py: re_path(r'^user-profile/', include('allauth.urls')), Which I think gives me a cleaner URL: https://mm3-lists.kictanet.or.ke/user-profile/login/?next=/user-profile/
It shouldn't include allauth.urls
. That URL is appropriate if you
aren't logged in, but what do you get when you are?
Go to https://lists.mailman3.org/user-profile/ and log in if necessary and you'll see what it should look like.
I also had to alias /accounts, which then brings me to: https://mm3-lists.kictanet.or.ke/accounts/mailman3/lists/ - which I believe is fine because one gets the option to either login or signup.
And I think that "/account" and "/user-profile" are synonymous.
They are in your instance because of
re_path(r'^user-profile/', include('allauth.urls')),
but they should not be.
It's a mod_wsgi thing. I haven't used mod_wsgi for Mailman for some time (I now use gunicorn on all the sites I manage), but when I did I think I had
WSGIScriptAlias /mm3 /opt/mailman/mm/wsgi.py
and all the URLs were like https://example.com/mm3/mailman3/..., https://example.com/mm3/archives/..., etc.
I already had gunicorn working too, but I just need to also figure out this mod_wsgi.
Why? Intellectual curiosity or do you have an actual need.
The bottom line is with mod_wsgi, whatever you have in your WSGIScriptAlias is going to be prepended to the URL path. If you don't want anything prepended, you need
WSGIScriptAlias / /opt/mailman/mm/wsgi.py
but then in order for user-profile to work, you need to replace
re_path(r'', include('django_mailman3.urls')),
in urls.py with the urlpatterns from django_mailman3/urls.py
re_path(r'^user-profile/delete$', delete_account,
name='mm_user_account_delete'),
re_path(r'^user-profile/$', user_profile, name='mm_user_profile'),
and also add
from django_mailman3.views.profile import delete_account, user_profile
to the imports in urls.py
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan