Note that there are some explanatory texts on larger screens.

plurals
  1. POsetting up Postgresql 9.1 database in Django for ubuntu 11.10
    text
    copied!<p><br> I am trying to configure Postgresql 9.1 in Django 1.3 . <br> Note: I am doing this in Ubuntu 11.10 (oneric). Also I have postgis 1.5 installed to work with Postgresql 9.1<br></p> <p>To my best knowledge, I have installed all the dependencies required.<br> I read the instructions from <a href="http://haineault.com/blog/166/" rel="nofollow noreferrer">this</a> blog also.</p> <p>On doing the following:</p> <pre><code>python manage.py syncdb </code></pre> <p>I am getting this error stack.</p> <pre><code>Traceback (most recent call last): File "manage.py", line 23, in &lt;module&gt; execute_manager(settings) File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 438, in execute_manager utility.execute() File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 379, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 261, in fetch_command klass = load_command_class(app_name, subcommand) File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 67, in load_command_class module = import_module('%s.management.commands.%s' % (app_name, name)) File "/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py", line 35, in import_module __import__(name) File "/usr/local/lib/python2.7/dist-packages/south/management/commands/__init__.py", line 10, in &lt;module&gt; import django.template.loaders.app_directories File "/usr/local/lib/python2.7/dist-packages/django/template/loaders/app_directories.py", line 23, in &lt;module&gt; raise ImproperlyConfigured('ImportError %s: %s' % (app, e.args[0])) django.core.exceptions.ImproperlyConfigured: ImportError {ProjectName}.{ModuleName}: No module named postgresql.operations </code></pre> <p>In local_settings.py, I have set engine name as 'django.db.backends.postgresql_psycopg2'.</p> <p>However after referring to <a href="https://stackoverflow.com/questions/5394331/how-to-setup-postgresql-database-in-django">this</a>, I set the engine name to 'django.contrib.gis.db.backends.postgis' , I get the following error stack:</p> <pre><code> Traceback (most recent call last): File "manage.py", line 23, in &lt;module&gt; execute_manager(settings) File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 438, in execute_manager utility.execute() File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 379, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 261, in fetch_command klass = load_command_class(app_name, subcommand) File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 67, in load_command_class module = import_module('%s.management.commands.%s' % (app_name, name)) File "/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py", line 35, in import_module __import__(name) File "/usr/local/lib/python2.7/dist-packages/south/management/commands/__init__.py", line 10, in &lt;module&gt; import django.template.loaders.app_directories File "/usr/local/lib/python2.7/dist-packages/django/template/loaders/app_directories.py", line 21, in &lt;module&gt; mod = import_module(app) File "/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py", line 35, in import_module __import__(name) File "/home/jigish/jigbox/dev/mangrove/datawinners/datawinners/../datawinners/accountmanagement/__init__.py", line 3, in &lt;module&gt; from datawinners.accountmanagement.post_registration_events import ngo_user_created File "/home/jigish/jigbox/dev/mangrove/datawinners/datawinners/../datawinners/accountmanagement/post_registration_events.py", line 3, in &lt;module&gt; from datawinners.accountmanagement.models import NGOUserProfile File "/home/jigish/jigbox/dev/mangrove/datawinners/datawinners/../datawinners/accountmanagement/models.py", line 5, in &lt;module&gt; from django.db import models File "/usr/local/lib/python2.7/dist-packages/django/db/__init__.py", line 78, in &lt;module&gt; connection = connections[DEFAULT_DB_ALIAS] File "/usr/local/lib/python2.7/dist-packages/django/db/utils.py", line 93, in __getitem__ backend = load_backend(db['ENGINE']) File "/usr/local/lib/python2.7/dist-packages/django/db/utils.py", line 51, 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 postgresql.operations </code></pre> <p>I even ensured, I have the postgis installed (Postgresql-9.1-postgis).</p> <p>Where am I going wrong? What am I missing? These are my early days working with Python, Django and Postgresql and Postgis. <br> Kindly point out any related helpful links on the web. I tried Googling but till now got no success.<br></p> <p>Thanks and Regards</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload