Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It doesn't work when I change the admin path #338

Open
admmello opened this issue Nov 30, 2021 · 3 comments
Open

It doesn't work when I change the admin path #338

admmello opened this issue Nov 30, 2021 · 3 comments

Comments

@admmello
Copy link

when I change the admin URL from

urlpatterns = [
    path('admin/', admin.site.urls),
    path('chaining/', include('smart_selects.urls')),
....

to

urlpatterns = [
    path('', admin.site.urls),
    path('chaining/', include('smart_selects.urls')),
....

django-smart-selects stops working. How can I fix this?

@pareshpandit
Copy link

pareshpandit commented Jun 10, 2022

Hi @admmello :
I know this question is now old, but since it was unanswered--there goes nothing :

It is strange, and I can not fathom with my limited knowledge of either of the projects at this point (i.e. your proj, and this git).

However, if it indeed is, as you seem to indicate it to be, I would take a wild guess and say that keeping both paths should resolve it ; kindly try:

urlpatterns = [
path('admin/', admin.site.urls),
path('', admin.site.urls),
path('chaining/', include('smart_selects.urls')),
....

@admmello
Copy link
Author

I found another way to solve this,
I created a view of path ('', home, name = 'home'), and inside the home.html I put an empty HTML with a meta to redirect automatically

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="Refresh" content="0; url={% url 'admin:login' %}" />
    <title>Title</title>
</head>
<body>
</body>
</html>

@jonimke
Copy link

jonimke commented Nov 16, 2022

Hey @admmello,
I had the same problem and was able to solve it by just changing the order in my urlpattern.

urlpatterns = [  
    re_path(r'^chaining/', include('smart_selects.urls')),  
    path('', admin.site.urls),
]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants