Open Krischtopp opened 2 years ago
We faced the same issue recently.
UPD: In my case I got it locally when I had ALLOWED_HOSTS = ['*']
.
So there is a next code in the source:
def get_request(language=None):
"""
Returns a Request instance populated with cms specific attributes.
"""
request_factory = RequestFactory(HTTP_HOST=settings.ALLOWED_HOSTS[0])
request = request_factory.get("/")
request.session = {}
request.LANGUAGE_CODE = language or settings.LANGUAGE_CODE
# Needed for plugin rendering.
request.current_page = None
request.user = AnonymousUser()
request.toolbar = CMSToolbar(request)
return request
In my case it took first item from ALLOWED_HOSTS which is '*'
I have a context processor that calls
request.get_host()
in my project. Calling theupdate_index
management command results in the following exception:What is the
*
doing in there? I can't find anything in the configuration to change this.