Raise 404 Error at SubdomainMiddleware if the project does not exist
@@ -69,6 +69,8 @@ class SubdomainMiddleware(object):
# Support ports during local dev
public_domain in host or public_domain in full_host
):
+ if Project.objects.filter(slug=subdomain).exists():
+ raise Http404(_('Project not found'))
request.subdomain = True
request.slug = subdomain
request.urlconf = SUBDOMAIN_URLCONF
