Re: No downtime rolling upgrades with migration

2023-03-26 Thread Sandip Bhattacharya
again causing the older application to break? - Sandip > > > On Sun, 26 Mar 2023, 22:33 Sandip Bhattacharya, <mailto:sand...@showmethesource.org>> wrote: >> >> >>> On Mar 26, 2023, at 4:32 PM, Damanjeet Singh >> <mailto:mailtoda...@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

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,

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

Re: sub-list not showing

2023-03-17 Thread Sandip Bhattacharya
> On Mar 16, 2023, at 2:22 PM, nef wrote: > > class Student(models.Model): > #std_matricule = models.CharField(verbose_name='Student matricule', > max_length=6, null=False, unique=True, primary_key=True) > std_matricule = models.CharField(verbose_name='Matricule', unique=True, >

Re: Stuck with Django Tutorial Part 4

2023-03-14 Thread Sandip Bhattacharya
Can you share your urls.py? > On Mar 14, 2023, at 1:33 AM, Nithin Kumar wrote: > > Hi, > > Stuck with this problem > > https://docs.djangoproject.com/en/4.1/intro/tutorial04/ > > NoReverseMatch at /polls/2/Reverse for 'vote' with arguments '(2,)' not > found. 1 pattern(s) tried: ['polls/

Re: Django Admin

2023-03-13 Thread Sandip Bhattacharya
> On Mar 13, 2023, at 5:14 AM, James Hunt wrote: > > I have yet to create a HTML page so I'm not sure that the inclusion of {% > csrf_token %} is required. I mean it's just the admin page I am trying to > access which is provided by Django and not a page created by me!!! > > I am very

Re: static files

2023-03-12 Thread Sandip Bhattacharya
Static files outside apps are not served by default. Have you added the main directory static directory to settings yet? https://docs.djangoproject.com/en/4.1/ref/settings/#std-setting-STATICFILES_DIRS Something like this is typically done in project settings: STATICFILES_DIRS = [BASE_DIR /

Re: Django Guide

2023-03-05 Thread Sandip Bhattacharya
There is a good guide here as well: https://developer.mozilla.org/en-US/docs/Learn/Server-side/Django - Sandip > On Mar 5, 2023, at 5:20 PM, Kennedy Saavedra wrote: > > Hello Abdullah, this is the documentation of > Django: https://docs.djangoproject.com/en/4.1/ > > Start from the basics >

Re: How to retrieve the latest object added (new one) in Django models and display it in the template?

2023-03-02 Thread Sandip Bhattacharya
Your problem is still about where the 'published’ value is coming from in the call to filter(published=published). Is it coming from a form? A Get parameter? A post parameter? Extract it appropriately before calling filter() > On Mar 2, 2023, at 3:46 AM, Byansi Samuel wrote: > > def action

Re: Creating A Model For Existing DB Table

2010-11-10 Thread Sandip Bhattacharya
On Wed, Nov 10, 2010 at 09:23:55AM -0800, octopusgrabbus wrote: > # Create your models here. > class ept_inv(models.Model): > part_num = models.CharField(max_length=20) > ept_type = models.SmallIntegerField > inv_id = models.IntegerField > load_date = models.DateField Call the

Re: TEMPLATE_CONTEXT_PROCESSORS doesn't seem to be present in settings.py by default

2010-09-09 Thread Sandip Bhattacharya
Never mind. Just saw http://code.djangoproject.com/ticket/6851 - Sandip On Fri, Sep 10, 2010 at 3:51 AM, Sandip Bhattacharya <sand...@foss-community.com> wrote: > Is this variable supposed to be present in default generation of > settings.py after a startproject? Because

TEMPLATE_CONTEXT_PROCESSORS doesn't seem to be present in settings.py by default

2010-09-09 Thread Sandip Bhattacharya
Is this variable supposed to be present in default generation of settings.py after a startproject? Because I don't see this variable in any of the projects that I am creating. The doc (http://docs.djangoproject.com/en/dev/ref/settings/#std:setting-TEMPLATE_CONTEXT_PROCESSORS) makes it seem as if