Hozirgi kunda axborot va kompyuter texnologiyalari iboralari kundalik turmushda eng ko’p qo’llaniladigan tushunchalar desak mubolag’a bo’lmaydi


FOYDALANILGAN ADABIYOTLAR RO’YXATI


Download 0.85 Mb.
bet15/15
Sana19.06.2023
Hajmi0.85 Mb.
#1610558
1   ...   7   8   9   10   11   12   13   14   15
Bog'liq
Diplom ishi Umarjon oxirgi print tayyor

FOYDALANILGAN ADABIYOTLAR RO’YXATI


[1] O’zbеkiston Rеspublikasi Prеzidеntining «Kompyutеrlashtirishni yanada rivojlantirish va axborot kommunikatsiya tеxnologiyalarini joriy etish» to’g’risidagi Farmoni
[2] Qosimov S.S. “Axborot texnologiyalari” Texnika oliy o’quv yurti talabalari uchun. Toshkent 2006.
[3]  IBM РС kompyuterlariga C tili: O’quv qo’llanma А.А. Оbidov, Т.М.Маgrupov; ТDTU.-Т.
[4] Bronnikova, T.S. Loyiha biznes-rejasini ishlab chiqish: Darslik / T.S. Bronnikov. - M .: Alfa-M, INFRA-M, 2012.
[5] Джамеа Крис “Эффективный самоучитель по креативному Web-дизайну. HTML, XHTML, CSS, JavaScript, PHP, ASP, ActiveX. Текст, графика, звук и анимация.” Пер с англ./Крис Джамса, Конрад Кинг, Энди Андерсон - М.: ООО “ДиаСофтЮП”
[6] Tomas Zahreddin Drupal 6 = Das Drupal 6 Praxisbuch. — М.: «Eksmo», 2008. — 432 bet. — ISBN 978-5-699-36219-6
Шувалов М.Г. Основы пожарного дела, М:Стройиздат 1983
[7] https://www.wikipedia.org
[8] https://abt.uz/blog/cashback-tizimi
[9] https://bank.uz/uz/card/karta-cash-back
[10] https://www.developer.android.com
[11] https://www.gazeta.uz/oz/2022/01/07/cashback

ILOVA
from aiogram import executor

from loader import dp, db


import middlewares, filters, handlers
from utils.notify_admins import on_startup_notify
from utils.set_bot_commands import set_default_commands
from utils.shoppings import new, retro

async def on_startup(dispatcher):


await db.create()
shopping = await db.select_shopping()
if not shopping:
for shop in retro:
await db.add_shopping(shop[0], shop[1], shop[2])
for shop in new:
await db.add_shopping(shop[0], shop[1], shop[2])

# Birlamchi komandalar (/star va /help)


await set_default_commands(dispatcher)

# Bot ishga tushgani haqida adminga xabar berish


await on_startup_notify(dispatcher)

if __name__ == '__main__':


executor.start_polling(dp, on_startup=on_startup)

from aiogram import Bot, Dispatcher, types


from aiogram.contrib.fsm_storage.memory import MemoryStorage
from data import config
from utils.db_api.postgresql import Database

bot = Bot(token=config.BOT_TOKEN, parse_mode=types.ParseMode.HTML)


storage = MemoryStorage()
dp = Dispatcher(bot, storage=storage)
db = Database()

from environs import Env

# environs kutubxonasidan foydalanish
env = Env()
env.read_env()

# .env fayl ichidan quyidagilarni o'qiymiz


BOT_TOKEN = env.str("BOT_TOKEN") # Bot toekn
ADMINS = env.list("ADMINS") # adminlar ro'yxati
IP = env.str("ip") # Xosting ip manzili

DB_USER = env.str("DB_USER")


DB_PASS = env.str("DB_PASS")
DB_NAME = env.str("DB_NAME")
DB_HOST = env.str("DB_HOST")
#!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys

def main():


"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'config.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
"available on your PYTHONPATH environment variable? Did you "
"forget to activate a virtual environment?"
) from exc
execute_from_command_line(sys.argv)

if __name__ == '__main__':


main()

from django.contrib import admin

# Register your models here.
from .models import User, Shopping, Cashback, Transfer

admin.site.register(User)


admin.site.register(Shopping)
admin.site.register(Cashback)
admin.site.register(Transfer)

from django.apps import AppConfig


class AppConfig(AppConfig):


default_auto_field = 'django.db.models.BigAutoField'
name = 'app'

from django.db import models

# Create your models here.
class User(models.Model):
id = models.AutoField(primary_key=True)
full_name = models.CharField(verbose_name="Ism familiya", max_length=50)
username = models.CharField(verbose_name="Telegram username", max_length=50, null=True)
telegram_id = models.BigIntegerField(verbose_name='Telegram ID', unique=True, default=1)
balance = models.IntegerField(verbose_name="Balans", null=True)
qiwi = models.CharField(verbose_name="QIWI Wallet", max_length=30, null=True)

def __str__(self):


return f"{self.id} - {self.telegram_id} - {self.full_name}"

class Shopping(models.Model):


id = models.AutoField(primary_key=True)
check_id = models.BigIntegerField(verbose_name="Chek ID")
price = models.IntegerField(verbose_name="Xarid summasi")
date = models.CharField(verbose_name="Xarid sanasi", max_length=11)
used = models.BooleanField(verbose_name="Cashback olindi", null=True)

def __str__(self):


return f"{self.id} - {self.check_id} - {self.price}"

class Cashback(models.Model):


id = models.AutoField(primary_key=True)
telegram_id = models.BigIntegerField(verbose_name="Telegram ID")
check_id = models.BigIntegerField(verbose_name="Chek ID")
price = models.IntegerField(verbose_name="Cashback summasi")
date = models.CharField(verbose_name="Cashback sanasi", max_length=11)

def __str__(self):


return f"{self.id} - {self.telegram_id} - {self.check_id} - {self.price}"

class Transfer(models.Model):


id = models.AutoField(primary_key=True)
telegram_id = models.BigIntegerField(verbose_name="Telegram ID")
price = models.IntegerField(verbose_name="O'tkazma summasi")
date = models.CharField(verbose_name="O'tkazma sanasi", max_length=11)
def __str__(self):
return f"{self.id} - {self.telegram_id} - {self.price}"

from django.test import TestCase

# Create your tests here.
"""
Django settings for config project.

Generated by 'django-admin startproject' using Django 3.2.13.

For more information on this file, see
https://docs.djangoproject.com/en/3.2/topics/settings/

For the full list of settings and their values, see


https://docs.djangoproject.com/en/3.2/ref/settings/
"""

from pathlib import Path

# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent

# Quick-start development settings - unsuitable for production


# See https://docs.djangoproject.com/en/3.2/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!


SECRET_KEY = 'django-insecure-z4niqok*v78e&7g!umu=+dovytwor9%%5)*$mk%=n=gjjt7))7'

# SECURITY WARNING: don't run with debug turned on in production!


DEBUG = True

ALLOWED_HOSTS = []


# Application definition

INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'app',
]

MIDDLEWARE = [


'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]

ROOT_URLCONF = 'config.urls'

TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]

WSGI_APPLICATION = 'config.wsgi.application'


# Database


# https://docs.djangoproject.com/en/3.2/ref/settings/#databases

DATABASES = {


'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'cashback_bot',
'USER': 'postgres',
'PASSWORD': '937790876',
'HOST': 'localhost',
'PORT': '5432',
}
}

# Password validation


# https://docs.djangoproject.com/en/3.2/ref/settings/#auth-password-validators

AUTH_PASSWORD_VALIDATORS = [


{
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
},
]

# Internationalization


# https://docs.djangoproject.com/en/3.2/topics/i18n/

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'UTC'

USE_I18N = True

USE_L10N = True

USE_TZ = True


# Static files (CSS, JavaScript, Images)


# https://docs.djangoproject.com/en/3.2/howto/static-files/

STATIC_URL = '/static/'



# Default primary key field type
# https://docs.djangoproject.com/en/3.2/ref/settings/#default-auto-field
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'


Download 0.85 Mb.

Do'stlaringiz bilan baham:
1   ...   7   8   9   10   11   12   13   14   15




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