[postgis-users] banging my head on setting up and running geodjango

Smaran Harihar smaran.harihar at gmail.com
Wed Apr 25 09:33:47 PDT 2012


No actually the answer was i need to install the psycopg2 in the
virtual-env. It is finally working thanks.

The solution is here
http://stackoverflow.com/questions/10304367/unable-to-syncdb-in-geodjango-app#comment13263738_10304367

On Wed, Apr 25, 2012 at 6:16 AM, Travis Kirstine
<traviskirstine at gmail.com>wrote:

> I think you need to change the ENGINE to use the postgresql_psycopg2
> adapter
>
> 'ENGINE': 'django.contrib.gis.db.backends.postgresql_psycopg2', # Add
> 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
>
> Regards
>
>
>
>
> On 24 April 2012 13:21, Smaran Harihar <smaran.harihar at gmail.com> wrote:
> > how do I verify if my database is proper?
> >
> >
> > On Tue, Apr 24, 2012 at 10:14 AM, Smaran Harihar <
> smaran.harihar at gmail.com>
> > wrote:
> >>
> >> thanks for replying. I have attached the settings.py file
> >>
> >>
> >> On Tue, Apr 24, 2012 at 10:10 AM, Nabil Servais <
> nabil.servais at gmail.com>
> >> wrote:
> >>>
> >>> Could you post your settings.py please? I think it's a problem with the
> >>> database section.
> >>>
> >>> Le 24 avr. 2012 19:03, "Smaran Harihar" <smaran.harihar at gmail.com> a
> >>> écrit :
> >>>>
> >>>> Hi,
> >>>>
> >>>> I am really fed up in setting up and running GeoDjango.
> >>>>
> >>>> The first step was to setup the Spatial Database in PostGIS which I
> was
> >>>> really banging my head when it came to OS X. So i shifted to Ubuntu
> 11.10
> >>>> and it seemed it was quite easy. Now having completed the post
> installation
> >>>> process, I created the required changes that need to be done in the
> >>>> settings.py and now i am trying to,
> >>>>
> >>>> python manage.py sqlall world
> >>>>
> >>>> but it is returning a bunch of errors.
> >>>>
> >>>> (django-env)smaranh at ubuntu:~/geodjango$ python manage.py sqlall world
> >>>> Traceback (most recent call last):
> >>>>   File "manage.py", line 10, in <module>
> >>>>     execute_from_command_line(sys.argv)
> >>>>   File
> >>>>
> "/home/smaranh/django-env/local/lib/python2.7/site-packages/django/core/management/__init__.py",
> >>>> line 443, in execute_from_command_line
> >>>>     utility.execute()
> >>>>   File
> >>>>
> "/home/smaranh/django-env/local/lib/python2.7/site-packages/django/core/management/__init__.py",
> >>>> line 382, in execute
> >>>>     self.fetch_command(subcommand).run_from_argv(self.argv)
> >>>>   File
> >>>>
> "/home/smaranh/django-env/local/lib/python2.7/site-packages/django/core/management/__init__.py",
> >>>> line 261, in fetch_command
> >>>>     klass = load_command_class(app_name, subcommand)
> >>>>   File
> >>>>
> "/home/smaranh/django-env/local/lib/python2.7/site-packages/django/core/management/__init__.py",
> >>>> line 69, in load_command_class
> >>>>     module = import_module('%s.management.commands.%s' % (app_name,
> >>>> name))
> >>>>   File
> >>>>
> "/home/smaranh/django-env/local/lib/python2.7/site-packages/django/utils/importlib.py",
> >>>> line 35, in import_module
> >>>>     __import__(name)
> >>>>   File
> >>>>
> "/home/smaranh/django-env/local/lib/python2.7/site-packages/django/core/management/commands/sqlall.py",
> >>>> line 4, in <module>
> >>>>     from django.core.management.sql import sql_all
> >>>>   File
> >>>>
> "/home/smaranh/django-env/local/lib/python2.7/site-packages/django/core/management/sql.py",
> >>>> line 6, in <module>
> >>>>     from django.db import models
> >>>>   File
> >>>>
> "/home/smaranh/django-env/local/lib/python2.7/site-packages/django/db/__init__.py",
> >>>> line 40, in <module>
> >>>>     backend = load_backend(connection.settings_dict['ENGINE'])
> >>>>   File
> >>>>
> "/home/smaranh/django-env/local/lib/python2.7/site-packages/django/db/__init__.py",
> >>>> line 34, in __getattr__
> >>>>     return getattr(connections[DEFAULT_DB_ALIAS], item)
> >>>>   File
> >>>>
> "/home/smaranh/django-env/local/lib/python2.7/site-packages/django/db/utils.py",
> >>>> line 92, in __getitem__
> >>>>     backend = load_backend(db['ENGINE'])
> >>>>   File
> >>>>
> "/home/smaranh/django-env/local/lib/python2.7/site-packages/django/db/utils.py",
> >>>> line 44, in load_backend
> >>>>     raise ImproperlyConfigured(error_msg)
> >>>> django.core.exceptions.ImproperlyConfigured:
> >>>> 'django.contrib.gis.db.backends.postgis' isn't an available database
> >>>> backend.
> >>>> Try using django.db.backends.XXX, where XXX is one of:
> >>>>     'dummy', 'mysql', 'oracle', 'postgresql_psycopg2', 'sqlite3'
> >>>> Error was: No module named psycopg2.extensions
> >>>>
> >>>>
> >>>> Really need your help guys.
> >>>>
> >>>> --
> >>>> Thanks & Regards
> >>>> Smaran Harihar
> >>>>
> >>>>
> >>>> _______________________________________________
> >>>> postgis-users mailing list
> >>>> postgis-users at postgis.refractions.net
> >>>> http://postgis.refractions.net/mailman/listinfo/postgis-users
> >>>>
> >>>
> >>> _______________________________________________
> >>> postgis-users mailing list
> >>> postgis-users at postgis.refractions.net
> >>> http://postgis.refractions.net/mailman/listinfo/postgis-users
> >>>
> >>
> >>
> >>
> >> --
> >> Thanks & Regards
> >> Smaran Harihar
> >>
> >
> >
> >
> > --
> > Thanks & Regards
> > Smaran Harihar
> >
> >
> > _______________________________________________
> > postgis-users mailing list
> > postgis-users at postgis.refractions.net
> > http://postgis.refractions.net/mailman/listinfo/postgis-users
> >
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>



-- 
Thanks & Regards
Smaran Harihar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20120425/07245a13/attachment.html>


More information about the postgis-users mailing list