Re: Tried to migrate custom user model and got this error shown below

2020-08-09 Thread Yemin Sajid
If your project is not deployed to production yet, the easiest solution is to delete the whole existing database (sqlite db file or postgres/mysql database) and try to apply the migrations. But if the project is already in the production, you would need to be careful with that. I would suggest 1.

Re: ERROR

2020-08-09 Thread Yemin Sajid
I think the error is from the frontend javascript code. Can u share snippets of that code? On Sun, Aug 9, 2020 at 8:30 AM Kovy Jacob wrote: > Are you switching into your projects directory and then using 'python > manage.py runserver' from command prompt/terminal to run your website? > > On

Tried to migrate custom user model and got this error shown below

2020-08-09 Thread FIRDOUS BHAT
django.db.migrations.exceptions.InconsistentMigrationHistory: Migration admin.0001_initial is applied before its dependency users.0001_initial on database 'default'. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this

Re: Tried to migrate custom user model and got this error shown below

2020-08-09 Thread Ayser shuhaib
Truro delete the files inside the migrations folder then run The makemigrations command then migrate On Sun, 09 Aug 2020 at 19:58, FIRDOUS BHAT wrote: > django.db.migrations.exceptions.InconsistentMigrationHistory: Migration > admin.0001_initial is applied before its dependency

Re: Security issue in django.db.models

2020-08-09 Thread Liu Zheng
All the previous answers are great to explain the reason. Just want to add: if you do not desire empty string in form and in shell, you probably need to add a min_length validation condition On Sun, Aug 9, 2020 at 12:42 PM Stephen J. Butler wrote: > If you look at the documentation for 'blank'

Re: Django jinja queryset filter lenth

2020-08-09 Thread Liu Zheng
Hi, Not sure it's a good idea to do database query inside the template. Templates are capable of running some logics but for a heavy-lifting job like database query, it should be a good practice to do it in the view, and only pass the results to the template. On Sun, Aug 9, 2020 at 4:30 AM Agoua

Re: SESSION_COOKIE_SAMESITE - does None still disable the flag?

2020-08-09 Thread אורי
Hi, https://github.com/django/django/blob/master/django/conf/global_settings.py#L472-L473 # Whether to set the flag restricting cookie leaks on cross-site requests. # This can be 'Lax', 'Strict', or None to disable the flag. This is not what is written in

SESSION_COOKIE_SAMESITE - does None still disable the flag?

2020-08-09 Thread אורי
Hi, *SESSION_COOKIE_SAMESITE* - We use None to disable the flag in Django 3.0. Will None (not as a string) disable the flag also in Django 3.1, or do we have to convert it to False? https://docs.djangoproject.com/en/3.0/ref/settings/#std:setting-SESSION_COOKIE_SAMESITE

Re: ERROR

2020-08-09 Thread Julio Cojom
It is js error, show the script part. It seems like you referenced a variable before declare it. On Sun, Aug 9, 2020, 8:50 AM Yemin Sajid wrote: > I think the error is from the frontend javascript code. Can u share > snippets of that code? > > On Sun, Aug 9, 2020 at 8:30 AM Kovy Jacob wrote: >