0
votes

(base) C:\Users\Laksh\PythonProjects\Django\PIFORMS>python manage.py runserver example:8080 Performing system checks...

System check identified no issues (0 silenced).

You have 15 unapplied migration(s). Your project may not work properly until you
apply the migrations for app(s): admin, auth, contenttypes, sessions.
Run 'python manage.py migrate' to apply them.
March 13, 2019 - 23:51:35
Django version 2.1.3, using settings 'PIFORMS.settings'
Starting development server at http://example:8080/
Quit the server with CTRL-BREAK.
Error: [Errno 11001] getaddrinfo failed

and my setting.py contains
ALLOWED_HOSTS = ['example']

1

1 Answers

0
votes

In example:8080, hostname example can obviously not be resolved. That's why you are getting this error. example points to nowhere. You have to use a hostname that can be resolved to an internal IP (127.0.0.1 or 0.0.0.0) (like localhost). Consider using localhost or if you really want to use example, add it to your hosts file.

Here are some useful instructions about editing hosts file in windows

https://gist.github.com/zenorocha/18b10a14b2deb214dc4ce43a2d2e2992