django - url with automatic slash adding
12,273
Try setting APPEND_SLASH to true in settings. On second thoughts, I think the default setting is true.
http://docs.djangoproject.com/en/dev/ref/settings/?from=olddocs
Author by
lukasz
Updated on June 13, 2022Comments
-
lukasz almost 2 years
I'm using django admin on my website. When I enter url without slash after admin (http://example.com/admin) I receive 404 error. I thought that django automatically added slash on the end of url. Of course when I enter url ended with slash it works fine. What I am doing wrong, or which settings I have to change. Thanks for any ideas.
-
lukasz over 13 yearsThanks for quick replay. I have put APPEND_SLASH into settings (commonmidelware also is putted) but unfortunately still the same. maybe mod_python has problem with redirecting from 'admin' into 'admin/'?
-
lukasz over 13 yearsI noticed that this happend to all link on my website. not olny admin. When I enter section name not ended with slash, slash didn't add automatically (the difference is that I don't have 404 but it is coused by rule in urls.py)
-
Sriram over 13 yearsDoes this happen when you use django's built in webserver or only when you run on Apache?
-
Dominic Rodger over 13 yearsStop using mod_python. I don't know if that's the reason you're having problems, but support for mod_python is deprecated and will be removed in Django 1.5 (docs.djangoproject.com/en/dev/howto/deployment/modpython).
-
lukasz over 13 yearsSriam, I have to check it. Now I only work on mod_python. Thanks. Dominic thanks for info, I will try to change server into mod_wsgi but it depends on my host provider.
-
lukasz over 13 yearsProblem has bessn solved. My mistake in urlsy.py. Thank you for your advieces.
-
Ahmed Wagdi about 2 years@lukasz can you tell what was the mistake because am having the same problem