django-postgresql

How to debug “could not receive data from client: Connection reset by peer”

非 Y 不嫁゛ 提交于 2021-02-18 05:12:25
问题 I'm running a django-celery application on Ubuntu-12.04. When I run a celery task from my web interface, I get the following error, taken form postgresql-9.3 logfile (maximum level of log): 2013-11-12 13:57:01 GMT tss_usr 8113 LOG: could not receive data from client: Connection reset by peer tss_usr is the postgresql user of the django application database and (in this example) 8113 is the pid of the process who killed the connection, I guess. Have you got any idea on why this happens or at

How to debug “could not receive data from client: Connection reset by peer”

你。 提交于 2021-02-18 05:11:59
问题 I'm running a django-celery application on Ubuntu-12.04. When I run a celery task from my web interface, I get the following error, taken form postgresql-9.3 logfile (maximum level of log): 2013-11-12 13:57:01 GMT tss_usr 8113 LOG: could not receive data from client: Connection reset by peer tss_usr is the postgresql user of the django application database and (in this example) 8113 is the pid of the process who killed the connection, I guess. Have you got any idea on why this happens or at

Django: ProgrammingError relation does not exists

痴心易碎 提交于 2021-02-11 04:10:38
问题 To setup new database on heroku I tried python manage migrate and got many exceptions related to relation already exists/does not exists . So I followed the instructions here django 1.9: ProgrammingError: relation "users_user" does not exist but it didn't work. ~ $ django-admin showmigrations admin [ ] 0001_initial [ ] 0002_logentry_remove_auto_add auth [ ] 0001_initial [ ] 0002_alter_permission_name_max_length [ ] 0003_alter_user_email_max_length [ ] 0004_alter_user_username_opts [ ] 0005

Django: ProgrammingError relation does not exists

一曲冷凌霜 提交于 2021-02-11 04:07:55
问题 To setup new database on heroku I tried python manage migrate and got many exceptions related to relation already exists/does not exists . So I followed the instructions here django 1.9: ProgrammingError: relation "users_user" does not exist but it didn't work. ~ $ django-admin showmigrations admin [ ] 0001_initial [ ] 0002_logentry_remove_auto_add auth [ ] 0001_initial [ ] 0002_alter_permission_name_max_length [ ] 0003_alter_user_email_max_length [ ] 0004_alter_user_username_opts [ ] 0005

order_by on Many-to-Many field results in duplicate entries in queryset

帅比萌擦擦* 提交于 2021-02-07 07:21:59
问题 I am attempting to perform an order_by based a m2m field, but it ends up creating duplicate entries in my queryset. I have been searching through the django documentation and related questions on stack exchange, but I haven't been able to come up with any solutions. Models: class WorkOrder(models.Model): ... appointment = models.ManyToManyField(Appointment, null=True, blank=True, related_name = 'appointment_from_schedule') ... class Appointment(models.Model): title = models.CharField(max

How to start Postgres server? [closed]

我是研究僧i 提交于 2020-01-22 04:47:24
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . 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 server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "

Should I use ArrayField or ManyToManyField for tags

青春壹個敷衍的年華 提交于 2020-01-17 06:42:13
问题 I am trying to add tags to a model for a postgres db in django and I found two solutions: using foreign keys: class Post(models.Model): tags = models.ManyToManyField('tags') ... class Tag(models.Model): name = models.CharField(max_length=140) using array field: from django.contrib.postgres.fields import ArrayField class Post(models.Model): tags = ArrayField(models.CharField(max_length=140)) ... assuming that I don't care about supporting other database-backends in my code, what is a