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

Add support for wildcard hosts #10

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

RealOrangeOne
Copy link
Contributor

It's often necessary to support multiple hosts for a single Django application. This PR reuses the implementation for ALLOWED_HOSTS in allowing ROBOTS_ALLOW_HOSTS to specify multiple hostnames to allow.

This change is backwards compatible.

@j4mie
Copy link
Member

j4mie commented Jan 21, 2023

Sorry for the massive delay in responding to this! If I understand correctly, this is to support a single Django application which serves content under multiple hostnames, and you want to allow robots access to some hostnames but disallow others?

To be honest I feel like that is probably slightly stretching the definition of "simple", and that you should probably just implement this in your application. Changing the core setting for the project makes me a bit twitchy, backwards-compat or not.

Let me know if I've misunderstood the use case..

@RealOrangeOne
Copy link
Contributor Author

Nope, that's exactly it! Having 1 django app serve multiple hosts is quite common, whether they serve different content or the same.

I agree it stretches the definition slightly, but for a low-overhead and generally useful feature (I realise that's literally the definition of scope creep...).

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

Successfully merging this pull request may close these issues.

2 participants