MakeMonmouth/mventory

Not working, 400

Closed this issue · 4 comments

After starting mventory according to the guide, I get an HTTP 400 error when doing any request to the server

@OmegaRogue can you provide the server logs please?

If you set MVENTORY_DEBUG to True and restart the service you should see the debug logs.

Once you've posted those here I'll be able to see what's going on :)

these are the logs: https://dpaste.com/4HS4SNQWB
I've also tried it on another system, same results

@OmegaRogue thanks.

The error message is at the bottom of that output:

Exception Type: DisallowedHost at /
Exception Value: Invalid HTTP_HOST header: '127.0.0.1:8000'. You may need to add '127.0.0.1' to ALLOWED_HOSTS.

That relates to https://docs.djangoproject.com/en/3.2/ref/settings/#allowed-hosts and you'll need to set that in settings.py in order for this or any other Django-based app to work.

It's a good catch though, I'll update the documentation when I get a chance to include this.

@OmegaRogue note that setting MVENTORY_HOSTNAME in the environment variable will achieve the same thing.

I've just updated the README to reflect this.