All Questions

Filter by
Sorted by
Tagged with
11
votes
4answers
2k views

Specifying Readonly access for Django.db connection object

I have a series of integration-level tests that are being run as a management command in my Django project. These tests are verifying the integrity of a large amount of weather data ingested from ...
3
votes
1answer
1k views

pandas to_sql in django: insert foreign key into DB

Is there a way to insert foreign keys when using pandas to_sql function? I am processing uploaded Consultations (n=40k) with pandas in django, before adding them to the database (postgres). I got this ...
2
votes
1answer
610 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 ...
1
vote
1answer
1k views

Postgresql date_trunc called in custom function through Django's connection.cursor()

I created a custom Postgresql function that performs some calculations and determines the beginning of a month by using the date_trunc function. When developing the custom function, I checked it from ...
0
votes
2answers
156 views

Migrating django database from sqlite to postgres error with psycopg2

I am trying to switch my django database from sqlite to postgres on my local machine. I am getting the following error when I try to run python manage.py migrate File "/Users/omarjandali/anaconda3/...
0
votes
1answer
9 views

Django.db.utils.ProgramingError Relation doesn't exist

I am using Django3 and Postgres as Database, I clone the old project using Django and postgres, I cloned and setup the virtual environment for my project. At the time of runserver, its throws me the ...
0
votes
0answers
65 views

Django 3.2 - django.db.utils.ProgrammingError: column "id" referenced in foreign key constraint does not exist

I am currently developping a django project, and I needed to move to PostgreSql databases. I did it just like this in my settings.py file: DATABASES = { 'default': { 'ENGINE' : 'django.db....
0
votes
0answers
17 views

How do I condense annotated queryset results based on a particular field?

Here's a fun one. Maybe someone can figure this out. Say I have a queryset something like the one below and want to get leads by month per company. Company.objects.annotate( month=TruncMonth('...