Django postgres high availability

2020-12-29 Thread Mohammed Alnajdi
Greetings Have anyone got postgres with high availability setup to work with django ? If yes can you please share any resources on how to do the right configuration? Thanks Sent from my iPhone -- You received this message because you are subscribed to the Google Groups "Django users" group

Re: Django Postgres Intermediary doesn't set ON DELETE CASCADE

2018-06-25 Thread Simon Charette
Hey James, Just to add to what was already said there's a ticket tracking the addition of database level foreign constraints.[0] Cheers, Simon [0] https://code.djangoproject.com/ticket/21961 Le samedi 23 juin 2018 09:56:23 UTC-4, Tomasz Knapik a écrit : > > If you search about it on the Intern

Re: Django Postgres Intermediary doesn't set ON DELETE CASCADE

2018-06-23 Thread James Bellaby
Indeed! I have actually used the admin site to do it before I posted this it's just something I didn't know was by design. After numerous searches I came here but I may have been asking the wrong questions in google :). The shell would be good if I have quite a few I need to delete. Thankfully

Re: Django Postgres Intermediary doesn't set ON DELETE CASCADE

2018-06-23 Thread Tomasz Knapik
If you search about it on the Internet many sources claim that Django does not set those constraints on the database level. If you look at the code of the base code for database backends, you'll notice that they don't mention on_delete at all. - https://github.com/d jango/django/blob/6dd4edb1b4f54

Re: Django Postgres Intermediary doesn't set ON DELETE CASCADE

2018-06-23 Thread Jason
well, nothing stopping you from doing the same in the django shell and doing `Group.objects.get(pk = some_pk).delete`. that would be an alternative for going straight to the db. I can see some issues with this coming up, especially if you're doing deletes with django's raw sql capability. But

Re: Django Postgres Intermediary doesn't set ON DELETE CASCADE

2018-06-23 Thread James Bellaby
OK. So it's by design. So during development I can't go straight to the database and delete a "Group" quickly due to an error I made. I'd have to set up tests to deal with it at an application level. No probs though. I'm just happy I know it can't be done and not that it's a bug I'd have to wa

Re: Django Postgres Intermediary doesn't set ON DELETE CASCADE

2018-06-23 Thread Melvyn Sopacua
On zaterdag 23 juni 2018 14:40:30 CEST Jason wrote: > Not quite. If you run python manage.py sqlmigrate > , you can see the SQL generated for that migration. > > https://docs.djangoproject.com/en/2.0/ref/django-admin/#django-admin-sqlmigr > ate > > Because Django emulates Cascade, its done outs

Re: Django Postgres Intermediary doesn't set ON DELETE CASCADE

2018-06-23 Thread Jason
Not quite. If you run python manage.py sqlmigrate , you can see the SQL generated for that migration. https://docs.djangoproject.com/en/2.0/ref/django-admin/#django-admin-sqlmigrate Because Django emulates Cascade, its done outside of the db, and therefore shouldn't be a db-level constraint.

Re: Django Postgres Intermediary doesn't set ON DELETE CASCADE

2018-06-23 Thread James Bellaby
OK, understood. However, If you set up CASCADE on the model surely when it creates the table on the database level it surely should set ON DELETE CASCADE not ON DELETE NO ACTION on the CONSTRAINT? On Saturday, 23 June 2018 10:54:44 UTC+1, Melvyn Sopacua wrote: > > On zaterdag 23 juni 2018 00:56:

Re: Django Postgres Intermediary doesn't set ON DELETE CASCADE

2018-06-23 Thread Melvyn Sopacua
On zaterdag 23 juni 2018 00:56:36 CEST James Bellaby wrote: > However when looking are the SQL in Postgresql it's created the Membership > table constraint for the Group id with "ON DELETE NO ACTION" > > CONSTRAINT groups_membership_group_id_d4404a8c_fk_groups_group_id FOREIGN > KEY (group_id) >

Django Postgres Intermediary doesn't set ON DELETE CASCADE

2018-06-22 Thread James Bellaby
I'm having a little trouble with my "through" table. I've set the modal to have two Foreign Key fields. Ex. below: class Person(models.Model): title = models.CharField(max_length=255) class Group(models.Model): title = models.CharField(max_length=255) members= models.ManyToManyField

Re: Any one tried of Django Postgres with Ngnix?

2016-07-14 Thread 06userit
Hello, I do use nginx + uwsgi + postgres. Maybe you could try one of following points below ? Cheers. 1) there is a very good tutorial to install nginx, see below. This is the one I used for step by step installation on production server : http://uwsgi-docs.readthedocs.io/en/latest/tutorials/Dja

Re: Any one tried of Django Postgres with Ngnix?

2016-07-14 Thread khaleela . visolve
> > nginx + uwsgi + postgres here > > On Thu, Jul 14, 2016 at 10:43 AM, Rafael E. Ferrero > wrote: > >> YES, I do !! >> >> >> Rafael E. Ferrero >> >> 2016-07-14 11:16 GMT-03:00 >: >> >>> >>> Any one tried of Django P

Re: Any one tried of Django Postgres with Ngnix?

2016-07-14 Thread Vijay Khemlani
nginx + uwsgi + postgres here On Thu, Jul 14, 2016 at 10:43 AM, Rafael E. Ferrero < rafael.ferr...@gmail.com> wrote: > YES, I do !! > > > Rafael E. Ferrero > > 2016-07-14 11:16 GMT-03:00 : > >> >> Any one tried of Django Postgres with Ngnix? >> >&

Re: Any one tried of Django Postgres with Ngnix?

2016-07-14 Thread Rafael E. Ferrero
YES, I do !! Rafael E. Ferrero 2016-07-14 11:16 GMT-03:00 : > > Any one tried of Django Postgres with Ngnix? > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To unsubscribe from this group and stop re

Any one tried of Django Postgres with Ngnix?

2016-07-14 Thread khaleela . visolve
Any one tried of Django Postgres with Ngnix? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to

Re: hanging django/postgres idle connections

2016-04-28 Thread Andrew Grigorev
Same problem with postgis database backend when running a development server. среда, 30 июля 2014 г., 17:41:58 UTC+3 пользователь Jani Kajala написал: > > Hi, > > I have a problem with leaking Postgres DB connections even if I > have CONN_MAX_AGE=0. Every time I start the server and stop it by

Re: hanging django/postgres idle connections

2016-03-30 Thread Ryan Bagwell
ons through Jenkins. If I manually run the > command inside of a VirtualBox session, it works as expected. > > Jon > > On Friday, August 1, 2014 at 6:41:53 AM UTC-7, Jani Kajala wrote: >> >> Haven't tried (yet), I'm new to Python & Django & Postgres, g

Re: hanging django/postgres idle connections

2015-11-23 Thread Jon Sandness
ven't tried (yet), I'm new to Python & Django & Postgres, got on board > with Python 3.4.1 and Django 1.7c1. I'm starting to suspect this isn't > really Django related directly, since I can consistently reproduce the > problem following way: 1) Run e.g. test cas

Re: hanging django/postgres idle connections

2014-08-01 Thread Jani Kajala
Haven't tried (yet), I'm new to Python & Django & Postgres, got on board with Python 3.4.1 and Django 1.7c1. I'm starting to suspect this isn't really Django related directly, since I can consistently reproduce the problem following way: 1) Run e.g. test case,

Re: hanging django/postgres idle connections

2014-07-31 Thread cmawebsite
Does it work fine on django 1.6? It could be a regression. On Wednesday, July 30, 2014 10:41:58 AM UTC-4, Jani Kajala wrote: > > Hi, > > I have a problem with leaking Postgres DB connections even if I > have CONN_MAX_AGE=0. Every time I start the server and stop it by > Ctrl+Break a DB connectio

hanging django/postgres idle connections

2014-07-30 Thread Jani Kajala
Hi, I have a problem with leaking Postgres DB connections even if I have CONN_MAX_AGE=0. Every time I start the server and stop it by Ctrl+Break a DB connection is leaked. When I check from Postgres there is bunch of "idle" connections with following content: SELECT "django_migrations"."app",

Re: Django & Postgres explicit SQL parameters escape

2011-02-21 Thread ju
or database > > function call? > > > I need to create SQL like this one ... select * from > > function_name(params_count, ARRAY[(param, param, param), (param, > > param, param), (param, param, param)... > > > Also > > here:http://stackoverflow.com/questions/

Re: Django & Postgres explicit SQL parameters escape

2011-02-21 Thread Bill Freeman
param), (param, param, param)... > > Also here: > http://stackoverflow.com/questions/5064637/django-postgres-explicit-sql-parameters-escape > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group,

Django & Postgres explicit SQL parameters escape

2011-02-21 Thread ju
e any difference if you escape standard SQL request or database function call? I need to create SQL like this one ... select * from function_name(params_count, ARRAY[(param, param, param), (param, param, param), (param, param, param)... Also here: http://stackoverflow.com/questions/5064637/django-pos

Re: Django, Postgres and recovering from database constraints

2011-02-02 Thread Xavier Ordoquy
ok, thanks a lot. savepoints saved my day :p It just worked out of the box while the other methods didn't seem to work. Back on a more serious topic, could someone confirm or not that the transaction rollback (http://docs.djangoproject.com/en/1.2/topics/db/transactions/#transaction-rollback) d

Re: Django, Postgres and recovering from database constraints

2011-02-01 Thread Xavier Ordoquy
thanks, I'll give it a try tomorrow and let you know. Xavier. Le 1 févr. 2011 à 19:57, Casey S. Greene a écrit : > Also (sorry for the follow-up spam but I just remembered this) if you are > hoping to use the database level autocommit (postgres 8.2 or later), you need > to configure it: > >

Re: Django, Postgres and recovering from database constraints

2011-02-01 Thread Casey S. Greene
Also (sorry for the follow-up spam but I just remembered this) if you are hoping to use the database level autocommit (postgres 8.2 or later), you need to configure it: Autocommit mode New in Django 1.1: Please, see the release notes If your application is particularly read-heavy and doesn’t m

Re: Django, Postgres and recovering from database constraints

2011-02-01 Thread Casey S. Greene
Here is some code pulled from my (using postgres) django application that recovers fine. Perhaps this is helpful to you. I am storing the non-unique values and dealing with them later (pulling from an external source that is supposed to have unique IDs assigned but they don't always pan out s

Re: Django, Postgres and recovering from database constraints

2011-02-01 Thread Xavier Ordoquy
Le 1 févr. 2011 à 15:59, bruno desthuilliers wrote : > On 1 fév, 15:24, Xavier Ordoquy wrote: >> Hi all, >> >> I got a project which sometime outputs database integrity errors (key >> violates unique constraint). >> It is fine since I'm keeping an events table which may have several creation >

Re: Django, Postgres and recovering from database constraints

2011-02-01 Thread bruno desthuilliers
On 1 fév, 15:24, Xavier Ordoquy wrote: > Hi all, > > I got a project which sometime outputs database integrity errors (key > violates unique constraint). > It is fine since I'm keeping an events table which may have several creation > messages for the same object. Hmmm... Either I misunderstood

Django, Postgres and recovering from database constraints

2011-02-01 Thread Xavier Ordoquy
Hi all, I got a project which sometime outputs database integrity errors (key violates unique constraint). It is fine since I'm keeping an events table which may have several creation messages for the same object. Until now, I was just catching the exception and forgot about it. Today, I'm not

Re: Django + Postgres

2010-09-01 Thread meitham
> So I have installed postgres, pyscopg2. > > su postgres > created a database > updated my settings.py: > DATABASES = { >     'default': { >         'ENGINE': 'django.db.backends.postgresql_psycopg2', >         'NAME': 'template1', >         'USER': 'postgres', >         'PASSWORD': 'postgres', >

Re: Django + Postgres

2010-08-31 Thread Xavier Ordoquy
Hi, Actually, there is a confusion between the administrative data django fills and the data the admin application owns itself. Unless I'm mistaken, Django admin application only creates 1 table I named in my previous message (django_admin_log). Can you check this table has been created ? If it

Re: Django + Postgres

2010-08-31 Thread Robbington
Apologies I should have been more clear, 'It' refers to my domain name when visited "/admin" All the django settings are correct, I've used sqlite3 and got the admin up and working. So I have installed postgres, pyscopg2. su postgres created a database updated my settings.py: DATABASES = { '

Re: Django + Postgres

2010-08-31 Thread Xavier Ordoquy
Also, what kind of users are you speaking about ? system, database or django users ? Do you have the admin site available in the urls ? Did you uncomment both the url and the auto discovering part ? Did syncdb showed django_admin_log table being created (or can you check it has been created) ?

Re: Django + Postgres

2010-08-31 Thread Albert Hopkins
On Tue, 2010-08-31 at 04:30 -0700, Robbington wrote: > Hi, > > I seem to be having a problem setting up django and postgresql. > > I have created a database and switched users to postgres then sync'd > the database successfully in my django project directory. But it isn't > finding the admin page

Django + Postgres

2010-08-31 Thread Robbington
Hi, I seem to be having a problem setting up django and postgresql. I have created a database and switched users to postgres then sync'd the database successfully in my django project directory. But it isn't finding the admin page still. No errors, just cant find them. Can any one help with Pos

Re: Django, Postgres and Core Dumps

2007-07-01 Thread Vikrant
Hi, I am running postgresql with pyscopg2. I have put the details on my blog post at http://www.vyomtech.com/vyomcms/pyscopg2onubuntu64bit.html The essence is first you uninstall your existing python-psycopg2 package. Then install python-dev (in your case it would be 2.5) and then download the ps

Re: Django, Postgres and Core Dumps

2007-05-26 Thread Sam Morris
On Sat, 26 May 2007 19:28:03 +1000, Malcolm Tredinnick wrote: > On Sat, 2007-05-26 at 02:20 -0700, Grant D. Watson wrote: >> Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: >> >> > > In an unusually (for Ubuntu) boneheaded move, it >> > looks >> > > like Ubuntu doesn't leave core files for packaged

Re: Django, Postgres and Core Dumps

2007-05-26 Thread Eugene Morozov
Hello, Here it is: https://bugs.launchpad.net/bugs/108067 I've planned to make a public repository with fixed packages, but I'm too busy for this. Anyway, you can take Feisty package, replace source code with downloaded 2.0.6 source code from psycopg site, bump version number in debian changelog

Re: Django, Postgres and Core Dumps

2007-05-26 Thread Malcolm Tredinnick
On Sat, 2007-05-26 at 12:42 +, Eugene Morozov wrote: > python-psycopg2 package in Ubuntu Feisty for x86-64 is completely > broken. I've reported it in the Launchpad on the next day after > release, but maintainer is still reluctant to apply patch which should > fix 64 bit issues. Ha ha! Probl

Re: Django, Postgres and Core Dumps

2007-05-26 Thread Eugene Morozov
python-psycopg2 package in Ubuntu Feisty for x86-64 is completely broken. I've reported it in the Launchpad on the next day after release, but maintainer is still reluctant to apply patch which should fix 64 bit issues. I've solved the problem by downloading upstream beta version and compiling a

Re: Django, Postgres and Core Dumps

2007-05-26 Thread Grant D. Watson
Of course I omitted the part that might be marginally more useful: (gdb) bt #0 0x00418f22 in ?? () #1 0x00419a10 in PyObject_CallMethod () #2 0x2b062bf4c7e3 in microprotocol_getquoted () from /usr/lib/python2.5/site-packages/psycopg2/_psycopg.so #3 0x2b062bf4e29b in

Re: Django, Postgres and Core Dumps

2007-05-26 Thread Grant D. Watson
--- Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > I think you're a little bit doomed here, if Ubuntu > ships stripped > binaries. On a Fedora system I would install the > *-debuginfo at this > point. Then you could try > > gdb python > ... > (gdb) run manage.py syncdb >

Re: Django, Postgres and Core Dumps

2007-05-26 Thread Malcolm Tredinnick
On Sat, 2007-05-26 at 02:20 -0700, Grant D. Watson wrote: > Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > > > > In an unusually (for Ubuntu) boneheaded move, it > > looks > > > like Ubuntu doesn't leave core files for packaged > > > programs, even after a "ulimit -c unlimited". Any > > > other

Re: Django, Postgres and Core Dumps

2007-05-26 Thread Grant D. Watson
Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > > In an unusually (for Ubuntu) boneheaded move, it > looks > > like Ubuntu doesn't leave core files for packaged > > programs, even after a "ulimit -c unlimited". Any > > other way to pull this off? > > I wouldn't have thought it was possible to >

Re: Django, Postgres and Core Dumps

2007-05-25 Thread Malcolm Tredinnick
On Fri, 2007-05-25 at 22:46 -0700, Grant D. Watson wrote: > > No idea about the core dump -- it's not very usual > > (for Python). > > Definitely my experience. > > > However, you will have to do something about your > > Python version. Either > > I checked, and as Jeremy said an update was jus

Re: Django, Postgres and Core Dumps

2007-05-25 Thread Grant D. Watson
> No idea about the core dump -- it's not very usual > (for Python). Definitely my experience. > However, you will have to do something about your > Python version. Either I checked, and as Jeremy said an update was just released recently; I've upgraded to 2.5.1. Thanks for the heads-up. > Is

Re: Django, Postgres and Core Dumps

2007-05-25 Thread Jeremy Dunck
On 5/25/07, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > However, you will have to do something about your Python version. Either > downgrade to 2.5.0 or upgrade to 2.5.1 proper. The problem is that there > was a regression in the 2.5.1-pre-releases with the way dictionary > subclasses are init

Re: Django, Postgres and Core Dumps

2007-05-25 Thread Malcolm Tredinnick
On Fri, 2007-05-25 at 20:51 -0700, Grant D. Watson wrote: > I'm a newbie to Django. It looks amazing, and I've > decided to give it a whirl, but when I try a syncdb on > my new project I get a core dump; the only things I've > changed in settings.py are ADMINS and DATABASE_*. > Given the context

Django, Postgres and Core Dumps

2007-05-25 Thread Grant D. Watson
I'm a newbie to Django. It looks amazing, and I've decided to give it a whirl, but when I try a syncdb on my new project I get a core dump; the only things I've changed in settings.py are ADMINS and DATABASE_*. Given the context I assume it's something to do with the psycopg2 library and Django?

Re: Re: Django, Postgres and Server Crash

2006-10-16 Thread Malcolm Tredinnick
On Mon, 2006-10-16 at 13:45 -0500, James Bennett wrote: > On 10/16/06, Mike <[EMAIL PROTECTED]> wrote: > > The server is rather new. 2GB of memory with a top grade Opteron (not > > sure which). Once again, the server is running with low load for most > > of the day, and as much as I want to, I hav

Re: Re: Django, Postgres and Server Crash

2006-10-16 Thread James Bennett
On 10/16/06, Mike <[EMAIL PROTECTED]> wrote: > The server is rather new. 2GB of memory with a top grade Opteron (not > sure which). Once again, the server is running with low load for most > of the day, and as much as I want to, I have hard time believing its > the server that is to blame. FWIW,

Re: Re: Django, Postgres and Server Crash

2006-10-16 Thread James Bennett
On 10/16/06, Mike <[EMAIL PROTECTED]> wrote: > I just svn update my django directory. Doesn't the latest django > version reflect all the bug fixes? Do I have to check out > 0.91-bugfixes? The "bugfixes" branches are only for the older (0.90 and 0.91) versions of Django, and I only mentioned them

Re: Django, Postgres and Server Crash

2006-10-16 Thread Gary Doades
On Monday 16 October 2006 18:01, Mike wrote: > The server is rather new. 2GB of memory with a top grade Opteron (not > sure which). Once again, the server is running with low load for most > of the day, and as much as I want to, I have hard time believing its > the server that is to blame. But it

Re: Django, Postgres and Server Crash

2006-10-16 Thread Tim Chase
> Pressing 'c' on top clears everything a little bit. One thing > I think I forgot to mention is 90% of the time the server load > is moderate. It is 3 times a week around early in the morning > that my django and postgres start dancing to death for me. > Given that my server hardware handles the

Re: Django, Postgres and Server Crash

2006-10-16 Thread Mike
> What are the specs of the server? Specifically, how much RAM does it > have and how fast are its disks? What processors are in the machine > (for postgres, Xeons are bad, Opterons are very, very good)? The server is rather new. 2GB of memory with a top grade Opteron (not sure which). Once agai

Re: Django, Postgres and Server Crash

2006-10-16 Thread Mike
James, Thanks for your response. I just svn update my django directory. Doesn't the latest django version reflect all the bug fixes? Do I have to check out 0.91-bugfixes? Pressing 'c' on top clears everything a little bit. One thing I think I forgot to mention is 90% of the time the server load

Re: Re: Django, Postgres and Server Crash

2006-10-16 Thread James Bennett
On 10/16/06, Siah <[EMAIL PROTECTED]> wrote: > I tried increasing the number of postgres connections, and it ended up > completely killing the server. The server I'm working with has 2 django > sites running, one of which receives around 3M hits a month. The other > one somewhere around 200K hits,

Re: Django, Postgres and Server Crash

2006-10-16 Thread Siah
Per connection? Does it mean per request, or page view? I tried increasing the number of postgres connections, and it ended up completely killing the server. The server I'm working with has 2 django sites running, one of which receives around 3M hits a month. The other one somewhere around 200K h

Re: Django, Postgres and Server Crash

2006-10-16 Thread James Bennett
On 10/16/06, Siah <[EMAIL PROTECTED]> wrote: > How many postmaster instances should be running at once? Also, if you're running an older version of Django, be sure to update to the "bugfixes" branch for it; the mod_python handler had a bug in it which could leak DB connections, and which has sinc

Re: Django, Postgres and Server Crash

2006-10-16 Thread James Bennett
On 10/16/06, Siah <[EMAIL PROTECTED]> wrote: > How many postmaster instances should be running at once? Are you talking about 'postmaster', or 'postgres'? The default behavior of top has a nasty habit of confusing the two; press 'c' to have it show the full info. That said, we have a bunch of po

Re: Django, Postgres and Server Crash

2006-10-16 Thread [EMAIL PROTECTED]
Postgres uses one process per connection. How many simultaneous connections have you got in total? If you don't have that many simultaneous users then you may not be closing database connections somewhere. You can increase the number of connections that Postgres can handle, but it looks like you

Django, Postgres and Server Crash

2006-10-16 Thread Siah
Hello, I am running django on heavy load server, and multiple times a week I have my postgres crashing due to high server load. When I get TOP, I see many many postmasters running at the same time, until I get 'Too many connections' postgres failiour error from postmaster emailed to me from djang