Witam. Ostatnio uczę się Pythona. Chciałem przetestować Django. Robiłem wszystko według poradnika Riklaunima (Wprowadzenie do Django 1.0 - Tworzymy prostego bloga). Jednak od razu napotkałem na problem. Po uruchomieniu skryptu poprzez:
modry:/home/modry/django/blog1# python manage.py runserver
Validating models...
0 errors found
Django version 1.1, using settings 'blog1.settings'
Development server is running at [url]http://127.0.0.1:8000/[/url]
Quit the server with CONTROL-C.
Error: That IP address can't be assigned-to.
Próbowałem uruchomić to jako root i jako zwykły użytkownik i nic. Co może powodować ten błąd?
W Google nie mogę odnaleźć niczego o tym.
Spróbuj wywołać runserver z innym adresem ip, to znaczy nie z localhostem/loopbackiem tylko np. z twoim adresem zewnętrznym (np. 10.0.0.1 jeżeli jesteś w sieci wewnętrznej) i potem spróbuj połączyć się do tego adresu zewnętrznego na port 8000 .
Taki problem może być spowodowany błędnie skonfigurowanym interfejsem loopback, złymi uprawnieniami dostępu do niego lub złymi regułkami firewalla.
modry@modry:~$ cd ./django/blog1
modry@modry:~/django/blog1$ python manage.py runserver
Validating models...
0 errors found
Django version 1.1, using settings 'blog1.settings'
Development server is running at [url]http://127.0.0.1:8000/[/url]
Quit the server with CONTROL-C.
[color=red]Error: That IP address can't be assigned-to.[/color]
modry@modry:~/django/blog1$ python manage.py runserver 127.0.0.1:8080
Validating models...
0 errors found
Django version 1.1, using settings 'blog1.settings'
Development server is running at [url]http://127.0.0.1:8080/[/url]
Quit the server with CONTROL-C.
[color=red]Error: That IP address can't be assigned-to.[/color]
modry@modry:~/django/blog1$ python manage.py runserver localhost:8080
Validating models...
0 errors found
Django version 1.1, using settings 'blog1.settings'
Development server is running at [url]http://localhost:8080/[/url]
Quit the server with CONTROL-C.
[color=red]Error: That IP address can't be assigned-to.[/color]
modry@modry:~/django/blog1$ python manage.py runserver localhost:8000
Validating models...
0 errors found
Django version 1.1, using settings 'blog1.settings'
Development server is running at [url]http://localhost:8000/[/url]
Quit the server with CONTROL-C.
[color=red]Error: That IP address can't be assigned-to.[/color]
modry@modry:~/django/blog1$ python manage.py runserver 10.0.0.1:8000
Validating models...
0 errors found
Django version 1.1, using settings 'blog1.settings'
Development server is running at [url]http://10.0.0.1:8000/[/url]
Quit the server with CONTROL-C.
[color=red]Error: That IP address can't be assigned-to.[/color]
modry@modry:~/django/blog1$ python manage.py runserver 10.0.0.1
[color=red]Error: '10.0.0.1' is not a valid port number.[/color]
modry@modry:~/django/blog1$ python manage.py runserver 10.0.0.1:8000
Validating models...
0 errors found
Django version 1.1, using settings 'blog1.settings'
Development server is running at [url]http://10.0.0.1:8000/[/url]
Quit the server with CONTROL-C.
[color=red]Error: That IP address can't be assigned-to.[/color]
modry@modry:~/django/blog1$ python manage.py runserver 127.0.1.1:8000
Validating models...
0 errors found
Django version 1.1, using settings 'blog1.settings'
Development server is running at [url]http://127.0.1.1:8000/[/url]
Quit the server with CONTROL-C.
[color=red]Error: That IP address can't be assigned-to.[/color]
modry@modry:~/django/blog1$ su
Hasło:
modry:/home/modry/django/blog1# python manage.py runserver
Validating models...
0 errors found
Django version 1.1, using settings 'blog1.settings'
Development server is running at [url]http://127.0.0.1:8000/[/url]
Quit the server with CONTROL-C.
[color=red]Error: That IP address can't be assigned-to.[/color]
modry:/home/modry/django/blog1# python manage.py runserver localhost
[color=red]Error: 'localhost' is not a valid port number.[/color]
modry:/home/modry/django/blog1# python manage.py runserver localhost:8000
Validating models...
0 errors found
Django version 1.1, using settings 'blog1.settings'
Development server is running at [url]http://localhost:8000/[/url]
Quit the server with CONTROL-C.
[color=red]Error: That IP address can't be assigned-to.[/color]
modry:/home/modry/django/blog1# python manage.py runserver localhost:8080
Validating models...
0 errors found
Django version 1.1, using settings 'blog1.settings'
Development server is running at [url]http://localhost:8080/[/url]
Quit the server with CONTROL-C.
[color=red]Error: That IP address can't be assigned-to.[/color]
modry:/home/modry/django/blog1# python manage.py runserver 127.0.0.1:8000
Validating models...
0 errors found
Django version 1.1, using settings 'blog1.settings'
Development server is running at [url]http://127.0.0.1:8000/[/url]
Quit the server with CONTROL-C.
[color=red]Error: That IP address can't be assigned-to.[/color]
modry:/home/modry/django/blog1# python manage.py runserver 127.0.1.1:8000
Validating models...
0 errors found
Django version 1.1, using settings 'blog1.settings'
Development server is running at [url]http://127.0.1.1:8000/[/url]
Quit the server with CONTROL-C.
[color=red]Error: That IP address can't be assigned-to.[/color]
modry:/home/modry/django/blog1# python manage.py runserver 10.0.0.1:8000
Validating models...
0 errors found
Django version 1.1, using settings 'blog1.settings'
Development server is running at [url]http://10.0.0.1:8000/[/url]
Quit the server with CONTROL-C.
[color=red]Error: That IP address can't be assigned-to.[/color]
modry:/home/modry/django/blog1#
Zauważyłem też, że serwer OTS też nie chce działać (nie nasłuchuje) - łączę się z localhost albo z 127.0.0.1 albo nawet 127.0.1.1 i nic. Co może blokować?
debian:/home/pawel/mojprojekt# ./manage.py runserver 192.168.1.102:8000
Validating models...
0 errors found
Django version 1.1.1, using settings 'mojprojekt.settings'
Development server is running at [url]http://192.168.1.102:8000/[/url]
Quit the server with CONTROL-C.
Serwer niby jest odpalony ale w przeglądarce nie wyświetla się żadna strona. O co może chodzić?
debian:/home/pawel/mojprojekt# ./manage.py runserver 192.168.1.102:8000
Validating models...
0 errors found
Django version 1.1.1, using settings 'mojprojekt.settings'
Development server is running at [url]http://192.168.1.102:8000/[/url]
Quit the server with CONTROL-C.