Re: No downtime rolling upgrades with migration

2023-03-26 Thread Sandip Bhattacharya


> On Mar 26, 2023, at 6:47 PM, Damanjeet Singh  wrote:
> 
> Depending on the requirements. Either two different databases or point to one 
> database.
> 
> Or
> Link one database to master (read and write)
> 
> Another database instance to read only.
> 
> And you can change Another database to main.
> 

Thanks for your patience in answering my doubts. But I still have some follow 
up questions.

If it is the same database, and the migration changes the schema, won’t the 
older application code instances have the same problem with backward 
incompatible schema changes?

And if it is two databases, how does it work? If you set the older database to 
read-only, then traffic on the write path of the older application will break. 
If you somehow connect the two in sync, won’t the DDL changes on the primary 
replicate to the other replica as well, again causing the older application to 
break?

- Sandip

> 
> 
> On Sun, 26 Mar 2023, 22:33 Sandip Bhattacharya,  > wrote:
>> 
>> 
>>> On Mar 26, 2023, at 4:32 PM, Damanjeet Singh >> > wrote:
 3. How do you do non-backward compatible schema upgrades? Do you do it out 
 of band from deployments? Do you shift traffic to a different cluster, and 
 then zero traffic upgrade the whole cluster at once?
>>> 
>>> 
>>> Daman: Blue Green deployment can help. You can distribute traffic to old 
>>> and new. When all stable then move everything. You can use kubernetes with 
>>> helm.
>> 
>> 
>> 
>> Do you do blue-green deployments with two different databases? 
>> 
>> - Sandip

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CF4FC246-87DD-4F31-A7E7-D3B9682F7FC0%40showmethesource.org.


Re: No downtime rolling upgrades with migration

2023-03-26 Thread Damanjeet Singh
Depending on the requirements. Either two different databases or point to
one database.

Or
Link one database to master (read and write)

Another database instance to read only.

And you can change Another database to main.

Cheers


On Sun, 26 Mar 2023, 22:33 Sandip Bhattacharya, 
wrote:

>
>
> On Mar 26, 2023, at 4:32 PM, Damanjeet Singh 
> wrote:
>
>> 3. How do you do non-backward compatible schema upgrades? Do you do it
>> out of band from deployments? Do you shift traffic to a different cluster,
>> and then zero traffic upgrade the whole cluster at once?
>>
>
> Daman: Blue Green deployment can help. You can distribute traffic to old
> and new. When all stable then move everything. You can use kubernetes with
> helm.
>
>
>
> Do you do blue-green deployments with two different databases?
>
> - Sandip
>
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/66989169-7601-4CA1-A54B-B9B29F7B719B%40showmethesource.org
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAGLHGi7iorAPEvhb5UteJT9Hoy7wwaMfT5D8AtWNKh5pH2uj-A%40mail.gmail.com.


Re: No downtime rolling upgrades with migration

2023-03-26 Thread Sandip Bhattacharya


> On Mar 26, 2023, at 4:32 PM, Damanjeet Singh  wrote:
>> 3. How do you do non-backward compatible schema upgrades? Do you do it out 
>> of band from deployments? Do you shift traffic to a different cluster, and 
>> then zero traffic upgrade the whole cluster at once?
> 
> 
> Daman: Blue Green deployment can help. You can distribute traffic to old and 
> new. When all stable then move everything. You can use kubernetes with helm.



Do you do blue-green deployments with two different databases? 

- Sandip


-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/66989169-7601-4CA1-A54B-B9B29F7B719B%40showmethesource.org.


Re: No downtime rolling upgrades with migration

2023-03-26 Thread Damanjeet Singh
Hello,

Please read my reply below.

Best of luck.

Regards

On Sun, 26 Mar 2023, 21:17 Sandip Bhattacharya, 
wrote:

> New to django, so wanted to ask some questions that I didn’t find good
> resources for:
>
> 1. If you deploy django apps using docker, do you run migrations before
> launching gunicorn/uwsgi etc within the docker image?
>
Daman:This is all upto you. Better to do when creating container. As you
can also upgrade from git.

>
> 2. If you do, how does rolling migrations work? Won’t the non-upgraded
> replicas start erroring if the new schema is not backward compatible?
>
Daman:Create blue green deployment.

>
> 3. How do you do non-backward compatible schema upgrades? Do you do it out
> of band from deployments? Do you shift traffic to a different cluster, and
> then zero traffic upgrade the whole cluster at once?
>

Daman: Blue Green deployment can help. You can distribute traffic to old
and new. When all stable then move everything. You can use kubernetes with
helm.


> Thanks,
>   Sandip
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/A9719D24-F6DA-45A6-A30A-EA8EA34754A1%40showmethesource.org
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAGLHGi5p9MgPyhKs-x%3D_84CGhjcQNy70mQGJK-v8rBi5m3znTA%40mail.gmail.com.


Re: It is impossible to add a non-nullable field 'details1' to feature without specifying a default. This is because the database needs something to populate existing rows.

2023-03-26 Thread Sandip Bhattacharya
So what would you want for existing entries in the table which were added 
before you changed the model?

If you are ok with them being empty, you should use:
details = models.CharField(max_length=500, default=“”)

And run migrate again.

If you are ok instead of this column being null, then:
details = models.CharField(max_length=500, null=True, blank=True)

I don’t have a huge experience with migrations, so others can correct me if I 
am wrong, but intuitively I feel that defaults should be captured in code than 
doing one-off fixes manually while running migrations at the command line.

Thanks,
  Sandip


> On Mar 25, 2023, at 12:08 AM, Ebenezer Otchere  wrote:
> 
> Am new in django and have been getting errors in migrations, i need help
> when i try to do migrations it keeps telling me this
> it is impossible to add a non-nullable field 'details' to feature without 
> specifying a default. This is because the database needs something to 
> populate existing rows.
> Please select a fix:
>  1) Provide a one-off default now (will be set on all existing rows with a 
> null value for this column)
>  2) Quit and manually define a default value in models.py.
> Thank you  in advance
> from django.db import models
> 
> # Create your models here.
> 
> 
> class feature(models.Model) :
> 
> name = models.CharField(max_length=100)
> extra = models.CharField(max_length=100)
> details1 = models.CharField(max_length=500)
> 
> class art(models.Model):
> 
> name = models.CharField(max_length=100)
> details = models.CharField(max_length=500)
> 
> -- 
> 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 view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/06f462e2-3e1d-4a1a-8a97-b183586e5663n%40googlegroups.com
>  
> .

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/F716AB80-31C0-448A-9F09-3F1DEFE128E5%40showmethesource.org.


No downtime rolling upgrades with migration

2023-03-26 Thread Sandip Bhattacharya
New to django, so wanted to ask some questions that I didn’t find good 
resources for:

1. If you deploy django apps using docker, do you run migrations before 
launching gunicorn/uwsgi etc within the docker image?

2. If you do, how does rolling migrations work? Won’t the non-upgraded replicas 
start erroring if the new schema is not backward compatible?

3. How do you do non-backward compatible schema upgrades? Do you do it out of 
band from deployments? Do you shift traffic to a different cluster, and then 
zero traffic upgrade the whole cluster at once?

Thanks,
  Sandip

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/A9719D24-F6DA-45A6-A30A-EA8EA34754A1%40showmethesource.org.


nexmo

2023-03-26 Thread Morgan
bonsoir jaimerai utilisé l'api nexmo pour envoyer des msg, quelqu'un l'a 
t-il deja fait ici??

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/4131eeb8-69c5-45eb-9907-5b9b448f8ee0n%40googlegroups.com.