I a Django virgin and am trying to get a sample development server up
and running on Linux.
I can run the Django server fine, and when I go to the admin URL I get
the admin logon page.
However, when I try to logon I get an error:
"Looks like your browser isn't configured to accept cookies. Please
enable cookies, reload this page, and try again".
This fails for both Safari and IE7 browsers.
Both browsers have cookies enabled (before you ask!).
However, if I access the server by IP address rather than name (http://
172.19.1.82:8080/admin/ rather than
http://msd_pbtest:8080/admin/)
then I can login with no problems.
I'm starting to suspect it must be something to do with the hostname
configuration on my Linux server.
Any suggestions as to what could be misconfigured, or what could cause
this problem?
Django: 0.96.2
Server: CentOS5.1
[admin@msd_pbtest pestfvmon]$ python manage.py runserver
172.19.1.82:8080
Validating models...
0 errors found.
Django version 0.96.2, using settings 'pestfvmon.settings'
Development server is running at
http://172.19.1.82:8080/
Quit the server with CONTROL-C.
[admin@msd_pbtest pestfvmon]$ uname -a
Linux msd_pbtest 2.6.18-53.1.14.el5.centos.plus #1 SMP Fri Mar 7
08:37:13 EST 2008 i686 i686 i386 GNU/Linux
[admin@msd_pbtest pestfvmon]$ more /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6
I originally had my hostname in /etc/hosts, but tried removing this as
I thought it might be causing the problem:
[admin@msd_pbtest pestfvmon]$ more /etc/hosts.original
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 msd_pbtest localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6
[admin@msd_pbtest pestfvmon]$ host msd_pbtest
msd_pbtest.datcon.co.uk has address 172.19.1.82
[admin@msd_pbtest pestfvmon]$ ping msd_pbtest
PING
msd_pbtest.datcon.co.uk (172.19.1.82) 56(84) bytes of data.
64 bytes from
172.19.1.82: icmp_seq=1 ttl=64 time=0.035 ms
64 bytes from
172.19.1.82: icmp_seq=2 ttl=64 time=0.048 ms
In settings.py I have:
...
MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
# 'django.middleware.doc.XViewMiddleware',
)
...
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.admin',
'pestfvmon.pestfv',
)