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

settings.APPEND_SLASH is ignored on subdomains #63

Open
lampslave opened this issue Jan 6, 2017 · 2 comments
Open

settings.APPEND_SLASH is ignored on subdomains #63

lampslave opened this issue Jan 6, 2017 · 2 comments

Comments

@lampslave
Copy link

Django raises 404 on http://subdomain.mydomain.com/mypage while http://subdomain.mydomain.com/mypage/ works as expected.

Pattern: r'^mypage/$'
Version: 1.4
Django: 1.8
Middleware order:

MIDDLEWARE_CLASSES = (
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
    'django.middleware.security.SecurityMiddleware',

    'django_hosts.middleware.HostsRequestMiddleware',

    'mymiddleware',

    'django_hosts.middleware.HostsResponseMiddleware',
)
@bak1an
Copy link
Contributor

bak1an commented Feb 12, 2017

@lampslave Try moving django_hosts.middleware.HostsRequestMiddleware to be before django.middleware.common.CommonMiddleware

@hheimbuerger
Copy link

Possibly related: it appears that django-hosts' reverse() function does not generate URLs with trailing slashes if APPEND_SLASH is set, while Django's reverse() function does so.

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