I have a url structure in in Django like this:
urlpatterns = [
# ...
path('me/', profile_view, name='my_profile'),
path('<uuid:account_id>/', profile_view, name='user_profile')
]
and my profile_view is like this:
@login_required
def profile_view(request, account_id=None):
# ...
I want to use login required decorator to only require login if account_id = None? So, if someone goes to /accounts/me URL, the system must require authenticated user. Otherwise, the page should be accessible.