Re: Does Django care about max_query_params? [feature request]

2022-06-28 Thread Jason

What db are you using? This might also be an issue for your db connector 
lib 
On Monday, June 27, 2022 at 10:49:40 AM UTC-4 gurov...@gmail.com wrote:

> Hi, all!
>
> Gotta problem with the number of query params. We're using a backend, 
> which connects to a cloud database, and at some point we suddenly started 
> getting such an error:
>
> *Number of parameters in query exceeds the maximum allowed limit of 950*
>
> Appearing on this step:
>
>
> *django/django/contrib/auth/management/__init__.py", line 83, in 
> create_permissionsPermission.objects.using(using).bulk_create(perms)*
>
> 950 query params is the max number for our backend, and we set the 
> *DatabaseFeatures.max_query_params 
> *to 900. Still, it looks like Django doesn't care.
>
> Because of this all of our tests stopped working, bringing a lot of 
> inconveniences during development. Seems to me that it should be fixed on 
> Django side, centralized, 'cause it's unlikely we're the only who met and 
> will meet the problem in future.
>
>

-- 
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/9c877978-70df-4452-b05d-63b98f551de3n%40googlegroups.com.


Re: How to ignoring columns on model save

2022-06-28 Thread Jason
https://code.djangoproject.com/ticket/21454

there's an open ticket about this, some things might help you there.  But 
right now, there's no easy way to get around this

On Monday, June 27, 2022 at 5:36:50 AM UTC-4 ro...@tonic-solutions.com 
wrote:

> I have a model that is backed by a database table that contains a 
> read-only column that is maintained by the database using Postgresql's 
> Generated Columns (i.e. using GENERATED ALWAYS AS) - see 
> https://www.postgresql.org/docs/current/ddl-generated-columns.html.
>
> When Django saves the model, it tries to set the field, which throws 
> `django.db.utils.ProgrammingError: cannot insert into column "_search". 
> DETAIL: Column "_search" is a generated column.
>
> Is there any way to tell Django not to attempt to insert that field?
>
> From what I can tell `editable=False` doesn't prevent Django from trying 
> to save it - which makes sense for fields that aren't editable by users but 
> are calculated by the model class, e.g. in `save()`.
>
> I know I could set `something like `instance.save(update_fields=[field for 
> field in instance._meta.fields if field.name != "_search")` but it would 
> need to be set on every save for that model throughout the application, 
> which seems like a lot of technical debt and likely to trip up other 
> developers as they maintain the application.
>
> Is there anything that I can set on the field instance in the model to 
> tell Django that it is maintained by the database?
>
> If not, please can anyone suggest a way to add code to the model to make 
> it ignore the field when saving?
>
> Thanks
>
> Roger
>

-- 
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/0a24aa15-a3cd-4e72-90a0-76e0c62a4820n%40googlegroups.com.


Re: Removing "Invalid HTTP_HOST header" msgs with nginx.conf default server NOT working

2022-06-28 Thread cseb...@gmail.com
Thanks so much.  I'll try it.  And your solution has no need for Nginx 
tweaking.  I love it.

cs

On Sunday, June 26, 2022 at 12:50:02 PM UTC-5 Mr.Teapot wrote:

> Please take a look on the ALLOWED_HOSTS documentation 
> https://docs.djangoproject.com/en/4.0/ref/settings/#allowed-hosts.
>
> *A list of strings representing the host/domain names that this Django 
> site can serve. This is a security measure to prevent HTTP Host header 
> attacks 
> ,
>  
> which are possible even under many seemingly-safe web server 
> configurations.*
>
> Assuming 3.208.32.109 is your server IP you should add it to ALLOWED_HOSTS.
>
> piątek, 24 czerwca 2022 o 19:00:23 UTC+2 cseb...@gmail.com napisał(a):
>
>> I constantly get the errors below in my Django server logs.  To try to 
>> remove this,
>> I added this to my  Nginx server's nginx.conf file but it didn't work
>>
>> server {
>>
>> listen 80 default_server;
>>
>> return 444;
>>
>> }
>>
>> What else can I do to remove these errors below this line???
>>
>> Invalid HTTP_HOST header: '3.208.32.109'. You may need to add 
>> '3.208.32.109' to ALLOWED_HOSTS.
>>
>> Invalid HTTP_HOST header: '3.208.32.109'. You may need to add 
>> '3.208.32.109' to ALLOWED_HOSTS.
>>
>> Invalid HTTP_HOST header: '3.208.32.109'. You may need to add 
>> '3.208.32.109' to ALLOWED_HOSTS.
>>
>> Invalid HTTP_HOST header: '3.208.32.109'. You may need to add 
>> '3.208.32.109' to ALLOWED_HOSTS.
>>
>> Invalid HTTP_HOST header: '3.208.32.109'. You may need to add 
>> '3.208.32.109' to ALLOWED_HOSTS.
>>
>> Invalid HTTP_HOST header: '3.208.32.109'. You may need to add 
>> '3.208.32.109' to ALLOWED_HOSTS.
>>
>> Invalid HTTP_HOST header: '3.208.32.109:443'. You may need to add 
>> '3.208.32.109' to ALLOWED_HOSTS.
>>
>> Invalid HTTP_HOST header: '3.208.32.109'. You may need to add 
>> '3.208.32.109' to ALLOWED_HOSTS.
>>
>>

-- 
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/9fa70a36-d8ce-49d1-bc21-46e17d89dedfn%40googlegroups.com.


Vincular Usuário

2022-06-28 Thread Solange Carvalho
Trabalho com multi-empresas e gostaria de saber como vincular o cadastro de 
uma empresa a um usuário.
Exemplo:
Um usuário só acessa os dados de uma empresa e tudo vinculado a ela.
Um usuário pode selecionar qual empresa acessar ou todas.

Como programar?

-- 
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/247e96f2-a682-478b-906b-859d8fad99acn%40googlegroups.com.


Re: Kindly Help

2022-06-28 Thread 'Kasper Laudrup' via Django users

On 27/06/2022 21.14, Habib ur rehman wrote:

raise MigrationSchemaMissing(
django.db.migrations.exceptions.MigrationSchemaMissing: Unable to create the 
django_migrations table ((1064, "You have an error
in your SQL syntax; check the manual that corresponds to your MySQL server version 
for the right syntax to use near '(6) NOT NULL)' at line 1"))



This should provide the help you need:

http://www.catb.org/~esr/faqs/smart-questions.html

Kind regards,

Kasper Laudrup

--
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/0516c2fb-9114-e814-edb7-0b8a5b2770d2%40stacktrace.dk.


OpenPGP_0xE5D9CAC64AAA55EB.asc
Description: OpenPGP public key


OpenPGP_signature
Description: OpenPGP digital signature


Turn Django Web App to Mobile App

2022-06-28 Thread Lightning Bit
Hello all, 

Where should one start to convert a Django Web App into a Mobile App for 
the Play Store and Apple Store? Appreciate the help!

-- 
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/7a9ad87d-bd28-4468-9481-08edf1de5497n%40googlegroups.com.


Re: Turn Django Web App to Mobile App

2022-06-28 Thread Ryan Nowakowski
I've used Cordova before

https://cordova.apache.org/

On June 28, 2022 3:26:04 PM CDT, Lightning Bit 
 wrote:
>Hello all, 
>
>Where should one start to convert a Django Web App into a Mobile App for 
>the Play Store and Apple Store? Appreciate the help!
>
>-- 
>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/7a9ad87d-bd28-4468-9481-08edf1de5497n%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/4B65F10E-4823-4993-8620-4AC28E226091%40fattuba.com.


Re: Need some help

2022-06-28 Thread Ryan Nowakowski
Yup

On June 26, 2022 8:11:01 PM CDT, Rohit Lohar  wrote:
>Can I make a form with the help of htmx such that the whole form has a
>small container is dynamic and else whole part is static?
>
>On Mon, Jun 27, 2022, 4:07 AM Ryan Nowakowski  wrote:
>
>> If you want the initial input field value to change dynamically when the
>> select field option changes, there's a bunch of different ways to do this.
>> My current favorite is htmx
>>
>> https://htmx.org/
>>
>> - Ryan
>>
>>
>>
>> On June 26, 2022 5:10:19 AM CDT, Rohit Lohar 
>> wrote:
>>>
>>> Hi there,
>>> I am currently making a form where the user will have a option to select
>>> from the drop down and an input field next to it. So basically the drop
>>> down will have the list of products and the input field will be having an
>>> initial value depending upon the choice selected by user. The product name
>>> and price have their seperate table so how can I achieve this.
>>> Thank you
>>>
>>> --
>> 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/86BB9A38-A8CC-4029-AAB4-ED2B6E31D22D%40fattuba.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/CAFMpPbmcGQw3S%2BxXr3k%3DsUjmrHpVL203xSNj1HEYx6VUA%3DymWA%40mail.gmail.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/EB0A409C-EA6C-4CA9-8349-94DB8AD3D256%40fattuba.com.


Re: How to ignoring columns on model save

2022-06-28 Thread Ryan Nowakowski



On June 27, 2022 4:36:49 AM CDT, "ro...@tonic-solutions.com" 
 wrote:
>I know I could set `something like `instance.save(update_fields=[field for 
>field in instance._meta.fields if field.name != "_search")` but it would 
>need to be set on every save for that model throughout the application, 
>which seems like a lot of technical debt and likely to trip up other 
>developers as they maintain the application.

You could override the save method on your model to always exclude _search from 
update_fields. That way you DRY.

-- 
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/83A9F868-A97E-4102-87AB-381A75FB6D88%40fattuba.com.


Re: Turn Django Web App to Mobile App

2022-06-28 Thread King Niko
Thank you my friend!

On Tue, Jun 28, 2022 at 17:09 Ryan Nowakowski  wrote:

> I've used Cordova before
>
> https://cordova.apache.org/
>
> On June 28, 2022 3:26:04 PM CDT, Lightning Bit <
> thelegendofearthretu...@gmail.com> wrote:
>>
>> Hello all,
>>
>> Where should one start to convert a Django Web App into a Mobile App for
>> the Play Store and Apple Store? Appreciate the help!
>>
>> --
> 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/4B65F10E-4823-4993-8620-4AC28E226091%40fattuba.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/CAO1EWpECACyz4Y%2BS3RK8K3ESAd3JLfuN_50CbNV%2BmjiLuWWBRg%40mail.gmail.com.