Your code is not wrong but just add "url" after static. Then it will work

On Tue, May 2, 2023, 5:44 PM William Nash (Bill) <[email protected]> wrote:

> Try this.  I'm still learning myself
>
> In your HTML file, you can use the img tag to display the image.
>
> <img src="{% static 'images/your_image_name.jpg' %}" alt="Your Image">
>
> To check if the QR code is true or false, you can use Django's views.py
> file. In your views.py file, write a function that will check the validity
> of the QR code. The function should redirect the user to the next page if
> the QR code is valid. The function should return an error message if the QR
> code is invalid.
>
> from django.shortcuts import render, redirect
>
> def scan_qr_code(request):
>     if qr_code_is_valid:
>         return redirect('next_page')
>     else:
>         error_message = 'Invalid QR code'
>         return render(request, 'error.html', {'error_message':
> error_message})
> On Tuesday, May 2, 2023 at 9:19:15 AM UTC-5 Edit Sensei wrote:
>
>> How to show image(static) files in django HTML
>> Actually i was created scan QRcode . I want to show QRcode. If it code is
>> true then next page..
>> Else code false then error...
>>
> --
> 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 [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/7ad0255d-34d4-466c-aef2-2eb73f98186dn%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/7ad0255d-34d4-466c-aef2-2eb73f98186dn%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAGQoQ3zZKbt%2BXCsN%3Dg-HkfQz_A6uxeswVua8EGZWxvQ-04-ttg%40mail.gmail.com.

Reply via email to