Tagged Questions
Use this tag for PostgreSQL issues which are to be solved in accordance with Django coding best practices.
0
votes
1answer
26 views
Does a reverse sql inspector exist for django & postgres
Does a reverse sql inspector exist for django & postgres? Something that shows you what is the origin of the sql view in django?
Something like this: https://github.com/rory/django-sql-inspector, ...
0
votes
1answer
77 views
+50
Django: m2m relationship is not getting updated in post_save signal
In my problem, the m2m relationship is not getting updated in post_save signal.
I have a post_save that checks to make sure that the user is a staff member and if they don't have default permissions, ...
0
votes
0answers
27 views
Django application “GeoNode” gives message “DLL load failed” on windows
I'm trying to install GeoNode which is a Django application on windows through these simple steps on this page. I've reached a point where is the GeoNode is installed and I've created my postgres ...
1
vote
1answer
34 views
Running python manage.py command from django with arguments
I have the command :
./manage.py dbbackup --clean --compress
provided by the django-dbbackup app which performs a backup of my PostgreSQL database to Amazon S3. I am trying to run this command ...
0
votes
0answers
33 views
django db-user should not be db-superuser. But south migrations need it [duplicate]
Most people give the django database user superuser privileges.
I am talking about the database access, not the auth_user table.
This db user can create new tables, alter the schema and so on.
But ...
0
votes
1answer
33 views
How to supply SQL functions and views required for testing Django app
I've created a file <APP>/<MODEL>.sql according to the Django docs in order to make use of a hook to pass arbitrary SQL after syncdb is run. Inside this file are two function declarations ...
1
vote
0answers
34 views
Django custom SQL operator
I am using Django 1.5.3 and PostgreSQL for my project. There are CIDR type fields in my tables and I wanted to model it in Django. I am using a CIDRField like ;
class CIDRField(models.Field):
def ...
0
votes
0answers
46 views
How to do two way One to One relationship in Django models?
I tried a lot for some solutions about it, but can't find any. I recently faced problem with my app model. It looks like this:
class A(models.Model):
group = models.OneToOneField(B)
class ...
0
votes
0answers
46 views
How do I properly change my database's password with Django?
I recently updated the user postgres' password (made it more complex). I went into the django settings.py and updated the password to the database there, however I am still getting a 500 error and the ...
1
vote
0answers
54 views
Reset Django database while running
I'm trying to reset my database while Django project's running but I'm having a trouble. Django is constantly interacting with the database due to his mapping between database and models.
I'm using ...
3
votes
1answer
68 views
'django_postgrespool' isn't an available database backend
After installing django_postgrespool and configuring my project accordingly, I received the following error:
Traceback (most recent call last):
File ...
1
vote
0answers
69 views
Isolating database when run multiple django test suites on Jenkins server
Our Jenkins test server runs several different test suites for a Django app, and several of these suites require that a Postgres database is present and seeded with data (e.g., integration tests, ...
0
votes
0answers
64 views
Django, Postgresql raise OperationalError
I working in Ubuntu 12.04, Django 1.5.1 and Postgresql 9.1 and suddenly i get an error
Exception Type: OperationalError
Exception Value: FATAL: cache lookup failed for access method 403
... what ...
1
vote
1answer
441 views
Error: No module named psycopg2.extensions django postgresql
I want to Use PostgreSQl With Django . I referred this tutorial to install it and when I run this command
python manage.py syncdb
I get the following errors
Traceback (most recent call last):
...
1
vote
1answer
87 views
How to distinctly bulk update all objects of a django model without iterating over them in python?
Basically can we achieve the same result without doing this:
from my_app import models
for prd,count in x.iteritems():
...
1
vote
1answer
131 views
Psycopg2 with postgreSQL & django
Mac OSX 10.8
Python 2.7 (installed with homebrew)
PostgreSQL 9.4 (installed with homebrew)
psycopg2 2.5 (installed with macports)
Django 1.0.4 (installed with homebrew)
I'm using this tutorial and ...
0
votes
0answers
54 views
Tried installing PostgreSQL on OSX for Django (using Postgres App), now python manage.py runserver not working
Wish there was an error message to follow up with. I can syncdb with the new db as Postgres, but I can't use runserver. Running python manage.py runserver just returns on the command line and doesn't ...
0
votes
0answers
79 views
Django signal database change on template
I'm building a GPS Tracking System using Django, i should have a grid on my template that display real time information of cars (position,vitesse, temperature...). GPS send data to Postgres DataBase ...
1
vote
2answers
244 views
Django Query extremely slow
i got a problem with an Django application. Queries on the model Scope are extremly slow and after some debugging i still got no clue where the problem is.
When i query the db like scope = ...
1
vote
0answers
144 views
why postgreSQL can't find foreign key
Why django reports a "missing foreign key error" when creating a record referencing a key just created ?
have a look a this code:
def doRegister(request,username, email, password):
user = ...
0
votes
0answers
59 views
Read CSV File in Django and then write it to DB Postgresql
How can I read a CSV file, parse the values, and then output it to a particular database table?
That's the basic problem.
Here is a 'bigger picture' of what I'm trying to do:
I'm trying to either ...
2
votes
0answers
143 views
South failing to perform migration for tastypie api key tables
I'm trying to perform a database migration to create the necessary tables for API Key authentication via tastypie and south. This requires that I run python manage.py migrate tastypie. The output is:
...
0
votes
0answers
121 views
Getting error column “data” specified more than once
On local machine, an app is working fine (uses sqlite db). But when deployed on Heroku (postgresql db) it is causing the following error
column "data" specified more than once
LINE 1: ...
1
vote
0answers
32 views
django database routing with transactions
Referring to the example in Django documentation for multiple databases in one application,
https://docs.djangoproject.com/en/dev/topics/db/multi-db/#an-example
" It also doesn’t consider the ...
0
votes
0answers
44 views
Is there a way to use Django introspection with schemas
I have a database with four schemas. I've used PostGres' 'SET search_path' command to look at them all so that:
psql -d pngris -c "SHOW search_path"
(my database being 'pngris') results in :
...
3
votes
2answers
97 views
Failure with syncdb --migrate on PostgreSQL database. Circular Dependency
I'm trying to create an empty copy of my Django database using the command
manage.py syncdb --migrate --database=<db_copy_name>
It works fine if the database is a sqlite3 database, but fails ...
1
vote
0answers
88 views
What's the right way to do a Django/South/PostgreSQL migration from calculated-as-needed summary values to maintained-in-database summary values?
My Django app has a User model, those Users have many Transactions. Some of my views display a summary (summation) of all transaction amounts, let's call it the 'total'. So far, this has been tallied ...
1
vote
0answers
103 views
Django ManyToMany Unique Instances count
I have a table of teams:
class teams(models.Model):
POSITIONNUMBERS = ((1,'1'), (2,'2'), (3,'3'),)
members = models.ManyToManyField(character, through='teamMember')
user = ...
1
vote
0answers
365 views
postgresql idle connections with django (and gunicorn+gevent)
My stack incudes django (1.4.3), psycopg2 (0.0.3), and postgres (9.1). Additionally, I am using psycogreen.gevent.patch_psycopg because I am serving up my django with gunicorn and gevent.
...
0
votes
0answers
73 views
SQL Index on Django Generic Relation
Is it possible/sensible to create an SQL index on a GenericForeignKey in a Django model?
I want to perform a lookup on a large number of (~1 million) objects in my postgreSQL database. My lookup is ...
0
votes
1answer
107 views
Django syncdb - How does it know if it previously created the tables or if I did?
I manually created some tables in Postgre for a Django project. I manually created the model too. When I try to syncdb, it throws a database error and says the table already exists.
If syncdb creates ...
1
vote
0answers
107 views
Django long running scripts and DB CPU usage
I running a script that uses Django ORM. The script runs for long time sometimes more than three days. Script looks like below
from app.models import *
for i in some_simpe_select():
...
5
votes
1answer
330 views
Django - How to get debug info of DatabaseError “current transaction is aborted” in Django error page?
While developing on my Django project I'm getting a DatabaseError that says:
current transaction is aborted, commands ignored until end of
transaction block
I know this happens because there ...
1
vote
0answers
121 views
Django-Axes causing DatabaseError - Transaction Block (solved)
So I've updated django to 1.4.5 and postgres to 9.2.3 and psycopg2 to 2.4.6 . I runserver and everything looks ok, but when i go to localhost:8000 i see the infamous 'current transaction aborted..' on ...
0
votes
1answer
472 views
Postgres is ruining my life [closed]
Ive actually had this problem for a while but I've finally decided to take it on. Postgres was initially installed using Brew.
After my upgrade to OSX 10.8.2 to receive a
psql: could not connect to ...
0
votes
0answers
77 views
DB error with PostgreSQL and PostGIS
When I'm trying to get data saved to database (location) I get http 500 error. I've tracked the error to be related my database (runs on Postgres.app on Mac).
The console outputs following error:
...
0
votes
0answers
92 views
Atomic database operations in Django 1.4
This question is similar to Atomic operations in Django? however for Django 1.4. I'm wondering if there is a way to do this without resorting to "raw SQL". My setup is a little different then his so ...
1
vote
2answers
188 views
Point manage.py to a specific PostegreSQL schema
How can I tell manage.py to operate in a specific PostgreSQL schema?
My database is separated into multiple schema, one per client/deployment, to keep data separate.
However, it seems that Django ...
1
vote
1answer
358 views
Django saving form strings in database with extra characters (u'string')
I've been having problems in django while trying to save the form.cleaned_data in a postgres database.
user_instance.first_name = form.cleaned_data['first_name']
the data is being saved this way ...
3
votes
1answer
465 views
Django creates the test database for Postgresql with incorrect sequences start values
Using pyscopg2, as Django database default backend, and with very simple case for a test. It fails trying to create a user, with a IntegrityError exception
$ python manage.py test project.core.tests
...
3
votes
1answer
301 views
Avoid RETURN postgresql statment in django1.4 and postgresql 8.1 related to bug #10467
A few days ago I write a project in django1.4 using the admin capabilities with the intention to make a CRUD for debug data migrated from a legacy system to a new system (the migration wasn't entirely ...
0
votes
1answer
33 views
postgres + GeoDajango - data doesn't seem to save
I have a small python script that pushes data to my django postgres db.
It imports the relevant model from a django project and uses the .save function to save the data to the db without issue.
...
1
vote
1answer
1k views
django/postgresql setup - psycopq2.OperationalError
I'm getting a 'psycopq2.OperationalError' when executing: python manage.py syncdb.
The postgresql server seems to be up and running when tested with a djangostack script.
Anyone run across this? Just ...