django Error: That IP address can‘t be assigned to

created at 06-25-2021 views: 2

Operating environment:

  • System: Ali Cloud Ubuntu 18.04.3 LTS (GNU / Linux 4.15.0-52-generic x86_64)
  • python: python3
  • mysql: 5.7.27-0ubuntu0.18.04.1 (Ubuntu)
  • mysql-client: 5.7.27-0ubuntu0.18.04.1 (Ubuntu)

error description:

when launch the Django program (python manage.py runserver), getting this error:

That IP address can't be assigned to.

Solution:

Set ALLOWED_HOSTS in settings.py, such as

ALLOWED_HOSTS = ['47.244.35.68','localhost', '47.244.35.68:10001', '127.0.0.1','stdworkflow.com']

Then change python manage.py runserver to python manage.py runserver 0:10001 (10001 is an open port) when startup. 

problem solved.

Please log in to leave a comment.