Wednesday, November 29, 2023

Re: htmx progress indicator problem - might be caching

Not sure if it's related, but you've got a div inside a p element there:
<p><div hx-get="/hx_usr_progress" hx-trigger="every 1s"></div></p>

That'll probably get corrected by the browser to:
<p></p> <div hx-get="/hx_usr_progress" hx-trigger="every 1s"></div> <p></p>

Another thing is, it doesn't look like there's anything linking the submit button click to the initial htmx request, and there's no htmx in the response. Have you tried replicating the progress bar example?
https://htmx.org/examples/progress-bar/


On Tuesday, November 28, 2023 at 2:26:20 AM UTC Mike Dewhirst wrote:
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 ...

  <div class="submit-row">
    <input type="submit" value="     {{ btn_label }}      "/>
  </div>
  <p><div hx-get="/hx_usr_progress" hx-trigger="every 1s"></div></p>

... 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"<p>... {progress}</p>"))

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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/020a98ef-4a10-4560-afdd-0a8b065e7235n%40googlegroups.com.

Tuesday, November 28, 2023

Displaying numbers in languages

Hi,

Since Speedy Match was only in English, I displayed numbers in the English format - with commas as thousand separators. For example today it writes:

The total number of active members on the site is 12,221, of which 2,581 members entered the site in the last week.

Now, I translated Speedy Match into other languages, such as French, German, Spanish, Portuguese and Italian. In these languages I still use the same number formatting as in English:

Le nombre total de membres actifs sur le site est 12,221, dont 2,581 membres entrés sur le site au cours de la dernière semaine.

Die Gesamtzahl der aktiven Mitglieder auf der Website beträgt 12,221, von denen 2,581 Mitglieder die Website in der letzten Woche betreten haben.

Is it better to use formats.number_format and display the numbers in each language differently? Or is it OK to keep it this way? I'm specifically asking people who speak languages such as French, German, Spanish, Portuguese, Italian and Dutch. How important it is to change the thousand separators?

Thanks,
Uri.

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CABD5YeEBFAJK_v4er294-GDqLrRFOsiS1bY1rxmdQve3PNXcig%40mail.gmail.com.

Monday, November 27, 2023

htmx progress indicator problem - might be caching

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 ...

  <div class="submit-row">
    <input type="submit" value="     {{ btn_label }}      "/>
  </div>
  <p><div hx-get="/hx_usr_progress" hx-trigger="every 1s"></div></p>

... 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"<p>... {progress}</p>"))

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

Sunday, November 26, 2023

Re: Project together

I am interested

Phone ( WhatsApp): +234-8071-505-514

On Thu, 23 Nov 2023 at 7:13 PM, Youssef Bachraoui <bachraouiyoussef3@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+unsubscribe@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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAAP9wczbDL6n7qW5WARHwGsR8hbVgwV0K%3DdTGJoBqE3aQc4TWA%40mail.gmail.com.

Saturday, November 25, 2023

Re: Simple Ajax Search

you can try typeahead.js

https://twitter.github.io/typeahead.js/

On Thursday, 23 November 2023 at 15:10:24 UTC raghav bajaj wrote:
You can make an AJAX call using the oninput event of the search input field. Use a GET method to fetch the results from the DB in the AJAX call.

On Thu, Nov 23, 2023 at 6:06 PM lone...@gmail.com <lone...@gmail.com> wrote:
Hello all,

   I am looking for a simple how-to on creating an interactive search on a text field.  As the user types the search results change and the user can click on the search result that they want.  I have installed jquery3 and bootstrap5 in my django project.

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...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/6bc300c2-1d1f-4e87-90bb-1311e2120c77n%40googlegroups.com.


--
Raghav Bajaj
Cell: +91 7420889933

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/d3e27813-ac8d-4a92-b99b-72b4777ba414n%40googlegroups.com.

Thursday, November 23, 2023

Re: Project together

I had just started Django but have being a developer if you don't mind am interested. This is my WhatsApp number: +2347081424159

On Thu, 23 Nov 2023 at 19:13, Youssef Bachraoui <bachraouiyoussef3@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+unsubscribe@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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAPSG2fdV-WNbfUV7Wzti0LRHmwugVG5qrBGmKVmxNaXuffsiJw%40mail.gmail.com.

Thursday, November 16, 2023

Re: GeoDjango Hosting

No no please don't go to digital ocean..
 I know many people how have much problems... No dedicated cpu.. no fix ressources... No go...

IKT Service <serviceikt354@gmail.com> schrieb am Do., 16. Nov. 2023, 16:35:
Try digital Ocean 

tor. 16. nov. 2023 kl. 15:17 skrev Ernest Okiya <okiyaearnest@gmail.com>:
Hello. GCP will work best for you. Try it out

On Thu, 16 Nov 2023, 02:46 lone...@gmail.com, <lonesoac0@gmail.com> wrote:
Hello all,

    I am looking for a webhosting service that allows me to install qgis software packages on the webhost.  My preferred hosts are either Ubuntu or Debian.  Anyone know of any good solutions?

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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/e106b78b-847a-451c-87d2-33bb246185f8n%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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAM2QfqoPbSUHxtcXQVBjM0-_RffOe2agzb2iY465W0%3DFnQ%3DYPg%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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAA7BsYgs%3DZk8PfXmwtt0u2mhi7GJ72rztXqH-rHV5rfOP6jP_w%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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAKGT9mxYw%2BPoY5CV2kmJmH83%2B8pAAo-3JT2Zid6-ZOJkdzi2GQ%40mail.gmail.com.

Wednesday, November 15, 2023

Re: GeoDjango Hosting

Hello,

Take a VPS when you don't need hugh amount of ressources. We have in germany netcup atarts with 3,25€ with 40 GB ssd and you can install every OS what you want or when you need much more ressources then a root server with dedicate CPU. Starts from around 10€ per month with 4 high end cores, i think 6 gb ram and 80GB ssd.


Netcup is a very good Provider.

Regards

lone...@gmail.com <lonesoac0@gmail.com> schrieb am Do., 16. Nov. 2023, 00:45:
Hello all,

    I am looking for a webhosting service that allows me to install qgis software packages on the webhost.  My preferred hosts are either Ubuntu or Debian.  Anyone know of any good solutions?

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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/e106b78b-847a-451c-87d2-33bb246185f8n%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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAKGT9mybG5XddUJWPMFSgZ755M499HqTDhUEjOOQDiaB18AubA%40mail.gmail.com.

Re: GeoDjango Hosting

create account with https://osphosting.com

On Thu, Nov 16, 2023 at 2:46 AM lone...@gmail.com <lonesoac0@gmail.com> wrote:
Hello all,

    I am looking for a webhosting service that allows me to install qgis software packages on the webhost.  My preferred hosts are either Ubuntu or Debian.  Anyone know of any good solutions?

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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/e106b78b-847a-451c-87d2-33bb246185f8n%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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CACng%3DehDPGcg%2BV%3DaLt5WZNj96nPMU4VexTwEB4tAtt12QvUa%2BQ%40mail.gmail.com.

Re: GeoDjango Hosting

Hello. GCP will work best for you. Try it out

On Thu, 16 Nov 2023, 02:46 lone...@gmail.com, <lonesoac0@gmail.com> wrote:
Hello all,

    I am looking for a webhosting service that allows me to install qgis software packages on the webhost.  My preferred hosts are either Ubuntu or Debian.  Anyone know of any good solutions?

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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/e106b78b-847a-451c-87d2-33bb246185f8n%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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAM2QfqoPbSUHxtcXQVBjM0-_RffOe2agzb2iY465W0%3DFnQ%3DYPg%40mail.gmail.com.

GeoDjango Hosting

Hello all,

    I am looking for a webhosting service that allows me to install qgis software packages on the webhost.  My preferred hosts are either Ubuntu or Debian.  Anyone know of any good solutions?

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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/e106b78b-847a-451c-87d2-33bb246185f8n%40googlegroups.com.