• DASTUR ILOVASI 1.Index.html dastur kodidan namuna
  • 2.forms.py dastur kodidan namuna
  • Fast-food uz




    Download 2,55 Mb.
    bet8/10
    Sana26.07.2024
    Hajmi2,55 Mb.
    #268679
    1   2   3   4   5   6   7   8   9   10
    Bog'liq
    BMI

    INTERNET MANBALARI

    1. https://my.gov.uz

    2. https://kun.uz

    3. https://publicadministration.un.org

    4. https://Lex.uz

    5. https://www.gosuslugi.ru

    6. https://mitc.uz

    7. https://staff.tiiame.uz

    8. PHP and MySQL Veb Development (Developer’s Library)

    9. https://ru.wikipedia.org

    10. https://www.w3schools.com

    11. https://www.javatpoint.com

    12. https://www.javatpoint.com

    13. https://html.com

    14. https://www.norma.uz

    15. https://uzbekistan.travel

    16. https://knowledge.crowdbotics.com

    17. https://www.phpmyadmin.net

    DASTUR ILOVASI
    1.Index.html dastur kodidan namuna:





    fast-food.uz


    rel="stylesheet" href=https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/css/bootstrap.min.css
    integrity="sha384-xOolHFLEh07PJGoPkLv1IbcEPTNtaed2xpHsD9ESMhqIYd0nLMwNLD69Npy4HI+N"
    crossorigin="anonymous"
    />


    }
    }
    }
    2.forms.py dastur kodidan namuna:
    from django.contrib.auth import authenticate
    from django.contrib.auth.hashers import make_password
    from django.core.exceptions import ValidationError
    from django.db.models import CharField
    from django.forms import ModelForm, PasswordInput, Form
    from apps.models import User
    class RegisterForm(ModelForm):
    confirm_password = CharField(PasswordInput())
    class Meta:
    model = User
    fields = (‘first_name’, ‘username’, ‘phone_number’, ‘password’)
    def clean_password(self):
    password = self.data.get(‘password’)
    confirm_password = self.data.get(‘confirm_password’)
    if password != confirm_password:
    raise ValidationError("Password do not match")
    return make_password(password)
    class LoginForm(Form):
    def clean_password(self):
    username = self.data.get(‘username’)
    password = self.data.get(‘password’)
    user = User.objects.get(username=username)
    if not user or user.check_password(password):
    raise ValidationError("Password or Username Do NOt Match")
    return password
    )

    Download 2,55 Mb.
    1   2   3   4   5   6   7   8   9   10




    Download 2,55 Mb.