Kerakli kodlar ( project upload to git )



Download 21,55 Kb.
Sana06.04.2022
Hajmi21,55 Kb.
#532893
Bog'liq
Kerakli kodlar


Kerakli kodlar
( project upload to git ):

  1. git init

  2. git init --initial-branch=main

  3. git remote add origin https://git.quantic.uz/web-intern/ordery-management.git

  4. git add . (hammasini qo’shish)

  5. git commit -m "Ordery Management project created"(koment qo’shish”)

  6. git push -u origin main

Push project :
1.git add .
2.git commit –m “coment qoshamiz”
3.git push
Proyektdagi muammolar:
1.registrationda kamchilik bor.(fully completed !)
2.permissionsda kamchilik bor.
3.Payment qismi hali qilinmadi.(Erkin bn birga qilamiz)
4.OrderServiceda navbatni aniqlash(fully completed !)
5.pip install -r requirements.txt
class UserRegistrationSerializer(serializers.ModelSerializer):


password2 = serializers.CharField(style={'input_type':'password'}, write_only=True)


class Meta:
model = User
fields = ['username', 'email', 'first_name','last_name',
'password', 'password2',]
extra_kwargs = {
'password': {
'write_only':True
}
}


def save(self):
user = User(
email=self.validated_data['email'],
username=self.validated_data['username'],
first_name=self.validated_data['first_name'],
last_name=self.validated_data['last_name'],
is_tutor=self.validated_data['is_tutor'],
is_student=self.validated_data['is_student'],
)


password = self.validated_data['password']
password2 = self.validated_data['password2']


if password != password2:
raise serializers.ValidationError({'password':'Passwords must match.'})
user.set_password(password)
user.save()
return user


Change Password :
from django.contrib.auth import password_validation
from django.utils.translation import gettext_lazy as _
from rest_framework import serializers


class ChangePasswordSerializer(serializers.Serializer):
old_password = serializers.CharField(max_length=128, write_only=True, required=True)
new_password1 = serializers.CharField(max_length=128, write_only=True, required=True)
new_password2 = serializers.CharField(max_length=128, write_only=True, required=True)


def validate_old_password(self, value):
user = self.context['request'].user
if not user.check_password(value):
raise serializers.ValidationError(
_('Your old password was entered incorrectly. Please enter it again.')
)
return value


def validate(self, data):
if data['new_password1'] != data['new_password2']:
raise serializers.ValidationError({'new_password2': _("The two password fields didn't match.")})
password_validation.validate_password(data['new_password1'], self.context['request'].user)
return data


def save(self, **kwargs):
password = self.validated_data['new_password1']
user = self.context['request'].user
user.set_password(password)
user.save()
return user

Bot installed libraries:



  1. Django==4.0.1

  2. python-telegram-bot==13.10

  3. https://python-telegram-bot.readthedocs.io/en/stable/telegram.message.html#telegram.Message.forward

!pip install pandas


import pandas as pd
data = {'vaqt': ["8:00", "9:00","10:00","11:00"], 'habar': [48, 65, 85, 72]}
df = pd.DataFrame(data)

with pd.ExcelWriter("data.xlsx") as writer:


df.to_excel(writer, index=False)
Download 21,55 Kb.

Do'stlaringiz bilan baham:




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish