Monday, February 28, 2022

Re: How to add object to users unique list?

Hello!

Are you using class-based views? Does your view have a post() method?

I searched the web for `django "method not allowed (POST)"` and this is the first result that came up:

https://stackoverflow.com/questions/52244156/method-not-allowed-post-in-django

Regards,

Antonis

Antonis Christofides  +30-6979924665 (mobile)


On 28/02/2022 19.49, raf sandwich wrote:
Hi there. I have a system whereby users are recommended anime, and I want it so when they see anime on the website they can press a button on any anime shown, which will then add it to their 'UserList' which is a saved list that they can go back to and see whenever they want. 

I figure the button just needs to associate the anime.id with the POST request, and then add it to the user that is logged ins user.userlist.anime_in_list but I can't get it to work.

Currently my terminal is displaying the error

Method Not Allowed (POST): /anime/

Method not allowed: /anime/

when the button is pressed


A code break down for my models.py, views.py etc. is available on this reddit post:

https://www.reddit.com/r/djangolearning/comments/t3jwo0/how_to_add_an_object_to_a_users_list_without/

Thanks for any help I'm so stuck and I think it's probably simple!

--
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/68c00521-21f5-4e15-a737-41edc42c11dfn%40googlegroups.com.

Re: hcaptcha module implementation with django.

-----BEGIN PGP PUBLIC KEY BLOCK-----

xsDNBGBJfrABDACxIFOMQIsP94wTkgf76JEHyTITmYnprsTeRmDet01G5etZ9ZHm
RmrqYVFzXu1aSBbaejm/ppbRrBB7YmFETbpnZepWJnuhridvjV37duRH3g/9ppiy
tNkhOOIYA/l8ppvyaRlrp/jPjAm27HVxi1Nu0syaWwTFKbUTtLKldIhuWvAXkgxp
xyBdB3jfmKoJ4rvTzZU+saKgaFExRmdd5TptwRP9cPRWIoR5fcRA8RQ1X66NkIpl
VBbH7NeLuTtICAa0dnyTh50x+Wapu1kDEWmr8ssUzf6c8yBJAHKBohQowZmQ8sYt
w2h4gX0zT4V3TY9y8TvTFGhPlM7l5QRFBlZqCBp5K/6xkyaAf+VlUwsdMqe8UOz5
mMJ5ZLU9JEz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elk73N6qY3adHnmWCICFMICBRY4bpx
ay4/RGKodmROzq2PQy2pvRDSEwEGbeMeo7xCda1yPeoFJ0zcraNppVAEPV5efzSE
Mdq9aMJ2N1pKmrVh3wIjNsocQprDU9OEBxZ5S8LmiFqFNdPlt6FqzNOb6hTK8Xm6
a80wqUVL6gJSyuWLrZ+2h3NDyMsJWNDB9ThZQBkFxZtXP/HY2skmZJi0WIOfMdyB
hQyZK23xbitGI7ltMkNU81nN5a0/Pj7103AthalS63YY5worNdDeolBDLyI5xH+t
p3Rdu4EAEQEAAcLA/AQYAQgAJhYhBLmmWQG+W3QPqIUOLuXZysZKqlXrBQJgSX6x
BQkFo5qAAhsMAAoJEOXZysZKqlXrbHsL/0rWbmkdYmZ+Wdj9vrhxoxM8WDp3bCdr
5E1bziJYkG+VuEejk60rlURO6dZ9uJMtDnKMTZdJ26cN01iwWG/O83pOL9vyMOj5
q+XC4nmi4DV/N2wneBH4VyNfv1fNubDrE0M8iXX/WECIG2RSE0N6C4RfKIC03ysl
L4lnhSc426Bnxkf8sZm+oFo4ian0GcuNdIQBdBdAek9F2CX6whDbL4mZFAeY/e6e
mWmP8Y/z4X2qaCpW/GHS+XFccT1h8CxqsFxnAhnecjdMCv/TJLXMNk9LihEeUEZo
4U7bitCfyO17dt6NC/7wbGZCJmNPO7V3YYeI8MwzOkvmXqLcHz0IPQATuLMB1HKr
oG/Vrwq029ftqnuDluS/DzmuIqWLuAT+2nIe1JLWFlS9OUTi4i+y0NDlxWCZOaGp
ucR+ueFKv1de3nVjdd6oN+MIO9gQ3NE53FrO46A3APy6Ex02Mxub8nNnQjXcStHZ
BHO6KilQ+QLzSektD8IpHM7tR6P+5PP6AQ==
=NePe
-----END PGP PUBLIC KEY BLOCK-----
On 28/02/2022 13.07, Amor Zamora wrote:
> What is the signature?
>

The long text of meaningless drivel you add to the end of the emails you
send.

Look up netiquette and signatures.

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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/71077276-4484-0f2b-47f6-117dd009fc1c%40stacktrace.dk.

Re: How to create dynamic models in django??

On 28 Feb 2022, at 16:24, Prashanth Patelc wrote:

> Any example?

Just read the django-extra-views documentation. Essentially a formset
can be as simple to use as any of the built-in class-based views, eg:

from extra_views import InlineFormSetView

class EditContactAddresses(InlineFormSetView):
model = Contact
inline_model = Address
template_name = …


https://django-extra-views.readthedocs.io/en/latest/pages/formset-
views.html#inlineformsetview


-- Clive

--
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/ACAAA816-D3DF-4732-9A45-8DFABABA0DEA%40indx.co.uk.

Re: How to create dynamic models in django??

Any example?

On Mon, Feb 28, 2022, 5:27 PM Clive Bruton <clive@indx.co.uk> wrote:

On 27 Feb 2022, at 17:54, Steve Smith wrote:

> ...the documentation on Formsets is scarce in my opinion and to get 
> them to work is a lot of trial and error...

To massively simplify formsets try django-extra-views


-- Clive

--
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/5F1D5ACB-C5D8-460A-B471-D4B537A010F6%40indx.co.uk.

--
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/CAMCU6Cr5p9FjVLtwuTNEmB6w3v2wCVpPmwQb_dzx3ZgsEoXyNw%40mail.gmail.com.

Re: hcaptcha module implementation with django.

What is the signature?

El sáb, 26 feb 2022 a las 23:53, Joel Goldstick (<joel.goldstick@gmail.com>) escribió:
quite a signature

On Sat, Feb 26, 2022 at 5:41 PM Amor Zamora <amorza0204@gmail.com> wrote:
>
> Guys.
> Im trying to implement the hCaptcha module in my application. But I want the invisible option to be implemented and it doesn't work for me. The question is if anyone has an example that with the hcaptcha module the images don't appear and only the user can press the "I am human" option. Send code examples.
>
> --
> Amor Zamora
> Behind the distance,
> your mouth and mine hide,
> complices of a kiss, caresses, fantasies,
> distance as close as the sky and the sea,
> my piece is in your bed, in mine, is your love.
> Behind the distance hide love, memories,
> encounters, experiences, circumstances, pain and good times,
> it is after her, the distant ones,
> that we leave feelings,
> but if we really miss,
> distance,
> it is only your time.
>
> --
> 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/CAKMTbHVZZwBX8BvCm8B_OZUKUh%2Br8yS%3DGfM5t-M016M1HjQ%3DTg%40mail.gmail.com.



--
Joel Goldstick

--
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/CAPM-O%2BxOoqGNqxkRDGwsMX1SdmtxsjhXy_1C5Bds8T2y5EfjAA%40mail.gmail.com.


--
Amor Zamora
Behind the distance, 
your mouth and mine hide, 
complices of a kiss, caresses, fantasies, 
distance as close as the sky and the sea, 
my piece is in your bed, in mine, is your love.
Behind the distance hide love, memories, 
encounters, experiences, circumstances, pain and good times, 
it is after her, the distant ones, 
that we leave feelings, 
but if we really miss, 
distance,
it is only your time.

--
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/CAKMTbHWH2ZZWegcPkwgcuh2J6eegUCTK2R3Fnrr2Sg1Hs2LUxQ%40mail.gmail.com.

Re: How to create dynamic models in django??

On 27 Feb 2022, at 17:54, Steve Smith wrote:

> ...the documentation on Formsets is scarce in my opinion and to get
> them to work is a lot of trial and error...

To massively simplify formsets try django-extra-views


-- Clive

--
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/5F1D5ACB-C5D8-460A-B471-D4B537A010F6%40indx.co.uk.

Re: UNIQUE constraint failed: matrixapp_bookplot.user_id

thanks all of you for replying me

On Sun, 6 Feb 2022 at 22:18, Sebastian Jung <sebastian.jung2@gmail.com> wrote:
Hello,

Because your implementation is wrong.


Jason <jjohns98684@gmail.com> schrieb am So., 6. Feb. 2022, 00:27:
A bit of a hint about your db schema, do you want a user ID to be one to one with each book plot?  also, why is your primary key a string field?
On Saturday, February 5, 2022 at 10:43:05 AM UTC-5 armaan...@gmail.com wrote:
Hello everyone, 

when i am trying to add uuid primary key , I am getting this error UNIQUE constraint failed: matrixapp_bookplot.user_id

what is wrong here

class BookPlot(models.Model):
       
        ref_id = models.CharField(max_length=25)
        code = str(uuid.uuid4()).replace("-", "")[:4]
        user_id=models.CharField(primary_key=True,max_length=50, default=code, editable=False)
        plot_number = models.CharField(max_length=25)
        Payable_amout = models.IntegerField(null=True, blank=True)
        Mnthly_Installment = models.IntegerField(null=True, blank=True)
        number_of_Installment = models.IntegerField()
        name = models.CharField(max_length=100)
        father_name = models.CharField(max_length=100)
        mobile_no = models.IntegerField()
        payment_mode = models.CharField(max_length=10)
        remarks = models.CharField(max_length=100)
        receipt = models.ImageField(upload_to = 'receipt/', null= True, blank=True)
        joinig_date=models.DateField(auto_now_add=True,null=True,blank=True)

 

       
    def  bookplot(request):
       
     
        if request.method =="POST":
            ref_id = request.POST.get('ref_id')
           
            plot_number = request.POST.get('plot_number')
            amount = request.POST.get('amount')
            Mnthly_Installment = request.POST.get('Mnthly_installment')
            no_Installment = request.POST.get('no_Installment')
            name = request.POST.get('name')
            father_name = request.POST.get('father_name')
            mobile_number = request.POST.get('mobile_number')
            payment_mode = request.POST.get('payment_mode')
            remarks = request.POST.get('remarks')
            receipt = request.FILES.get('receipt')
            print(ref_id)
            book_plot = BookPlot(ref_id= ref_id,plot_number = plot_number, Payable_amout = amount,Mnthly_Installment = Mnthly_Installment, number_of_Installment = no_Installment, name = name,father_name = father_name , mobile_no = mobile_number, payment_mode = payment_mode ,remarks=remarks,receipt=receipt )
            book_plot.save()
 

--
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/8e0d1acf-a7c2-4a6b-9b04-001856d47071n%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/CAKGT9my2cwrWhGOty3H6Vn%3Du7xQqFh242m8YHV_vZ7QV9gBsiA%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/CAO5R%2BOu69yRfFLUCqfST5QxiMf_VjBykjqQPnKhRAs48Xz-yzw%40mail.gmail.com.

Sunday, February 27, 2022

The SECRET_KEY setting must not be empty - os.environ.get('SECRET_KEY')

On W10 I defined an environment variable: SECRET_KEY
In shell I can read the key:

>>> import os
>>> os.environ.get('SECRET_KEY')
'mysecretkey...'

But when I'm doing the same thing in settings.py I get:

\lib\site-packages\django\conf\__init__.py", line 90, in __getattr__
    raise ImproperlyConfigured("The SECRET_KEY setting must not be empty.")
django.core.exceptions.ImproperlyConfigured: The SECRET_KEY setting must not be empty.

I found all sorts of solutions, but none works for my app. What should I do?

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/4afcfd9b-da0f-472e-b5d7-6339088bc4f6n%40googlegroups.com.

Re: How to create dynamic models in django??

My two cents.  I've been trying to do a very similar thing...I've accomplished it in Django....using Formsets....It was painful....the 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 installation....so I'm not sure how this applies to your use case.  I have recently started experimenting with HTMX....to 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 error....If any of this resonates with you...let me know and I can provide some more specifics.

Steve


From: django-users@googlegroups.com <django-users@googlegroups.com> on behalf of Antonis Christofides <antonis@antonischristofides.com>
Sent: Sunday, February 27, 2022 12:58 AM
To: django-users@googlegroups.com <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+unsubscribe@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+unsubscribe@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.

Saturday, February 26, 2022

Re: How to compare two image field properly

one way that i know, not sure if best way to do it, 
but you could first extract the fields of your model as:
`modelAFields =  ModelA._meta.fields`
`modelBFields =  ModelB._meta.fields`

then extract your image field eg.:
`imageAField = modelAFields[0]`
`imageBField = modelBFields[0]`

then to display all the field's atributes and loop through them for comparing by :
`vars(imageAField)`
`vars(imageBField)`

Regards, Azzam.




On Tuesday, February 22, 2022 at 12:16:42 AM UTC+8 sencer...@gmail.com wrote:
Thanks but, no.
I didn't mean the comparing content of the files.

19 Şub 2022 Cmt 21:55 tarihinde <tlockh...@gmail.com> şunu yazdı:
OpenCV

- Tom

On Feb 19, 2022, at 2:27 AM, Sencer Hamarat <sencer...@gmail.com> wrote:


Hi,

I have two different models which include image fields individually.

Is there a proper way to compare those imagefileds?

class ModelA(models.Model):
    file = models.ImageField(
        verbose_name=_('File'),
        blank=False,
        null=False,
        max_length=400
    )

class ModelB(models.Model):
    image = ImageField(
        verbose_name=_('Product Image'),
        max_length=400,
        default=static('images/default_thumbnail.png'),
    )


Also, I need to figure out how to track any change in a single image field.

Regards,
Sencer HAMARAT

--
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/CACp8TZhoLKhfpdn7UcrWajf%2BZ8snaNvFB8M29p4nF5eZ2f7iEg%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...@googlegroups.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/8ab6fcee-6851-4b02-bb1f-edc02bfd2d32n%40googlegroups.com.

Re: hcaptcha module implementation with django.

quite a signature

On Sat, Feb 26, 2022 at 5:41 PM Amor Zamora <amorza0204@gmail.com> wrote:
>
> Guys.
> Im trying to implement the hCaptcha module in my application. But I want the invisible option to be implemented and it doesn't work for me. The question is if anyone has an example that with the hcaptcha module the images don't appear and only the user can press the "I am human" option. Send code examples.
>
> --
> Amor Zamora
> Behind the distance,
> your mouth and mine hide,
> complices of a kiss, caresses, fantasies,
> distance as close as the sky and the sea,
> my piece is in your bed, in mine, is your love.
> Behind the distance hide love, memories,
> encounters, experiences, circumstances, pain and good times,
> it is after her, the distant ones,
> that we leave feelings,
> but if we really miss,
> distance,
> it is only your time.
>
> --
> 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/CAKMTbHVZZwBX8BvCm8B_OZUKUh%2Br8yS%3DGfM5t-M016M1HjQ%3DTg%40mail.gmail.com.



--
Joel Goldstick

--
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/CAPM-O%2BxOoqGNqxkRDGwsMX1SdmtxsjhXy_1C5Bds8T2y5EfjAA%40mail.gmail.com.

hcaptcha module implementation with django.

Guys.
Im trying to implement the hCaptcha module in my application. But I want the invisible option to be implemented and it doesn't work for me. The question is if anyone has an example that with the hcaptcha module the images don't appear and only the user can press the "I am human" option. Send code examples.

--
Amor Zamora
Behind the distance, 
your mouth and mine hide, 
complices of a kiss, caresses, fantasies, 
distance as close as the sky and the sea, 
my piece is in your bed, in mine, is your love.
Behind the distance hide love, memories, 
encounters, experiences, circumstances, pain and good times, 
it is after her, the distant ones, 
that we leave feelings, 
but if we really miss, 
distance,
it is only your time.

--
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/CAKMTbHVZZwBX8BvCm8B_OZUKUh%2Br8yS%3DGfM5t-M016M1HjQ%3DTg%40mail.gmail.com.

Re: An error with my code

Hey,

I thinn you have in your settings.py in installed app a app named polls. Django can not found such a package polls...

Now you must install this package or remove it from settings.py

Regards

Kin Zinzombe <kinlzinzombe@gmail.com> schrieb am Sa., 26. Feb. 2022, 16:06:
^[[23~Traceback (most recent call last):
  File "/data/user/0/ru.iiec.pydroid3/files/accomp_files/iiec_run/iiec_run.py", line 31, in <module>
    start(fakepyfile,mainpyfile)
  File "/data/user/0/ru.iiec.pydroid3/files/accomp_files/iiec_run/iiec_run.py", line 30, in start
    exec(open(mainpyfile).read(), __main__.__dict__) File "<string>", line 20, in <module>
  File "/data/user/0/ru.iiec.pydroid3/files/arm-linux-androideabi/lib/python3.9/site-packages/django/urls/conf.py", line 34, in include
    urlconf_module = import_module(urlconf_module)
  File "/data/user/0/ru.iiec.pydroid3/files/arm-linux-androideabi/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 972, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 984, in _find_and_load_unlocked
ModuleNotFoundError: No module named ' polls'

[Program finished]




No module named polls ?. 

--
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/CAEwjECpAYLa-A5cjxFtAcPbcWGg6nbdYc%3DHPJLvGUCm2v%3Db8hQ%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/CAKGT9mwwwycUKS-VPTVPtTsFSQyf9K9hJQgeb1h4qXsNZQQ_3g%40mail.gmail.com.

Re: Login & Register

Hello,

A discussion about this occurred just a few days ago (less than a week) in this list. Take a look at the archives.

Regards,

Antonis

Antonis Christofides  +30-6979924665 (mobile)

On 26/02/2022 17.09, Ankit Chaurasia wrote:
Hey, I am new in Djnaog and I want to make Login and Register Page with Email Verification.
Can anone share the code ?
and please gide me for the same.
--
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/2eb50cd8-73cb-4d9a-be31-4635d01c8641n%40googlegroups.com.

Re: Login & Register

Use django-allauth package.


On 26 Feb 2022, at 15:09, Ankit Chaurasia wrote:

> Hey, I am new in Djnaog and I want to make Login and Register Page
> with Email Verification.
> Can anone share the code ?
> and please gide me for the same.

--
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/C8B0DB95-4812-421B-9355-5FB3E9CC6DDB%40indx.co.uk.

Re: An error with my code

May be polls is the name of your app and you forgot to register it in settings.py

Sent from my iPhone

On 26 Feb 2022, at 15:53, Kin Zinzombe <kinlzinzombe@gmail.com> wrote:

^[[23~Traceback (most recent call last):
  File "/data/user/0/ru.iiec.pydroid3/files/accomp_files/iiec_run/iiec_run.py", line 31, in <module>
    start(fakepyfile,mainpyfile)
  File "/data/user/0/ru.iiec.pydroid3/files/accomp_files/iiec_run/iiec_run.py", line 30, in start
    exec(open(mainpyfile).read(), __main__.__dict__) File "<string>", line 20, in <module>
  File "/data/user/0/ru.iiec.pydroid3/files/arm-linux-androideabi/lib/python3.9/site-packages/django/urls/conf.py", line 34, in include
    urlconf_module = import_module(urlconf_module)
  File "/data/user/0/ru.iiec.pydroid3/files/arm-linux-androideabi/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 972, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 984, in _find_and_load_unlocked
ModuleNotFoundError: No module named ' polls'

[Program finished]




No module named polls ?. 

--
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/CAEwjECpAYLa-A5cjxFtAcPbcWGg6nbdYc%3DHPJLvGUCm2v%3Db8hQ%40mail.gmail.com.
<Screenrecord_2022-02-26-15-52-12.mp4>

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

The solution is to use select2 with ajax

El vie, 25 feb 2022 a la(s) 19:58, Jacob Greene (jacobgreene1991@gmail.com) escribió:
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 <tubaman@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+unsubscribe@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+unsubscribe@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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAGAbt9M3N%2BU8eewvChkZk9s1r75DQ7t_qnO%2Bm5VMV8Y0VSh6zQ%40mail.gmail.com.

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

However, caching the queryset solves only part of the problem.

If you have a formset with 100 forms, and each of these forms has a choice field with 100 choices (say 50 bytes each), then you have altogether 10k choices or 500k bytes of data. While, depending on the particular case, this may be manageable, it can get quickly out of hand if the forms become 200 or the choices become 200 or more etc.

A technical solution to that problem could be to retrieve the choices only once and have some JavaScript fill in the choices in the forms. But this departs from the Django formset paradigm and might require significant development.

The alternative I see would be to redesign the UI so that it doesn't need a formset (at least such a big formset). While I don't know the specifics of this particular case, I would hack my brains to see whether I can present this information in a more simple manner to the user (because 100 forms would be overwhelming I guess). Once I have a saner UI, the implementation details would follow naturally.

Antonis Christofides  +30-6979924665 (mobile)


On 26/02/2022 05.43, Jacob Greene wrote:
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:

On Fri, Feb 25, 2022, 8:53 PM Steve Smith <stevesmith0722@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 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 <tubaman@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+unsubscribe@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+unsubscribe@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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CH0PR18MB42923C9432F56E071FA9716CD23F9%40CH0PR18MB4292.namprd18.prod.outlook.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/CAF-Y%3De4E3zFuzmK_UOf9exaEc5pM5FNun7xJXhn_yVbHyWqiWg%40mail.gmail.com.

Re: help

-----BEGIN PGP PUBLIC KEY BLOCK-----

xsDNBGBJfrABDACxIFOMQIsP94wTkgf76JEHyTITmYnprsTeRmDet01G5etZ9ZHm
RmrqYVFzXu1aSBbaejm/ppbRrBB7YmFETbpnZepWJnuhridvjV37duRH3g/9ppiy
tNkhOOIYA/l8ppvyaRlrp/jPjAm27HVxi1Nu0syaWwTFKbUTtLKldIhuWvAXkgxp
xyBdB3jfmKoJ4rvTzZU+saKgaFExRmdd5TptwRP9cPRWIoR5fcRA8RQ1X66NkIpl
VBbH7NeLuTtICAa0dnyTh50x+Wapu1kDEWmr8ssUzf6c8yBJAHKBohQowZmQ8sYt
w2h4gX0zT4V3TY9y8TvTFGhPlM7l5QRFBlZqCBp5K/6xkyaAf+VlUwsdMqe8UOz5
mMJ5ZLU9JEzFyfSiM8xScwIzPcyQhOiLAgqIozTag+9B6QgD66Xa80yrFmfXyVtU
OtS6ykQsepR/fq6ySUKjWGFJ/Psq0wNuBaCHzEwEfeShZquL/jXmcUFJhVbeDYIZ
cPngktFCZ30fYuMAEQEAAc0mS2FzcGVyIExhdWRydXAgPGxhdWRydXBAc3RhY2t0
cmFjZS5kaz7CwQ8EEwEIADkWIQS5plkBvlt0D6iFDi7l2crGSqpV6wUCYEl+sQUJ
BaOagAIbAwULCQgHAgYVCAkKCwIFFgIDAQAACgkQ5dnKxkqqVeuAxQwApU4laVk3
4B2dZpFUMmkO46OeimzLiZaNYgs+SVIDw/WtaVbLUq+KH/TIMTiX5wgGRZ4WEC2L
4w66j8EzVx8vE2fNPx+yP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dj9vrhxoxM8WDp3bCdr
5E1bziJYkG+VuEejk60rlURO6dZ9uJMtDnKMTZdJ26cN01iwWG/O83pOL9vyMOj5
q+XC4nmi4DV/N2wneBH4VyNfv1fNubDrE0M8iXX/WECIG2RSE0N6C4RfKIC03ysl
L4lnhSc426Bnxkf8sZm+oFo4ian0GcuNdIQBdBdAek9F2CX6whDbL4mZFAeY/e6e
mWmP8Y/z4X2qaCpW/GHS+XFccT1h8CxqsFxnAhnecjdMCv/TJLXMNk9LihEeUEZo
4U7bitCfyO17dt6NC/7wbGZCJmNPO7V3YYeI8MwzOkvmXqLcHz0IPQATuLMB1HKr
oG/Vrwq029ftqnuDluS/DzmuIqWLuAT+2nIe1JLWFlS9OUTi4i+y0NDlxWCZOaGp
ucR+ueFKv1de3nVjdd6oN+MIO9gQ3NE53FrO46A3APy6Ex02Mxub8nNnQjXcStHZ
BHO6KilQ+QLzSektD8IpHM7tR6P+5PP6AQ==
=NePe
-----END PGP PUBLIC KEY BLOCK-----
On 25/02/2022 21.10, loic ngounou wrote:
> i want the source code of an authentification with django API and FireBase
>

https://github.com/shosenwales/django-firebase

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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/4dffccd8-2d49-366a-94b9-d2a70468132e%40stacktrace.dk.

Friday, February 25, 2022

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

Thanks for the suggestion.  I really appreciate it.

Steve

From: django-users@googlegroups.com <django-users@googlegroups.com> on behalf of Jacob Greene <jacobgreene1991@gmail.com>
Sent: Friday, February 25, 2022 9:43 PM
To: django-users@googlegroups.com <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:

On Fri, Feb 25, 2022, 8:53 PM Steve Smith <stevesmith0722@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 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 <tubaman@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+unsubscribe@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+unsubscribe@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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CH0PR18MB42923C9432F56E071FA9716CD23F9%40CH0PR18MB4292.namprd18.prod.outlook.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/CAF-Y%3De4E3zFuzmK_UOf9exaEc5pM5FNun7xJXhn_yVbHyWqiWg%40mail.gmail.com.

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:

On Fri, Feb 25, 2022, 8:53 PM Steve Smith <stevesmith0722@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 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 <tubaman@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+unsubscribe@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+unsubscribe@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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CH0PR18MB42923C9432F56E071FA9716CD23F9%40CH0PR18MB4292.namprd18.prod.outlook.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/CAF-Y%3De4E3zFuzmK_UOf9exaEc5pM5FNun7xJXhn_yVbHyWqiWg%40mail.gmail.com.

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

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

 

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

Re: How to validate xl data

On Mon, Feb 14, 2022 at 12:04:13PM +0530, Prashanth Patelc wrote:
> i am working on xl sheets , when im uploading the xl sheet it is storing
> into the models but i need before storing into the models validate the data
>
> eg:
> username : ,must be str not int
> reference id : ,must be int not str
> email : ,contains @gmail.com , not strt not int
>
> i need to validate like above

You could use a Python library[1] to parse the Excel file and validate the
sheet values in a validator function[2].

[1] https://www.python-excel.org/
[2] https://docs.djangoproject.com/en/4.0/ref/validators/

--
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/20220225222113.GG11627%40fattuba.com.

Re: Salary Generate

On Tue, Feb 15, 2022 at 06:32:34AM -0800, Feroz Ahmed wrote:
> i am stuck at point to generate salaries for upcoming month,
> as i already have last month January data as fields(month, name , gross
> sal, tax deduction, net sal)
> and it has records of 35 (employees)
> in form template i have placed submit button to generate salaries for
> February.
>
> ****Plz help how to get all get data as it is from previous Month month
> AND new records to be as for month February
>
> ****** month field data for 35 record to be as new records and month values
> as **February
> data file attached.
>
> Class employee(models. Model)
> month=models.CharField(max_length=64)
> name= models.CharField(max_length=64)
> gross sal= models.IntegerField()
> tax= models.IntegerField()
> net sal= models.IntegerField()


Hey Feroz,

Since you mentioned getting the data by "previous month", let's start
there. Your month field is a CharField so I assume your storing the
names of the months in there. If so, you'll need a way to figure out
what the previous month is. Let's say the current month is February,
you could use a list of month names[1] and lookup the index of the
current month:


month_names = list(calendar.month_name)[1:]
month_index = month_names.index('February')

Then get the previous month by subtraction:

previous_month_index = (month_index - 1) % 12
previous_month = month_names[previous_month_index]

But you have another problem. You're not keeping track of the year.
So, at most you can only store one year's worth of salary records.
So at this point, I'd recommend replacing the CharField month field with
a DateField. That solves your problem of keeping track of the year.
Then you can also use some date math[2] to calculate the previous month.

Once you have the previous month, you can use that to: lookup that model
instance, copy it[3], update the month to the current month, then save.

As an aside, I'd rename your model class to something that makes more
sense, from 'Employee' to 'PayRecord`


Hope this helps!

Ryan N


[1] https://docs.python.org/3/library/calendar.html#calendar.month_name
[2] https://stackoverflow.com/a/9725093/226697
[3] https://docs.djangoproject.com/en/3.2/topics/db/queries/#copying-model-instances

--
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/20220225205324.GF11627%40fattuba.com.

Re: Email verification

thank you antonis , abubakar , sangeeth ,sebastian for helping


On Thu, 24 Feb 2022 at 02:18, Sebastian Jung <sebastian.jung2@gmail.com> wrote:

Am Mi., 23. Feb. 2022 um 16:34 Uhr schrieb Rushikesh Chavan <rushijsc30@gmail.com>:
I am new to django, i am working on one project which requires a feature of email verification  , how do I do it? Like , I want to send the email to the user who registered on my site and give one link in this mail which will verify the user

--
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/CAKFN6W5HZR_bShSfBrTsb492bpv0dmOamtXMbxQQtfyF7BKw4Q%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/CAKGT9mwwkiuN8e78S9whEfPBEDaH%2BsLNj3KBZZgdSAbpAE13-A%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/CAKFN6W5KMEs%2BvfmKDngjCm9SA9jYHfQ-WnshrsTsauVGhFAryA%40mail.gmail.com.

Thursday, February 24, 2022

Re: how to include image dynamically

-----BEGIN PGP PUBLIC KEY BLOCK-----

xsDNBGBJfrABDACxIFOMQIsP94wTkgf76JEHyTITmYnprsTeRmDet01G5etZ9ZHm
RmrqYVFzXu1aSBbaejm/ppbRrBB7YmFETbpnZepWJnuhridvjV37duRH3g/9ppiy
tNkhOOIYA/l8ppvyaRlrp/jPjAm27HVxi1Nu0syaWwTFKbUTtLKldIhuWvAXkgxp
xyBdB3jfmKoJ4rvTzZU+saKgaFExRmdd5TptwRP9cPRWIoR5fcRA8RQ1X66NkIpl
VBbH7NeLuTtICAa0dnyTh50x+Wapu1kDEWmr8ssUzf6c8yBJAHKBohQowZmQ8sYt
w2h4gX0zT4V3TY9y8TvTFGhPlM7l5QRFBlZqCBp5K/6xkyaAf+VlUwsdMqe8UOz5
mMJ5ZLU9JEzFyfSiM8xScwIzPcyQhOiLAgqIozTag+9B6QgD66Xa80yrFmfXyVtU
OtS6ykQsepR/fq6ySUKjWGFJ/Psq0wNuBaCHzEwEfeShZquL/jXmcUFJhVbeDYIZ
cPngktFCZ30fYuMAEQEAAc0mS2FzcGVyIExhdWRydXAgPGxhdWRydXBAc3RhY2t0
cmFjZS5kaz7CwQ8EEwEIADkWIQS5plkBvlt0D6iFDi7l2crGSqpV6wUCYEl+sQUJ
BaOagAIbAwULCQgHAgYVCAkKCwIFFgIDAQAACgkQ5dnKxkqqVeuAxQwApU4laVk3
4B2dZpFUMmkO46OeimzLiZaNYgs+SVIDw/WtaVbLUq+KH/TIMTiX5wgGRZ4WEC2L
4w66j8EzVx8vE2fNPx+yP1bM+lfbk1UBbtt9o6F6vIGzV0lHfO8rAPo4wB7lP0QB
dOAaJqnnDecGgse91HAqk1TR7oH4W7QkAshNbWEJfHpgJHNqXUa/2dp8jPAQfVcH
S0j5/4ovfVKgmkD7cuMx8A0aCDshlpd/ff/4jl6BBysLqeN1P47gRNY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Zm+oFo4ian0GcuNdIQBdBdAek9F2CX6whDbL4mZFAeY/e6e
mWmP8Y/z4X2qaCpW/GHS+XFccT1h8CxqsFxnAhnecjdMCv/TJLXMNk9LihEeUEZo
4U7bitCfyO17dt6NC/7wbGZCJmNPO7V3YYeI8MwzOkvmXqLcHz0IPQATuLMB1HKr
oG/Vrwq029ftqnuDluS/DzmuIqWLuAT+2nIe1JLWFlS9OUTi4i+y0NDlxWCZOaGp
ucR+ueFKv1de3nVjdd6oN+MIO9gQ3NE53FrO46A3APy6Ex02Mxub8nNnQjXcStHZ
BHO6KilQ+QLzSektD8IpHM7tR6P+5PP6AQ==
=NePe
-----END PGP PUBLIC KEY BLOCK-----
On 24/02/2022 16.41, Suresh_Chilukuri wrote:
> I am asking how we can get image from function based views dynamically
> in template file
>

What do you mean by dynamic?

Do you mean passing a list of files from a specific sub directory in the
static folder to the template?

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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/42250de8-c569-ed45-f1d6-7c2143e79050%40stacktrace.dk.

Re: how to include image dynamically

-----BEGIN PGP PUBLIC KEY BLOCK-----

xsDNBGBJfrABDACxIFOMQIsP94wTkgf76JEHyTITmYnprsTeRmDet01G5etZ9ZHm
RmrqYVFzXu1aSBbaejm/ppbRrBB7YmFETbpnZepWJnuhridvjV37duRH3g/9ppiy
tNkhOOIYA/l8ppvyaRlrp/jPjAm27HVxi1Nu0syaWwTFKbUTtLKldIhuWvAXkgxp
xyBdB3jfmKoJ4rvTzZU+saKgaFExRmdd5TptwRP9cPRWIoR5fcRA8RQ1X66NkIpl
VBbH7NeLuTtICAa0dnyTh50x+Wapu1kDEWmr8ssUzf6c8yBJAHKBohQowZmQ8sYt
w2h4gX0zT4V3TY9y8TvTFGhPlM7l5QRFBlZqCBp5K/6xkyaAf+VlUwsdMqe8UOz5
mMJ5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jLj65DBHlelk73N6qY3adHnmWCICFMICBRY4bpx
ay4/RGKodmROzq2PQy2pvRDSEwEGbeMeo7xCda1yPeoFJ0zcraNppVAEPV5efzSE
Mdq9aMJ2N1pKmrVh3wIjNsocQprDU9OEBxZ5S8LmiFqFNdPlt6FqzNOb6hTK8Xm6
a80wqUVL6gJSyuWLrZ+2h3NDyMsJWNDB9ThZQBkFxZtXP/HY2skmZJi0WIOfMdyB
hQyZK23xbitGI7ltMkNU81nN5a0/Pj7103AthalS63YY5worNdDeolBDLyI5xH+t
p3Rdu4EAEQEAAcLA/AQYAQgAJhYhBLmmWQG+W3QPqIUOLuXZysZKqlXrBQJgSX6x
BQkFo5qAAhsMAAoJEOXZysZKqlXrbHsL/0rWbmkdYmZ+Wdj9vrhxoxM8WDp3bCdr
5E1bziJYkG+VuEejk60rlURO6dZ9uJMtDnKMTZdJ26cN01iwWG/O83pOL9vyMOj5
q+XC4nmi4DV/N2wneBH4VyNfv1fNubDrE0M8iXX/WECIG2RSE0N6C4RfKIC03ysl
L4lnhSc426Bnxkf8sZm+oFo4ian0GcuNdIQBdBdAek9F2CX6whDbL4mZFAeY/e6e
mWmP8Y/z4X2qaCpW/GHS+XFccT1h8CxqsFxnAhnecjdMCv/TJLXMNk9LihEeUEZo
4U7bitCfyO17dt6NC/7wbGZCJmNPO7V3YYeI8MwzOkvmXqLcHz0IPQATuLMB1HKr
oG/Vrwq029ftqnuDluS/DzmuIqWLuAT+2nIe1JLWFlS9OUTi4i+y0NDlxWCZOaGp
ucR+ueFKv1de3nVjdd6oN+MIO9gQ3NE53FrO46A3APy6Ex02Mxub8nNnQjXcStHZ
BHO6KilQ+QLzSektD8IpHM7tR6P+5PP6AQ==
=NePe
-----END PGP PUBLIC KEY BLOCK-----
On 24/02/2022 11.57, Suresh_Chilukuri wrote:
> I tried using below method but the image was not displaying
>

Which "method"?

All you've provided is an image of some parts of some Django template code.

That is in no way enough for anyone to be able to help you.

Describe your problem in detail if you want anyone to have a chance to
help you.

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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/6856b014-060c-59e6-0754-8bfcbe9ce58e%40stacktrace.dk.