syncdb just hangs/tutorial

346 views
Skip to first unread message

L Corbani

unread,
Apr 11, 2011, 9:08:40 AM4/11/11
to Django users
I am new to django, and am running the tutorial. I have edited
'settings.py' and am running "python manage.py runserver".

When I run the server and then call "python manage.py syncdb" against
my Postgres database, everything just hangs.

If I kill 'runserver', then I get this message from syncdb:

site-packages/Django-1.3-py2.4.egg/django/db/backends/
postgresql_psycopg2/base.py
line 140

self.connection = Database.connect(**conn_params)
psycopg2.OperationalError: could not connect to server: Connection
refused

When I turn the server back on and run syncdb, it just hangs. I try
turning on verbose and other options...but I see nothing.

It seems like something is talking to the server, but that is as far
as it goes.

Any thoughts of what might be wrong?

Thanks.
Lori

Shawn Milochik

unread,
Apr 11, 2011, 9:31:32 AM4/11/11
to django...@googlegroups.com
Try it with sqlite3. If that works, then the problem is probably with
your Postgres setup.

Try interacting with Postgres using the psql command. It's likely that
you have some problem in the configuration.

jsierra

unread,
Apr 11, 2011, 9:47:08 AM4/11/11
to Django users
Can you provide information on what OS you are using? It may just be a
configuration issue. I had to edit the postgresql pg_hba.conf file on
my ubuntu setup to make it less strict (for development purposes).
https://help.ubuntu.com/community/PostgreSQL read on 'managing the
server' section to get an idea. Hope this helps.

Regards,
Joshua Sierra

L Corbani

unread,
Apr 11, 2011, 9:57:44 AM4/11/11
to Django users

Shawn,

In fact, it was an issue with my database settings. I changed the
host and now it is working. Thanks for helping me shift my brain a
bit this morning :)

Lori

Sam Walters

unread,
Apr 12, 2011, 2:19:59 AM4/12/11
to django...@googlegroups.com
Postgres uses a unix style user model. Its intuitive once you understand it:

I would seriously advise you to read the tutorial for this:

http://www.postgresql.org/docs/manuals/

FInd out the version you are using too.

Specifically:
1.2. Architectural Fundamentals
onwards.

That error just means you dont have user/passwords/groups set up
properly and postgres has wonderful documentation!
cheers

sam_w

> --
> You received this message because you are subscribed to the Google Groups "Django users" group.
> To post to this group, send email to django...@googlegroups.com.
> To unsubscribe from this group, send email to django-users...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
>
>

nishant kashyap

unread,
Apr 12, 2011, 3:10:55 AM4/12/11
to Django users
Check out once properly yor connection(Host, username,password,port)
in setting.py
Reply all
Reply to author
Forward
0 new messages