Re: Lack of tutorials and explanations about channels

2022-01-24 Thread Steve Smith
I am a huge fan of Django.  But I will agree that the documentation is most 
areas beyond the absolute basics is abysmal.  I have a lot written in Django in 
Class Based Views because I read early on they were the way to go.  I'm not 
going to tell you how much research and time it took me but it was a lot.  
Django is super powerful and it's amazingbut the documentation...while 
maybe better than any other framework is still very lacking for people in my 
humble opinion.  The documentation and books that I've come across are written 
in a way that they assume you already understand it and they pick up from 
there.  Love django.  Agree with the comment about documentation about Channels 
and as I've expressed most of the other documentation as well.




From: django-users@googlegroups.com  on behalf 
of lone...@gmail.com 
Sent: Monday, January 24, 2022 6:03 AM
To: Django users 
Subject: Re: Lack of tutorials and explanations about channels

You and me both are on the same page about documentation about Channels.  I 
tried to follow: Django Channels Tutorial 🔥: the most minimal Real Time app 
(not Chat) | Django WebSockets on 
YouTube, but I kept running into issues.  If you can follow this video, and 
figure it out, let me know if it is missing something.

On Wednesday, November 10, 2021 at 8:48:31 AM UTC-5 Dossou Mawussekuifan Gloria 
Donald KANTI wrote:
Why aren't there much tutorials and explanations about Channels and websocket 
integration in django over the internet ? Quite confusing. How can we get to 
know and understand it more if nobody wants to explain it. I am new to python 
and drf, wanna implement some realtime features in my app but no chance to get 
good resources explaining very well how things can be done. If there are some 
pros here knowing very well about the topic please, write some blog or make 
some detailed youtube videos to explain the topic. It will really help me and 
others in the future. It is crucial also for the image of django. 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/902feb53-0009-4e5b-946e-4f027daa64a6n%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/CH0PR18MB4292FACCBAC6D6D04DD47D88D25E9%40CH0PR18MB4292.namprd18.prod.outlook.com.


Re: Formsets

2022-02-06 Thread Steve Smith
HI Steve!

Thanks for the reply.  I have tried select related and prefetch relatedbut 
didn't know about deferwill look into...my current formset scenario is 
440ish queries and it takes about 19 seconds to load.  Some have suggested 
Celery and RabbitMQ and other alternatives which I'm not familiar with.  I need 
to explore those things further.  I have used the debug toolbar as wellit 
shows me that there are lots of duplicate queries...but I'm unclear on how to 
go about fixing them...as the select related and prefetch hasn't seemed to help 
either.

I'm using class based views with formsets and just kind of at a loss right now 
as to if there is anything that can be done to speed up these queries.  I 
opened up a SO on the issue...and got some suggestions on how to go about 
improving my dictionary look up...but after trying some of those suggestions 
the performance issue remains.

Thanks again for taking the time to respond.

Steve

From: django-users@googlegroups.com  on behalf 
of Steven Mapes 
Sent: Sunday, February 6, 2022 11:47 AM
To: Django users 
Subject: Re: Formsets

For me using select_related, prefetch_related and defer generally soft the 
issues. If that's still too slow then, if possible, you could look at using 
caching the queryset(s) you need the values. Have you run debug toolbar on the 
page to check what queries are running?

On Saturday, 5 February 2022 at 20:27:10 UTC stevesm...@hotmail.com wrote:
Hello all!

I find formsets wildly useful...but very difficult to architect.  I have them 
working...But I am running into a commonly documented problem...They are slow 
as you build up the number of fields and queries.  Are there any general tips 
that can be used or share on how to improve this issue?  I have tried all of 
the commonly prescribed 
solutions...select_related...prefetch_related...etc...But nothing seems to help.

I realize that Queries take timebut I'm just trying to see if there is a 
way to streamline them a bit.  It seems to me that formsets use a lot of 
queries depending on the amount of data and that's the trade off.

Again thanks for any thoughts or comments.

Steve


--
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/6513c105-8151-4c7a-8fd2-e692d5c5dcb5n%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/CH0PR18MB42921F540CB239D4F5E250CCD22B9%40CH0PR18MB4292.namprd18.prod.outlook.com.


Formsets?!?!?!?!?!?!?!?!?!?

2022-02-11 Thread Steve Smith
Hello all

I have formsets workingbut I seem to be encountering some performance 
issues if I have more than 25 rows.  I've looked at my database 
callsselect_related...prefetch_related...and I've polled several 
audiences...SOFacebook Groupsand the consensus seems to be that 
Formsets are bad if you have a lot of rows.  I'm having trouble accepting that 
because if that was the case why do they exist?  And why is the default like 
1000 forms?  I really like the formset conceptbut I'm having a hard time 
accepting that if you have more than 25 rows it's just gonna be "slow".  And by 
slow I mean when I try to render the form using formsets and I have 100 rows of 
data with like 12 fields each...it takes 19 seconds or so for the form to 
render.  Does this sound like normal behavior?  I'm legitimately asking as I 
honestly don't know.

Thanks in advance for any thoughts or feedback.

Steve

-- 
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/CH0PR18MB4292692992A37BD51AAEB0AFD2319%40CH0PR18MB4292.namprd18.prod.outlook.com.


RE: Slow page load performance with a large number of formsets (over 25)

2022-02-25 Thread Steve Smith
If in fact I am….how do I avoid this?  I have been playing with alternatives 
for a week and I’m starting to lose it…lol

Sent from Mail for Windows

From: Jacob Greene
Sent: Friday, February 25, 2022 5:58 PM
To: django-users@googlegroups.com
Subject: Re: Slow page load performance with a large number of formsets (over 
25)

If you're using model choice fields, it's very likely you are making an SQL 
query for each form set. It should be pretty obvious in the log with debug 
turned on.

On Fri, Feb 25, 2022, 4:31 PM Ryan Nowakowski 
mailto:tuba...@fattuba.com>> wrote:
Steven, are you using ModelFormSet?  If so, Is it the initial query
that's slow?  The form rendering?  Or is it the POST back to the server
that's slow?  You can use django-debug-toolbar[1] to profile your page
and get these metrics.

Once you figure out what part is slowest, then you can optimize.

Hope this helps!

Ryan N

[1] https://django-debug-toolbar.readthedocs.io/en/latest/

On Mon, Feb 07, 2022 at 09:12:48AM -0800, Steven Smith wrote:
> Did this issue ever get resolved?  I'm experiencing the same thing.  Once
> it hits 100 forms or so it gets pretty slow.
>
> On Monday, September 22, 2014 at 10:48:52 AM UTC-5 Collin Anderson wrote:
>
> > Yes, if you want speed, using javascript and ajax is probably your best
> > bet. It will probably also reduce merge-conflicts.
> >

--
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/20220225222926.GH11627%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/CAF-Y%3De5Fp7kDtLq47Z3Y4GEjXMne2PcTLYxOJ8St5gkKCkpUpw%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/CH0PR18MB42923C9432F56E071FA9716CD23F9%40CH0PR18MB4292.namprd18.prod.outlook.com.


Re: Slow page load performance with a large number of formsets (over 25)

2022-02-25 Thread Steve Smith
Thanks for the suggestion.  I really appreciate it.

Steve

From: django-users@googlegroups.com  on behalf 
of Jacob Greene 
Sent: Friday, February 25, 2022 9:43 PM
To: django-users@googlegroups.com 
Subject: Re: Slow page load performance with a large number of formsets (over 
25)

You would need to cache the queryset and pass it to each form instance that the 
formset creates. I've done this a few different ways in the past. I've never 
understood why there isn't a more straight forward way to do this. Here's a 
post with a few legit options depending on your use case:

https://stackoverflow.com/questions/8176200/caching-queryset-choices-for-modelchoicefield-or-modelmultiplechoicefield-in-a-d

Hard to be more specific without knowing anything about your code.

On Fri, Feb 25, 2022, 8:53 PM Steve Smith 
mailto:stevesmith0...@hotmail.com>> wrote:

If in fact I am….how do I avoid this?  I have been playing with alternatives 
for a week and I’m starting to lose it…lol



Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows



From: Jacob Greene<mailto:jacobgreene1...@gmail.com>
Sent: Friday, February 25, 2022 5:58 PM
To: django-users@googlegroups.com<mailto:django-users@googlegroups.com>
Subject: Re: Slow page load performance with a large number of formsets (over 
25)



If you're using model choice fields, it's very likely you are making an SQL 
query for each form set. It should be pretty obvious in the log with debug 
turned on.



On Fri, Feb 25, 2022, 4:31 PM Ryan Nowakowski 
mailto:tuba...@fattuba.com>> wrote:

Steven, are you using ModelFormSet?  If so, Is it the initial query
that's slow?  The form rendering?  Or is it the POST back to the server
that's slow?  You can use django-debug-toolbar[1] to profile your page
and get these metrics.

Once you figure out what part is slowest, then you can optimize.

Hope this helps!

Ryan N

[1] https://django-debug-toolbar.readthedocs.io/en/latest/

On Mon, Feb 07, 2022 at 09:12:48AM -0800, Steven Smith wrote:
> Did this issue ever get resolved?  I'm experiencing the same thing.  Once
> it hits 100 forms or so it gets pretty slow.
>
> On Monday, September 22, 2014 at 10:48:52 AM UTC-5 Collin Anderson wrote:
>
> > Yes, if you want speed, using javascript and ajax is probably your best
> > bet. It will probably also reduce merge-conflicts.
> >

--
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<mailto:django-users%2bunsubscr...@googlegroups.com>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/20220225222926.GH11627%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<mailto:django-users+unsubscr...@googlegroups.com>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAF-Y%3De5Fp7kDtLq47Z3Y4GEjXMne2PcTLYxOJ8St5gkKCkpUpw%40mail.gmail.com<https://groups.google.com/d/msgid/django-users/CAF-Y%3De5Fp7kDtLq47Z3Y4GEjXMne2PcTLYxOJ8St5gkKCkpUpw%40mail.gmail.com?utm_medium=email&utm_source=footer>.



--
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<mailto:django-users+unsubscr...@googlegroups.com>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CH0PR18MB42923C9432F56E071FA9716CD23F9%40CH0PR18MB4292.namprd18.prod.outlook.com<https://groups.google.com/d/msgid/django-users/CH0PR18MB42923C9432F56E071FA9716CD23F9%40CH0PR18MB4292.namprd18.prod.outlook.com?utm_medium=email&utm_source=footer>.

--
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<mailto:django-users+unsubscr...@googlegroups.com>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAF-Y%3De4E3zFuzmK_UOf9exaEc5pM5FNun7xJXhn_yVbHyWqiWg%40mail.gmail.com<https://groups.google.com/d/msgid/django-users/CAF-Y%3De4E3zFuzmK_UOf9exaEc5pM5FNun7xJXhn_yVbHyWqiWg%40mail.gmail.com?utm_medium=email&utm_source=footer>.

-- 
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/CH0PR18MB429297C1C7D04F4094D10D8CD23F9%40CH0PR18MB4292.namprd18.prod.outlook.com.


Re: How to create dynamic models in django??

2022-02-27 Thread Steve Smith
My two cents.  I've been trying to do a very similar thing...I've accomplished 
it in Djangousing FormsetsIt was painfulthe documentation on 
Formsets is scarce in my opinion and to get them to work is a lot of trial and 
error, not to mention complexity with corresponding Javascript.  At least for 
me it was.  I'm not using the rest framework as it relates to a table and rows 
but I am using them with a server based Django installationso I'm not sure 
how this applies to your use case.  I have recently started experimenting with 
HTMXto ultimately replace formsets and I'm pretty close to having it 
figured out.  Again with HTMX, there's not a lot of documentation so it's been 
a ton of trial and errorIf any of this resonates with you...let me know and 
I can provide some more specifics.

Steve


From: django-users@googlegroups.com  on behalf 
of Antonis Christofides 
Sent: Sunday, February 27, 2022 12:58 AM
To: django-users@googlegroups.com 
Subject: Re: How to create dynamic models in django??


Short answer: I don't know. It probably isn't straightforward, but it's doable 
in principle.

Longer answer: Django hasn't been designed with this case in mind. It's 
possible it's not the appropriate tool for the job (but again it might be, I 
don't know). In my experience you should avoid doing such things—it's likely to 
lead to an unmanageable code mess. Keep it simple. Consider working without a 
relational database.

Regards,

Antonis

Antonis Christofides
+30-6979924665 (mobile)

On 27/02/2022 05.40, Prashanth Patelc wrote:
How to create dynamic models in django rest framework?
Is there any chance to create dynamic models with APIs

Any examples please send me thanks in advance..

1) Requirement is need create table name and fields in frontend
2) we are  getting the data and store in to the db create db structure
3) get the table name and fields create table in backend &postgresql store to
4)this code don't update or add into the models
5)store the data into the tables
4)get the data into the tables using orm or any raw queries

--
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/CAMCU6Coop%3DVU67%2B1Ui%2BswvA2xijUYcre%2B%3D-Z_CzLnf-1pRRXUw%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/86427c17-5103-2370-2bf4-c951c77b288e%40antonischristofides.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/CH0PR18MB429283E111DA0882F61FD029D2009%40CH0PR18MB4292.namprd18.prod.outlook.com.


Re: migrations problem in django

2022-06-02 Thread Steve Smith
Looks like a spelling error at first glancemax_length...not max_lenght

That's my first guess...

From: django-users@googlegroups.com  on behalf 
of Paras Kashyap 
Sent: Wednesday, June 1, 2022 12:00 PM
To: Django users 
Subject: migrations problem in django

TypeError: Field.__init__() got an unexpected keyword argument 'max_lenght'
Please someone tell me how to fix this error, this error occurs when i try to 
make migrations

--
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/81c3da4c-5607-47e9-9fb1-458fa936afc1n%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/CH0PR18MB4292EEADED29823A09D6B9A2D2DE9%40CH0PR18MB4292.namprd18.prod.outlook.com.


Hosting Recommendations?

2024-12-04 Thread Steve Smith
Hello all!

I'm getting ready to put my project out into the world.  I'm researching 
hosting options.and have recently somewhat settled on Digital Ocean...I 
haven't dug in to start deployment yetbut any recommendations on if this is 
a solid option or if there are others out there worth considering?

Thanks in advance.

Steve

-- 
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 visit 
https://groups.google.com/d/msgid/django-users/PH7PR11MB6857966E9F2FB0D704A13011D2372%40PH7PR11MB6857.namprd11.prod.outlook.com.