htmx progress indicator problem - might be caching

2023-11-27 Thread Mike Dewhirst

I'm trying but failing to get htmx to deliver a progress indication.

The task is creating records in the database for each item in a list 
provided by the logged in user.


The view with the submit button collects the list and does the database 
insertion. I added a "progress" property to the User model as follows ...


class User(AbstractUser):

    def __init__(self, *args, **kwargs):

    super().__init__(*args, **kwargs)

    self.progress = ""

    ...

    def set_progress(self, value):

    self.progress = value

    @property

    def get_progress(self):

    return f"{self.progress}"

    ...



In the view I update user.progress with the record insertion counter and 
get_progress returns the correct value in the view itself as proven by 
print statements. So that part is working.


In the template, I have ...

  

    

  

  


... which in theory should fetch progress every second if the htmx docs 
are correct. See https://htmx.org/docs/#polling


This is the htmx view ...

def hx_usr_progress(request):

    progress = request.user.progress

    print(f"\n{progress} ... {request.user}")

    return HttpResponse(mark_safe(f"... {progress}"))


When the import [Submit] button is clicked, the print statement in 
hx_usr_progress fires with a blank progress value as per the 
User.__init__() method AND on the page beneath the Submit button the 3 
dots shown above in the last line of the hx_usr_progress() view but 
nothing further even though the main view is definitely incrementing the 
count.


That tells me it is being called at least once instead of every second. 
It should have fired at least 3 or 4 times.


Or if it did perhaps the original response is cached - I don't know.

How can I get this ticking over?

Thanks for any hints.

Cheers

Mike

--
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/2e329e1e-fcfe-47cc-8404-b1e7de1001f6%40dewhirst.com.au.


Connecting Django with Redis

2023-11-27 Thread lone...@gmail.com
Hello all,

   I wanted to verify the connection between my django and Redis was 
working and I found this article: 
https://studygyaan.com/django/connect-django-with-redis  I have already 
implemented what it asked and I got good results.  I am kind of curious 
though, can I use the instructions with the django testing framework?

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/043e7f27-7407-4a89-a307-1de1b2fb74ccn%40googlegroups.com.


Re: Custom User models

2023-11-27 Thread Ahmed Iftikhar
# models.py
from django.contrib.auth.models import AbstractUser
from django.db import models

class School(models.Model):
# Your School model fields

class SchoolUser(AbstractUser):
school = models.ForeignKey(School, on_delete=models.CASCADE)
# Add other custom fields as needed

# settings.py
AUTH_USER_MODEL = 'your_app.SchoolUser'
DJOSER = {
'SERIALIZERS': {
'user_create': 'your_app.serializers.CustomUserCreateSerializer',
# Add other Djoser serializer configurations as needed
},
# Add other Djoser configurations as needed
}

# serializers.py
from django.contrib.auth import get_user_model
from rest_framework import serializers

class SchoolUserSerializer(serializers.ModelSerializer):
class Meta:
model = get_user_model()
fields = '__all__'

class SchoolSerializer(serializers.ModelSerializer):
class Meta:
model = School
fields = '__all__'
*
at the end
python manage.py makemigrations
python manage.py migrate

and enjoy

On Mon, Nov 27, 2023 at 8:10 PM Okkert Joubert 
wrote:

> Good morning all,
>
> I made a custom user model for a school, it is currently working with
> djoser authentication, now what I want to add is for the school to add
> users, so my School model is a foreignkey in SchoolUser is this possible
> firstly and secondly can I add the djoser authentication to the SchoolUser
> model as well
>
> --
> 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/2754d7b3-a54a-40d6-9cab-50c0a2dbb812n%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/CAGAxPTwxB46wZrgjeiZZop%3Dnq5Ch-4FLXL6z3UO%3DGQq_5g%3Dueg%40mail.gmail.com.


Performance profiling Django Channels async consumers

2023-11-27 Thread Filbert
We are heavily using Django Channels async consumers and haven't found a 
way instrument for performance profiling.

We've tried NewRelic, but per their developers say they don't have support 
for Django Channels.

We run certain websocket connections through Gunicorn, Uvicorn, 
Channels-Async and are looking for anyway to instrument the code to get a 
better analysis of what code is hogging the event loop.

Advice appreciated.

-- 
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/8769b0fc-f23c-44ac-8217-7c3a1da4d379n%40googlegroups.com.


Re: Project together

2023-11-27 Thread Aminu Auwal
I am interested add me +2438062282242

On Mon, Nov 27, 2023 at 4:10 PM okot emmanuel 
wrote:

> add me +256779815657
>
>
>
> On Mon, Nov 27, 2023 at 12:48 AM usman ashir <
> www.usmanashirmu...@gmail.com> wrote:
>
>> yes pls send us the group link. or pls 2348166997172.add my contact
>>
>> On Sun, Nov 26, 2023, 9:38 PM Jay Senkow  wrote:
>>
>>> interested.
>>>
>>> Sent from my iPhone
>>>
>>> On Nov 26, 2023, at 2:46 PM, ekong, emmanuel 
>>> wrote:
>>>
>>> 
>>> I am interested
>>>
>>> Phone ( WhatsApp): +234-8071-505-514
>>>
>>> On Thu, 23 Nov 2023 at 7:13 PM, Youssef Bachraoui <
>>> bachraouiyouss...@gmail.com> wrote:
>>>
 Hi developer i search to make a group on WhatsApp to begin a project
 together anyone interested about that?

 --
 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/d5244e76-6bd3-4bde-bf31-a72720bee1acn%40googlegroups.com
 
 .

>>>
>>> *Disclaimer*
>>> This e-mail is intended solely for the named recipient. The information
>>> contained in this message is strictly confidential.
>>>
>>>- If you are not the named recipient, you are hereby notified that
>>>any use, dissemination or reproduction of this document and or its 
>>> content
>>>is prohibited and may be deemed unlawful.
>>>- If you are not the named recipient of this e-mail, please notify
>>>the sender by a return e-mail and delete all copies of it from your
>>>computer and mail.
>>>
>>> Any views expressed in this e-mail are those of the individual sender,
>>> except where the sender specifically states them to be those of Landmark
>>> University , to whom no liability shall be attached
>>> whatsoever.
>>>
>>> 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/CAAP9wczbDL6n7qW5WARHwGsR8hbVgwV0K%3DdTGJoBqE3aQc4TWA%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/ACC804A9-5EF3-4D3A-B11A-6AE171113174%40gmail.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/CAHNdQhwinzLUgaUvQNfYOnxbXhtk4shxcSn5zz00Kceiz7Zb%2Bw%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/CAHoGtOznPiHRbXdKqJiGQEUgF0i613_%2Bd3ejk%3Dx17EaOXmM%3DUA%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/CAONGAWQA-jaMiejTHgeG2ctddM%2B%3D6VfmXuagMg48TE9dPZ41LQ%40mail.gmail.com.


Re: Custom User models

2023-11-27 Thread Clive Bruton
I am taking it that there is more than one "school"? If so, surely  
it's is just a many-to-many relationship.


On 27 Nov 2023, at 09:33, Okkert Joubert wrote:


Good morning all,

I made a custom user model for a school, it is currently working  
with djoser authentication, now what I want to add is for the  
school to add users, so my School model is a foreignkey in  
SchoolUser is this possible firstly and secondly can I add the  
djoser authentication to the SchoolUser model as well


--
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/2754d7b3-a54a-40d6-9cab-50c0a2dbb812n% 
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/650A06A2-C854-4361-9BF3-5CCDF636F2D0%40indx.co.uk.


Re: Project together

2023-11-27 Thread narcizo norzagaray
Interested, add me


El El jue, 23 de noviembre de 2023 a la(s) 11:14, Youssef Bachraoui <
bachraouiyouss...@gmail.com> escribió:

> Hi developer i search to make a group on WhatsApp to begin a project
> together anyone interested about that?
>
> --
> 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/d5244e76-6bd3-4bde-bf31-a72720bee1acn%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/CAF4Q7cczgfKzRrfhhF24p3au1EjP%3Dt6MUSeagnhWhHa5OB6rxQ%40mail.gmail.com.


Re: Project together

2023-11-27 Thread okot emmanuel
add me +256779815657



On Mon, Nov 27, 2023 at 12:48 AM usman ashir 
wrote:

> yes pls send us the group link. or pls 2348166997172.add my contact
>
> On Sun, Nov 26, 2023, 9:38 PM Jay Senkow  wrote:
>
>> interested.
>>
>> Sent from my iPhone
>>
>> On Nov 26, 2023, at 2:46 PM, ekong, emmanuel 
>> wrote:
>>
>> 
>> I am interested
>>
>> Phone ( WhatsApp): +234-8071-505-514
>>
>> On Thu, 23 Nov 2023 at 7:13 PM, Youssef Bachraoui <
>> bachraouiyouss...@gmail.com> wrote:
>>
>>> Hi developer i search to make a group on WhatsApp to begin a project
>>> together anyone interested about that?
>>>
>>> --
>>> 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/d5244e76-6bd3-4bde-bf31-a72720bee1acn%40googlegroups.com
>>> 
>>> .
>>>
>>
>> *Disclaimer*
>> This e-mail is intended solely for the named recipient. The information
>> contained in this message is strictly confidential.
>>
>>- If you are not the named recipient, you are hereby notified that
>>any use, dissemination or reproduction of this document and or its content
>>is prohibited and may be deemed unlawful.
>>- If you are not the named recipient of this e-mail, please notify
>>the sender by a return e-mail and delete all copies of it from your
>>computer and mail.
>>
>> Any views expressed in this e-mail are those of the individual sender,
>> except where the sender specifically states them to be those of Landmark
>> University , to whom no liability shall be attached
>> whatsoever.
>>
>> 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/CAAP9wczbDL6n7qW5WARHwGsR8hbVgwV0K%3DdTGJoBqE3aQc4TWA%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/ACC804A9-5EF3-4D3A-B11A-6AE171113174%40gmail.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/CAHNdQhwinzLUgaUvQNfYOnxbXhtk4shxcSn5zz00Kceiz7Zb%2Bw%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/CAHoGtOznPiHRbXdKqJiGQEUgF0i613_%2Bd3ejk%3Dx17EaOXmM%3DUA%40mail.gmail.com.


Re: Project together

2023-11-27 Thread Selmane
im interested +213556434461

On Sun, Nov 26, 2023 at 10:48 PM usman ashir 
wrote:

> yes pls send us the group link. or pls 2348166997172.add my contact
>
> On Sun, Nov 26, 2023, 9:38 PM Jay Senkow  wrote:
>
>> interested.
>>
>> Sent from my iPhone
>>
>> On Nov 26, 2023, at 2:46 PM, ekong, emmanuel 
>> wrote:
>>
>> 
>> I am interested
>>
>> Phone ( WhatsApp): +234-8071-505-514
>>
>> On Thu, 23 Nov 2023 at 7:13 PM, Youssef Bachraoui <
>> bachraouiyouss...@gmail.com> wrote:
>>
>>> Hi developer i search to make a group on WhatsApp to begin a project
>>> together anyone interested about that?
>>>
>>> --
>>> 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/d5244e76-6bd3-4bde-bf31-a72720bee1acn%40googlegroups.com
>>> 
>>> .
>>>
>>
>> *Disclaimer*
>> This e-mail is intended solely for the named recipient. The information
>> contained in this message is strictly confidential.
>>
>>- If you are not the named recipient, you are hereby notified that
>>any use, dissemination or reproduction of this document and or its content
>>is prohibited and may be deemed unlawful.
>>- If you are not the named recipient of this e-mail, please notify
>>the sender by a return e-mail and delete all copies of it from your
>>computer and mail.
>>
>> Any views expressed in this e-mail are those of the individual sender,
>> except where the sender specifically states them to be those of Landmark
>> University , to whom no liability shall be attached
>> whatsoever.
>>
>> 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/CAAP9wczbDL6n7qW5WARHwGsR8hbVgwV0K%3DdTGJoBqE3aQc4TWA%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/ACC804A9-5EF3-4D3A-B11A-6AE171113174%40gmail.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/CAHNdQhwinzLUgaUvQNfYOnxbXhtk4shxcSn5zz00Kceiz7Zb%2Bw%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/CAJZh6jAyqT7eWL4804rmL%2BjB%3DaUWyXX_ayzLHAChCgfR96hCvQ%40mail.gmail.com.


Custom User models

2023-11-27 Thread Okkert Joubert
Good morning all,

I made a custom user model for a school, it is currently working with 
djoser authentication, now what I want to add is for the school to add 
users, so my School model is a foreignkey in SchoolUser is this possible 
firstly and secondly can I add the djoser authentication to the SchoolUser 
model as well

-- 
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/2754d7b3-a54a-40d6-9cab-50c0a2dbb812n%40googlegroups.com.