├── .gitignore ├── README.md ├── django-proyektni-ahostga-yuklash.md ├── django-static-filelar.md ├── django-static-filelar ├── .gitignore ├── README.md ├── blog │ ├── __init__.py │ ├── __pycache__ │ │ ├── __init__.cpython-310.pyc │ │ ├── admin.cpython-310.pyc │ │ ├── apps.cpython-310.pyc │ │ ├── models.cpython-310.pyc │ │ └── views.cpython-310.pyc │ ├── admin.py │ ├── apps.py │ ├── migrations │ │ ├── __init__.py │ │ └── __pycache__ │ │ │ └── __init__.cpython-310.pyc │ ├── models.py │ ├── tests.py │ └── views.py ├── config │ ├── __init__.py │ ├── __pycache__ │ │ ├── __init__.cpython-310.pyc │ │ ├── settings.cpython-310.pyc │ │ ├── urls.cpython-310.pyc │ │ └── wsgi.cpython-310.pyc │ ├── asgi.py │ ├── settings.py │ ├── urls.py │ └── wsgi.py ├── manage.py ├── requirements.txt ├── static │ ├── css │ │ ├── bootstrap.css │ │ ├── responsive.css │ │ └── style.css │ ├── images │ │ ├── about.png │ │ ├── contact.png │ │ ├── fb.png │ │ ├── insta.png │ │ ├── lawyer.png │ │ ├── lawyer_icon1.png │ │ ├── lawyer_icon2.png │ │ ├── lawyer_icon3.png │ │ ├── lawyer_icon4.png │ │ ├── left-arrow.png │ │ ├── linkedin.png │ │ ├── menu.png │ │ ├── right-arrow.png │ │ ├── search-icon.png │ │ ├── twitter.png │ │ └── welcome.jpg │ └── js │ │ ├── bootstrap.js │ │ └── jquery-3.4.1.min.js └── templates │ ├── base.html │ └── index.html ├── djangoni-herokuga-yuklash.md ├── images ├── bos.png ├── collectstatic.png ├── copy_path.png ├── create_app.png ├── createapp.png ├── edit.png ├── git_pull.png ├── manager_files.png ├── manager_wsgi.png ├── namuna1.png ├── namuna2.png ├── pwd.png ├── python_uz.png ├── save.png ├── tashqi_korinish.png ├── terminal_paste_copy.png └── terminal_path.png └── test-yozishdan-qochmang.md /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | django-static-filelar/venv/ 3 | django-static-filelar/db.sqlite3 -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Pythonda uchraydigan muammolar 2 | 3 | #### Loyihaning asosiy maqsadi Python da dasturlashni endi boshlaganlar o'rtasidagi muammolarga yechim topish va to'g'ri yo'l ko'rsatish. Loyiha Open Source va siz ham o'z maqolangizni joylashiz mumkin. Biz sizni kutyapmiz )) Hurmat bilam Abdusamad 4 |
5 | 6 | 1. [**Django** da static filelarning ishlamasligi va ularni to'g'ri ishlatish](https://github.com/sevbo2003/common-python-problems/blob/master/django-static-filelar.md) 7 | 2. [**Test** yozishdan qochmang](./test-yozishdan-qochmang.md) 8 | 3. [**Django** loyihani **Heroku**ga yuklash bo'yicha qo'llanma](https://github.com/sevbo2003/common-python-problems/blob/master/djangoni-herokuga-yuklash.md) 9 | 4. [**Django loyihani ahost hosting ga yuklash**](https://github.com/sevbo2003/common-python-problems/blob/master/django-proyektni-ahostga-yuklash.md) 10 | -------------------------------------------------------------------------------- /django-proyektni-ahostga-yuklash.md: -------------------------------------------------------------------------------- 1 | # Django loyihani ahostga yuklash 2 | 3 | ### Assalomu alekum. Ushbu maqolada django loyihani [**ahost**](https://ahost.uz)ga static va media fayllar bilan birga deploy qilishni o'rganasiz 4 | 5 | > Muallif: [Abdusamad](https://t.me/malikovdev) 6 | 7 | > Savollar uchun guruh: [Djangouzb](https://t.me/djangouzb) 8 | 9 | Ushubu maqolada [ushbu sahifadagi](https://github.com/sevbo2003/ahost-demo) loyihani yuklaymiz. 10 | 11 | Bu maqolani bo'limlarga bo'lmimiz. Shuchaki ketma ketlikda bajaramiz xolos. Qani unda boshladik 12 | 13 | ## Birinchi bosqich 14 | 15 | 1. Ushbu sahifaga o'tib o'zizga kerakli hostingni tanlang va ketma-ketlikda aytganlarini qilib to'lov qilsayiz sizni cPanelga olib o'tadi. Mana ko'rinishi 16 | 17 | > Shu paytda sizdan domein ham so'raydi. Yo o'zizni eski domeiniz ni o'tkazasz yokida yangi sotib olasiz 18 | 19 | ![taxminiy](./images/tashqi_korinish.png) 20 | 21 | 2. Men bilan bir xil ketish uchun cPanel tilini rus tiliga o'tkazib oling. Endi `Программное обеспечение` bo'limidan `Python` ni tanlang ![python](./images/python_uz.png) 22 | 3. Keyin quyidagi ko'rinishda oyna ochiladi. Va bu yerdan ` Создать приложение` tugmasi ustiga bosasiz. ![image](./images/create_app.png) 23 | 4. Mana shunaqa oyna ochiladi va pastdagi ketma-ketliklarni bajarasiz ![image](./images/createapp.png) 24 | - **1-** Python versiyasini tanlang. Eng so'ngisi hozircha 3.9.12 shuni tanlang 25 | - **2-** _корневой каталог_ ni kiritasz. Shunchaki quyidagi ko'rinishda yozing: `domeiniz/django` Rasmga ham qarang 26 | - **3-** Bu yerda domeinizni tanlisz ushbu loyiha uchun 27 | - **4-** ** Создать ** tugmasini bosing 28 | 5. Bundan keyin quyidagicha oyna ochiladi va belgilagan joyiman ko'chirib olasz(kopirovat) ![image to copy](./images/copy_path.png) 29 | 6. Ana endi yana bosh sahifaga qaytib **Расширенный** bo'limidan **Terminal** ni tanlisiz va 5-bosqichdagi ko'chirib olgan text ni shu terminalga tashab enter ni bosasz![rasmcha](./images/terminal_path.png) ![yana bitta](./images/terminal_paste_copy.png) 30 | 7. Ushbu buyruq orqali `pip` ni yangilab olasiz 31 | ```python 32 | pip install --upgrade pip 33 | ``` 34 | 35 | ## Django qismi 36 | 37 | 1. Mana endi django proyektimizni github orqali yulaymiz. Shunchaki pastdagi ketma ketliklarni bajaring faqat mening github repositoryim o'rniga o'ziznikini kiriting 38 | ```python 39 | git init 40 | git remote add origin https://github.com/sevbo2003/ahost-demo.git # o'zizni githubizni kiriting 41 | git pull origin master 42 | pip install -r requirements.txt 43 | ``` 44 | 2. Anda endi projectizmizni ahost ga tanitishimiz kerak. Buning uchun bosh sahifadagi **менеджере файлов** bo'limiga kiramiz. Keyin chiqadigan oynadan domeiniz yozilgan papkaga ustiga bosish orqali kirasz va undan keyin django degan papka ochiladi unga ham kirasz va pastdagiday sahifa chiqadi. ![image](./images/manager_files.png) ![faly](./images/manager_wsgi.png) 45 | 3. 2-bosqichda ochilgan sahifadan `passenger_wsgi.py` degan faylni ochish kerak bo'ladi. Buning uchun `passenger_wsgi.py` ustiga bosasiz `Редактировать` degan tugma bor o'shani bossayiz yana bitta oynacha ochiladi bundan `edit` tugmasini bosasiz: Batafsil rasmga qarang. Ketma ketlik ko'rsatilgan ![imhs](./images/edit.png) 46 | 4. 3-bosqichdagi edit tugmasini bosganizdan keyin yangi sahifa ochiladi ichida kodlari bilan. Shu kodlarni o'chirib o'rniga quyidagi kodni kiritasz 47 | > config o'rniga `wsgi.py` fayli turgan papkani kiritasz. Masalan manda `config` papkasi ichida joylashgan 48 | ```python 49 | from config.wsgi import application 50 | ``` 51 | Bundan keyin `Сохранить изменения` tugmasini bosib chiqib ketasiz. 52 | ![image](./images/save.png) 53 | 54 | ## Django sozlamalari 55 | 56 | > ### Ushbu qismda static va media fayllar ishlashi uchun loyiyamizni sozlimiz. Buning uchun o'zimizni komputerdagi projectimizga kiramiz va o'zgartirishlar kiritib github ga push qilamiz va ahostdagi cPanel terminalidan pull qilib olamiz. 57 | 58 | 1. Debug ni False ga tenglashtiramiz 59 | ```python 60 | DEBUG = False 61 | ``` 62 | 2. `ALLOWED_HOSTS` ga ahostdagi domeinimizni 2 xil ko'rinishda qo'shamiz. Ya'ni birinchi o'zini keyin www orqali. Masalan: 63 | ```python 64 | ALLOWED_HOSTS = ["abdusamad.uz", "www.abdusamad.uz"] 65 | ``` 66 | 3. Database ga teginmimiz. Lekin sqlite3 o'rniga Postgres yoki boshqa SQL database ishlatishni maslahat beraman 67 | > ⚠️ Postgres yoki boshqa database ishlatish yaxshi. 68 | 4. Mana endi static va media larni to'g'irlimiz. Buning uchun **cPanel** dagi terminal ga kiramiz va `pwd` buyrug'ini kiritamiz va chiqqan natijani ko'chirib(kopirovat qilib) olamiz. ![image](./images/pwd.png) 69 | 5. Keyin django loyihamizga kirib static va media file larni quyidagi ko'rinishga keltiramiz. Static filelar haqida batafsil bilish uchun [quyidagi maqolani o'qing](https://github.com/sevbo2003/common-python-problems/blob/master/django-static-filelar.md). Endi 4-bosqichda ko'chirgan textni(file path) ni menikini o'rniga static faylizni turgan papkani qo'shish orqali yozasz. Namuna: 70 | ```python 71 | STATICFILES_DIRS = '/home/abdusama/abdusamad.uz/django/static_files',) 72 | STATIC_ROOT = '/home/abdusama/abdusamad.uz/django/static' 73 | MEDIA_URL = 'media/' 74 | MEDIA_ROOT = '/home/abdusama/abdusamad.uz/django/media' 75 | ``` 76 | 6. Asosiy `urls.py` ni ichiga static url larni tanitishimiz kerak. Buning uchun `urlpatterns` ga `STATIC_URL` va `STATICFILES_DIRS` ni va media ni ham qo'shib qo'yamiz. Namunaviy kod: 77 | 78 | ```python 79 | from django.contrib import admin 80 | from django.urls import path 81 | from django.conf import settings # setting.py ni import qildik 82 | from django.conf.urls.static import static 83 | 84 | 85 | urlpatterns = [ 86 | path('admin/', admin.site.urls), 87 | ] 88 | 89 | urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) 90 | urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) 91 | ``` 92 | 93 | 7. Whitenoise qo'shish. Endi static fayllarni saqlash uchun whitenoise o'rnatishimiz kerak. Ushbu buyruq orqali o'rnatamiz: 94 | ```python 95 | pip install whitenoise 96 | ``` 97 | Keyin `INSTALLED_APPS` ga `'whitenoise.runserver_nostatic',` ni qo'shib qo'yamiz. Undan keyin esa MIDDLEWARE ichiga ham whitenoise ni qo'shish kerak: 98 | ```python 99 | MIDDLEWARE = [ 100 | 'django.middleware.security.SecurityMiddleware', 101 | 102 | # whitenoise ni shu yerga qo'shing 103 | 'whitenoise.middleware.WhiteNoiseMiddleware', 104 | # ... 105 | ] 106 | ``` 107 | > Bu yerda sal e'tiborli bo'ling. Ya'ni whitenoise ni Djangoning o'zida mavjud bo'lgan `SecurityMiddleware` tagiga qo'shing 108 | Keyingi ish esa STATIC_URL tagidan ushbu whitenoise STORAGE ni qo'shib qo'ying: 109 | ```python 110 | STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage' 111 | ``` 112 | 113 | 8. Mana barchasini sozlab oldik. Endi github ga push qilamiz: 114 | ```python 115 | git add . 116 | git commit -m "Deploy uchun tayyorladik" 117 | git push origin master 118 | ``` 119 | 9. Ana endi qaytib cPanel da turgan loyihamizga qilgan o'zgartirishlarimizni kiritamiz. Bunign uchun quyidagi buyruqni kiriting: 120 | ```python 121 | git pull origin master 122 | ``` 123 | ![pull](./images/git_pull.png) 124 | 10. Endi static filelarimiz ishlashi uchun quyidagi buyruqni teramiz. 125 | ```python 126 | python manage.py collectstatic 127 | ``` 128 | Agar to'g'ri qilgan bo'lsayiz fayllariz ko'chirilganligi haqida xabar olasz. ![masalan](./images/collectstatic.png) 129 | 11. Endi django loyihayiz uchun har doim qiladigan ishlarni qilamiz. Ya'ni makemigrations lar va admin user yaratish. Masalan: 130 | ```python 131 | python manage.py makemigrations 132 | python manage.py migrate 133 | python manage.py createsuperuser 134 | ``` 135 | 12. 136 | 137 | ## So'ngi ish 138 | 139 | ### Mana endi so'ngi qismga ham yetib keldik. 140 | 141 | 1. Endi asosiy cPanel sahifasidagi Python bo'limiga boshqatdan kiramiz ![pyth](./images/python_uz.png) 142 | 2. Ochilgan oynadan restart tugmasini bosamiz ![mana](/images/bos.png) 143 | 144 | # TUGADI. 145 | ## Star bosib [kanalga](https://t.me/malikovdev) a'zo bo'lish esdan chiqmasin 146 | 147 | ## Saytdan namunalar: 148 | ![ima](./images/namuna1.png) 149 | ![imsda](./images/namuna2.png) -------------------------------------------------------------------------------- /django-static-filelar.md: -------------------------------------------------------------------------------- 1 | ## Djangoda static filelarning ishlamaslik muammosi 2 | *** 3 | #### Assalomu alekum. Ushbu maqolada static filelarning ishlamaslik muammosini bartaraf etamiz. 4 | Ushbu maqolaning namunamiy kodlarini [ushbu sahifa](https://github.com/sevbo2003/common-python-problems/tree/master/django-static-filelar) dan topishiz mumkin. Qani unda boshladik 5 | *** 6 | Demak maqolani 2 qismga bo'lamiz [**Local**](https://github.com/sevbo2003/common-python-problems/blob/master/django-static-filelar.md#local) va [**Production**](https://github.com/sevbo2003/common-python-problems/blob/master/django-static-filelar.md#production). Ya'ni static filelarning local serverimizda va **deploy** qigandan keyingi ishlamaslik sabablarini ko'rib chiqamiz. 7 | 8 | ## Local 9 | Demak birinchi django projectimizda static filelarni qanday sozlash kerakligini bir nechta bosqichlarda ko'rib chiqamiz. 10 | 11 | 1. **Static ni `settings.py url.py` qo'shish** 12 | 1. `settings.py` file ichiga `STATIC_URL` ni qo'shish kerak. Masalan: `STATIC_URL = 'static/'` 13 | 2. `STATIC_ROOT` yoki `STATICFILES_DIRS` ni larni `STATIC_URL` qo'shish kerak. Bu ikkalasini farqi nimada? Qisqa qilib aytgan `STATICFILES_DIRS` `DEBUG=True` bo'lgan paytda, `STATIC_ROOT` esa `DEBUG=False` bo'lgan paytda ishlaydi. Masalan: 14 | ``` 15 | STATIC_URL = 'static/' 16 | if DEBUG == True: 17 | STATICFILES_DIRS = (BASE_DIR / 'static',) 18 | else: 19 | STATIC_ROOT = BASE_DIR / 'static_root' 20 | ``` 21 | Bu yerda menda static va static_root degan papkalar asosiy directory da joylashganligi uchun `BASE_DIR` qildim va `DEBUG=True` bo'lganda `STATICFILES_DIRS` ni, aks holda `STATIC_ROOT` ni ishlat deb shart berdik 22 | 3. Asosiy `urls.py` ni ichiga static url larni tanitishimiz kerak. Buning uchun `urlpatterns` ga `STATIC_URL` va `STATICFILES_DIRS` ni qo'shib qo'yamiz. Namunaviy kod: 23 | ``` 24 | from django.conf import settings # setting.py ni import qildik 25 | from django.conf.urls.static import static 26 | 27 | urlpatterns = [ 28 | path("admin/", admin.site.urls), 29 | ] 30 | 31 | urlpatterns += static(settings.STATIC_URL, document_root=settings.STATICFILES_DIRS) 32 | 33 | ``` 34 | Mana barchasini sozlab oldik endi keyingi qiladigan ishimiz `template`da static filelarni to'g'ri ko'rsatish 35 | 36 | 2. **Static ni `templatelarda` ishlatish** 37 | 1. Har doim `{% load static %}` ni html file ling eng yuqorisiga agar `{% extends 'base.html' %}` bo'lsa undan pastiga qo'shib qo'ying. 38 | 2. Endi esa qanday static file ni to'g'ri ko'rsatishni ko'rib o'tamiz. Odatda static filedan quyidagi holatda ma'lumot olinadi: 39 | 40 | `````` 41 | 42 | Biz esa buni quyidagi holatga ko'chirishimiz kerak 43 | 44 | `````` **Mana endi static filelar ishlaydi** 45 | 46 | ## Production 47 | #### Endi esa Django project ni deploy qigandan keyin ishlamaslik holatlarini ko'rib chiqamiz. 48 | Agar `DEBUG=False` qildizmi szning static filelaringiz ishlamaydi. Buning asosiy sababi esa endi django szning static filelarizni saqlamaydi. Chunki siz production leveldasiz va static filelarni server da saqlashiz kerak. Masalan `whitenoise` yoki `NGINX`. 49 | 1. Eng asosiysi `STATIC_ROOT` borligiga ishinch hosil qiling. Undan keyin esa `python manage.py collectstatic` buyrug'ini bering. 50 | 2. Keyingi bosqich esa *static* filelarizni saqlamoqchi bo'gan serverlarizning sozlamalarini sozlab chiqish. Bular siz qaysi server ni ishlatayotganizga bog'liq 51 | #### Agarda DEBUG=False qilgan holatda local serverizda static filelarni ishlashini xohlasayiz *1-bosqich* ni bajaring va keyin `python manage.py runserver --insecure` buyrug'i orqali ishlating 52 | 53 | 54 | ## So'ngi so'zi 55 | Agar maqola yoqqan bo'lsa telegram kanalimizga a'zi bo'ling [malikovdev](https://t.me/malikovdev) 56 | Xato kamchiliklar bo'lsa tuzatib Pull Request bersangiz xursand bo'lamiz. **Rahmat** 57 | -------------------------------------------------------------------------------- /django-static-filelar/.gitignore: -------------------------------------------------------------------------------- 1 | venv/ 2 | db.sqlite3 3 | -------------------------------------------------------------------------------- /django-static-filelar/README.md: -------------------------------------------------------------------------------- 1 | ## O'rnatish bosqichlari 2 | 1. `pip install requirements.txt` 3 | 2. `python manage.py migrate` 4 | 3. `python manage.py runserver` -------------------------------------------------------------------------------- /django-static-filelar/blog/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sevbo2003/common-python-problems/6885855296bd8a2b66a78a62ca23f070f3c26332/django-static-filelar/blog/__init__.py -------------------------------------------------------------------------------- /django-static-filelar/blog/__pycache__/__init__.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sevbo2003/common-python-problems/6885855296bd8a2b66a78a62ca23f070f3c26332/django-static-filelar/blog/__pycache__/__init__.cpython-310.pyc -------------------------------------------------------------------------------- /django-static-filelar/blog/__pycache__/admin.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sevbo2003/common-python-problems/6885855296bd8a2b66a78a62ca23f070f3c26332/django-static-filelar/blog/__pycache__/admin.cpython-310.pyc -------------------------------------------------------------------------------- /django-static-filelar/blog/__pycache__/apps.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sevbo2003/common-python-problems/6885855296bd8a2b66a78a62ca23f070f3c26332/django-static-filelar/blog/__pycache__/apps.cpython-310.pyc -------------------------------------------------------------------------------- /django-static-filelar/blog/__pycache__/models.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sevbo2003/common-python-problems/6885855296bd8a2b66a78a62ca23f070f3c26332/django-static-filelar/blog/__pycache__/models.cpython-310.pyc -------------------------------------------------------------------------------- /django-static-filelar/blog/__pycache__/views.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sevbo2003/common-python-problems/6885855296bd8a2b66a78a62ca23f070f3c26332/django-static-filelar/blog/__pycache__/views.cpython-310.pyc -------------------------------------------------------------------------------- /django-static-filelar/blog/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | # Register your models here. 4 | -------------------------------------------------------------------------------- /django-static-filelar/blog/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class BlogConfig(AppConfig): 5 | default_auto_field = 'django.db.models.BigAutoField' 6 | name = 'blog' 7 | -------------------------------------------------------------------------------- /django-static-filelar/blog/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sevbo2003/common-python-problems/6885855296bd8a2b66a78a62ca23f070f3c26332/django-static-filelar/blog/migrations/__init__.py -------------------------------------------------------------------------------- /django-static-filelar/blog/migrations/__pycache__/__init__.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sevbo2003/common-python-problems/6885855296bd8a2b66a78a62ca23f070f3c26332/django-static-filelar/blog/migrations/__pycache__/__init__.cpython-310.pyc -------------------------------------------------------------------------------- /django-static-filelar/blog/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | 3 | # Create your models here. 4 | -------------------------------------------------------------------------------- /django-static-filelar/blog/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /django-static-filelar/blog/views.py: -------------------------------------------------------------------------------- 1 | from django.views.generic import TemplateView 2 | 3 | 4 | class Home(TemplateView): 5 | template_name = 'index.html' 6 | -------------------------------------------------------------------------------- /django-static-filelar/config/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sevbo2003/common-python-problems/6885855296bd8a2b66a78a62ca23f070f3c26332/django-static-filelar/config/__init__.py -------------------------------------------------------------------------------- /django-static-filelar/config/__pycache__/__init__.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sevbo2003/common-python-problems/6885855296bd8a2b66a78a62ca23f070f3c26332/django-static-filelar/config/__pycache__/__init__.cpython-310.pyc -------------------------------------------------------------------------------- /django-static-filelar/config/__pycache__/settings.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sevbo2003/common-python-problems/6885855296bd8a2b66a78a62ca23f070f3c26332/django-static-filelar/config/__pycache__/settings.cpython-310.pyc -------------------------------------------------------------------------------- /django-static-filelar/config/__pycache__/urls.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sevbo2003/common-python-problems/6885855296bd8a2b66a78a62ca23f070f3c26332/django-static-filelar/config/__pycache__/urls.cpython-310.pyc -------------------------------------------------------------------------------- /django-static-filelar/config/__pycache__/wsgi.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sevbo2003/common-python-problems/6885855296bd8a2b66a78a62ca23f070f3c26332/django-static-filelar/config/__pycache__/wsgi.cpython-310.pyc -------------------------------------------------------------------------------- /django-static-filelar/config/asgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | ASGI config for config project. 3 | 4 | It exposes the ASGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/4.0/howto/deployment/asgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.asgi import get_asgi_application 13 | 14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'config.settings') 15 | 16 | application = get_asgi_application() 17 | -------------------------------------------------------------------------------- /django-static-filelar/config/settings.py: -------------------------------------------------------------------------------- 1 | """ 2 | Django settings for config project. 3 | 4 | Generated by 'django-admin startproject' using Django 4.0.4. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/4.0/topics/settings/ 8 | 9 | For the full list of settings and their values, see 10 | https://docs.djangoproject.com/en/4.0/ref/settings/ 11 | """ 12 | 13 | from pathlib import Path 14 | 15 | # Build paths inside the project like this: BASE_DIR / 'subdir'. 16 | BASE_DIR = Path(__file__).resolve().parent.parent 17 | 18 | 19 | # Quick-start development settings - unsuitable for production 20 | # See https://docs.djangoproject.com/en/4.0/howto/deployment/checklist/ 21 | 22 | # SECURITY WARNING: keep the secret key used in production secret! 23 | SECRET_KEY = 'django-insecure-#)#akaw!hq_2*83k%f+&%rev-_#af6^0dug9oo4h*z8rig($b+' 24 | 25 | # SECURITY WARNING: don't run with debug turned on in production! 26 | DEBUG = True 27 | 28 | ALLOWED_HOSTS = [] 29 | 30 | 31 | # Application definition 32 | 33 | INSTALLED_APPS = [ 34 | 'django.contrib.admin', 35 | 'django.contrib.auth', 36 | 'django.contrib.contenttypes', 37 | 'django.contrib.sessions', 38 | 'django.contrib.messages', 39 | 'django.contrib.staticfiles', 40 | 'blog.apps.BlogConfig', 41 | ] 42 | 43 | MIDDLEWARE = [ 44 | 'django.middleware.security.SecurityMiddleware', 45 | 'django.contrib.sessions.middleware.SessionMiddleware', 46 | 'django.middleware.common.CommonMiddleware', 47 | 'django.middleware.csrf.CsrfViewMiddleware', 48 | 'django.contrib.auth.middleware.AuthenticationMiddleware', 49 | 'django.contrib.messages.middleware.MessageMiddleware', 50 | 'django.middleware.clickjacking.XFrameOptionsMiddleware', 51 | ] 52 | 53 | ROOT_URLCONF = 'config.urls' 54 | 55 | TEMPLATES = [ 56 | { 57 | 'BACKEND': 'django.template.backends.django.DjangoTemplates', 58 | 'DIRS': [BASE_DIR / 'templates'], 59 | 'APP_DIRS': True, 60 | 'OPTIONS': { 61 | 'context_processors': [ 62 | 'django.template.context_processors.debug', 63 | 'django.template.context_processors.request', 64 | 'django.contrib.auth.context_processors.auth', 65 | 'django.contrib.messages.context_processors.messages', 66 | ], 67 | }, 68 | }, 69 | ] 70 | 71 | WSGI_APPLICATION = 'config.wsgi.application' 72 | 73 | 74 | # Database 75 | # https://docs.djangoproject.com/en/4.0/ref/settings/#databases 76 | 77 | DATABASES = { 78 | 'default': { 79 | 'ENGINE': 'django.db.backends.sqlite3', 80 | 'NAME': BASE_DIR / 'db.sqlite3', 81 | } 82 | } 83 | 84 | 85 | # Password validation 86 | # https://docs.djangoproject.com/en/4.0/ref/settings/#auth-password-validators 87 | 88 | AUTH_PASSWORD_VALIDATORS = [ 89 | { 90 | 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', 91 | }, 92 | { 93 | 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', 94 | }, 95 | { 96 | 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', 97 | }, 98 | { 99 | 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', 100 | }, 101 | ] 102 | 103 | 104 | # Internationalization 105 | # https://docs.djangoproject.com/en/4.0/topics/i18n/ 106 | 107 | LANGUAGE_CODE = 'en-us' 108 | 109 | TIME_ZONE = 'UTC' 110 | 111 | USE_I18N = True 112 | 113 | USE_TZ = True 114 | 115 | 116 | # Static files (CSS, JavaScript, Images) 117 | # https://docs.djangoproject.com/en/4.0/howto/static-files/ 118 | 119 | STATIC_URL = 'static/' 120 | if DEBUG: 121 | STATICFILES_DIRS = (BASE_DIR / 'static',) 122 | else: 123 | STATIC_ROOT = BASE_DIR / 'static_root' 124 | 125 | # Default primary key field type 126 | # https://docs.djangoproject.com/en/4.0/ref/settings/#default-auto-field 127 | 128 | DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' 129 | -------------------------------------------------------------------------------- /django-static-filelar/config/urls.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | from django.urls import path 3 | from blog.views import Home 4 | from django.conf import settings 5 | from django.conf.urls.static import static 6 | 7 | 8 | urlpatterns = [ 9 | path('admin/', admin.site.urls), 10 | path('', Home.as_view()) 11 | ] 12 | 13 | urlpatterns += static(settings.STATIC_URL, document_root=settings.STATICFILES_DIRS) 14 | -------------------------------------------------------------------------------- /django-static-filelar/config/wsgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | WSGI config for config project. 3 | 4 | It exposes the WSGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/4.0/howto/deployment/wsgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.wsgi import get_wsgi_application 13 | 14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'config.settings') 15 | 16 | application = get_wsgi_application() 17 | -------------------------------------------------------------------------------- /django-static-filelar/manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | """Django's command-line utility for administrative tasks.""" 3 | import os 4 | import sys 5 | 6 | 7 | def main(): 8 | """Run administrative tasks.""" 9 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'config.settings') 10 | try: 11 | from django.core.management import execute_from_command_line 12 | except ImportError as exc: 13 | raise ImportError( 14 | "Couldn't import Django. Are you sure it's installed and " 15 | "available on your PYTHONPATH environment variable? Did you " 16 | "forget to activate a virtual environment?" 17 | ) from exc 18 | execute_from_command_line(sys.argv) 19 | 20 | 21 | if __name__ == '__main__': 22 | main() 23 | -------------------------------------------------------------------------------- /django-static-filelar/requirements.txt: -------------------------------------------------------------------------------- 1 | asgiref==3.5.0 2 | Django==4.0.4 3 | sqlparse==0.4.2 4 | -------------------------------------------------------------------------------- /django-static-filelar/static/css/responsive.css: -------------------------------------------------------------------------------- 1 | @media (max-width: 1120px) {} 2 | 3 | @media (max-width: 992px) { 4 | .custom_nav-container .nav_search-btn { 5 | background-position: center; 6 | } 7 | 8 | .navbar-collapse { 9 | padding-bottom: 20px; 10 | } 11 | 12 | .practice_box { 13 | margin: 100px 15px 0 15px; 14 | padding-bottom: 20px; 15 | transition: all .5s; 16 | } 17 | 18 | .practice_box:hover { 19 | 20 | transform: translateY(-90px); 21 | } 22 | 23 | .practice_detail p { 24 | margin-top: 25px; 25 | } 26 | 27 | .welcome_section::before { 28 | display: none; 29 | } 30 | } 31 | 32 | @media (max-width: 768px) { 33 | 34 | .info_section .col-md-4 { 35 | padding: 20px 30px; 36 | text-align: center; 37 | } 38 | 39 | .info_news input { 40 | width: 100%; 41 | } 42 | 43 | .hero_section-container { 44 | width: 95%; 45 | } 46 | 47 | .hero_section-container .hero_detail-box { 48 | padding-bottom: 125px; 49 | } 50 | 51 | .contact_form-container { 52 | padding: 20px; 53 | } 54 | 55 | .contact_section input { 56 | width: 100%; 57 | } 58 | 59 | .contact_img-box { 60 | padding: 20px; 61 | } 62 | 63 | } 64 | 65 | @media (max-width: 576px) { 66 | .hero_section-container { 67 | flex-direction: column; 68 | } 69 | 70 | .hero_section-container .hero_img-box { 71 | 72 | width: 90%; 73 | } 74 | 75 | .hero_section-container .hero_detail-box { 76 | width: 97%; 77 | 78 | } 79 | 80 | .hero_section-container .hero_detail-box .hero_detail-container { 81 | padding-left: 0; 82 | padding-top: 35px; 83 | } 84 | 85 | .carousel-control-prev { 86 | left: 33%; 87 | 88 | } 89 | 90 | .carousel-control-next { 91 | left: 52%; 92 | } 93 | 94 | .practice_box { 95 | margin: 75px 15px 0 15px; 96 | transition: all .3s; 97 | } 98 | 99 | .practice_box:hover { 100 | 101 | transform: translateY(-60px); 102 | } 103 | } 104 | 105 | @media (max-width: 480px) {} 106 | 107 | @media (max-width: 400px) {} 108 | 109 | @media (max-width: 360px) {} 110 | 111 | @media (min-width: 1200px) { 112 | .container { 113 | max-width: 1170px; 114 | } 115 | 116 | } -------------------------------------------------------------------------------- /django-static-filelar/static/css/style.css: -------------------------------------------------------------------------------- 1 | body { 2 | font-family: 'Roboto', sans-serif; 3 | color: #000205; 4 | } 5 | 6 | 7 | 8 | h1, 9 | h2, 10 | h3, 11 | h4 { 12 | font-weight: bold; 13 | } 14 | 15 | .layout_padding { 16 | padding: 75px 0; 17 | } 18 | 19 | .layout_padding2 { 20 | padding: 45px 0; 21 | } 22 | 23 | .layout_padding2-top { 24 | padding-top: 45px; 25 | } 26 | 27 | .layout_padding-top { 28 | padding-top: 75px; 29 | } 30 | 31 | .layout_padding-bottom { 32 | padding-bottom: 75px; 33 | } 34 | 35 | .call_to-btn { 36 | display: inline-block; 37 | padding: 12px 32px; 38 | border-radius: 15px; 39 | background-color: #f8d92b; 40 | color: #fff; 41 | display: flex; 42 | justify-content: center; 43 | align-items: center; 44 | } 45 | 46 | .call_to-btn img, 47 | .sub_call_to-btn img { 48 | width: 9px; 49 | margin-left: 15px; 50 | margin-top: 3px; 51 | } 52 | 53 | .call_to-btn:hover, 54 | .sub_call_to-btn:hover { 55 | color: #fff; 56 | -webkit-box-shadow: 0px 6px 10px -1px rgba(0, 0, 0, 0.17); 57 | -moz-box-shadow: 0px 6px 10px -1px rgba(0, 0, 0, 0.17); 58 | box-shadow: 0px 6px 10px -1px rgba(0, 0, 0, 0.17); 59 | } 60 | 61 | .sub_call_to-btn { 62 | display: inline-block; 63 | padding: 10px 28px; 64 | border-radius: 25px; 65 | background-color: #f8d92b; 66 | color: #fff; 67 | display: flex; 68 | justify-content: center; 69 | align-items: center; 70 | } 71 | 72 | 73 | 74 | 75 | /*header section*/ 76 | .top_container { 77 | font-family: 'Poppins', sans-serif; 78 | } 79 | 80 | .header_section {} 81 | 82 | nav.navbar.navbar-expand-lg {} 83 | 84 | .custom_nav-container.navbar-expand-lg .navbar-nav .nav-link { 85 | padding: 10px 20px; 86 | color: #f8d92b; 87 | text-align: center; 88 | text-transform: uppercase; 89 | } 90 | 91 | 92 | 93 | a, 94 | a:hover, 95 | a:focus { 96 | text-decoration: none; 97 | } 98 | 99 | a:hover, 100 | a:focus { 101 | color: initial; 102 | } 103 | 104 | .btn, 105 | .btn:focus { 106 | outline: none !important; 107 | box-shadow: none; 108 | } 109 | 110 | .top_container {} 111 | 112 | .top_container.sub_page { 113 | height: auto; 114 | } 115 | 116 | 117 | 118 | .custom_nav-container .nav_search-btn { 119 | background-image: url(../images/search-icon.png); 120 | background-size: 22px; 121 | background-repeat: no-repeat; 122 | background-position-y: 7px; 123 | width: 35px; 124 | height: 35px; 125 | padding: 0; 126 | border: none; 127 | } 128 | 129 | .navbar-brand, 130 | .navbar-brand:hover { 131 | font-size: 30px; 132 | color: #f8d92b; 133 | font-weight: bold; 134 | } 135 | 136 | 137 | 138 | .custom_nav-container { 139 | z-index: 99999; 140 | padding: 15px 0; 141 | } 142 | 143 | .custom_nav-container .navbar-toggler { 144 | outline: none; 145 | } 146 | 147 | .custom_nav-container .navbar-toggler .navbar-toggler-icon { 148 | background-image: url(../images/menu.png); 149 | background-size: 55px; 150 | } 151 | 152 | /*end header section*/ 153 | 154 | /* hero section */ 155 | .hero_section-container { 156 | width: 80%; 157 | margin: 0 auto; 158 | display: flex; 159 | align-items: center; 160 | } 161 | 162 | .number-container { 163 | position: absolute; 164 | top: 34%; 165 | 166 | left: 4%; 167 | } 168 | 169 | .number-container .number-box { 170 | display: flex; 171 | flex-direction: column; 172 | justify-content: center; 173 | align-items: center; 174 | color: #464646; 175 | } 176 | 177 | .number-container .number-box hr { 178 | border: none; 179 | width: 2px; 180 | height: 125px; 181 | background-color: #f8d92b; 182 | margin: 35px 0; 183 | } 184 | 185 | .hero_section-container .hero_img-box { 186 | width: 42%; 187 | margin-top: -45px; 188 | } 189 | 190 | .hero_section-container .hero_img-box img { 191 | width: 100%; 192 | } 193 | 194 | .hero_section-container .hero_detail-box { 195 | width: 58%; 196 | 197 | } 198 | 199 | .hero_section-container .hero_detail-box .hero_detail-container { 200 | padding-left: 45px; 201 | padding-bottom: 15px; 202 | } 203 | 204 | .hero_section-container .hero_detail-box .hero_detail-container p { 205 | margin: 35px 0 50px 0; 206 | } 207 | 208 | 209 | 210 | .carousel-control-prev, 211 | .carousel-control-next { 212 | width: 45px; 213 | height: 45px; 214 | border-radius: 100%; 215 | background-color: #f8d92b; 216 | opacity: 1; 217 | background-repeat: no-repeat; 218 | background-position: center center; 219 | background-size: 8px; 220 | top: initial; 221 | bottom: -100px; 222 | } 223 | 224 | .carousel-control-prev:hover, 225 | .carousel-control-next:hover { 226 | background-color: #464646; 227 | } 228 | 229 | 230 | 231 | .carousel-control-prev { 232 | background-image: url(../images/left-arrow.png); 233 | left: 45px; 234 | } 235 | 236 | .carousel-control-next { 237 | background-image: url(../images/right-arrow.png); 238 | left: 95px; 239 | } 240 | 241 | /* end hero section */ 242 | 243 | /* about section */ 244 | .about_section { 245 | background-color: #f8faf9; 246 | 247 | } 248 | 249 | .about_section .row { 250 | align-items: center; 251 | } 252 | 253 | .about_img-box img { 254 | width: 100%; 255 | } 256 | 257 | .about_detail-box p { 258 | margin: 45px 0; 259 | } 260 | 261 | /* end about section */ 262 | 263 | /* practice section */ 264 | .practice_container { 265 | display: flex; 266 | justify-content: center; 267 | flex-wrap: wrap; 268 | } 269 | 270 | .practice_box { 271 | display: flex; 272 | flex-direction: column; 273 | align-items: center; 274 | margin: 200px 15px 0 15px; 275 | transform: translateY(0); 276 | transition: all .7s; 277 | padding-bottom: 50px; 278 | } 279 | 280 | .practice_box:hover { 281 | transform: translateY(-150px); 282 | cursor: pointer; 283 | } 284 | 285 | .practice_box:hover .practice_img-box { 286 | background-color: #fddd33; 287 | } 288 | 289 | .practice_img-box { 290 | display: flex; 291 | justify-content: center; 292 | align-items: center; 293 | width: 225px; 294 | height: 295px; 295 | border-radius: 90px; 296 | background-color: #363636; 297 | 298 | } 299 | 300 | 301 | .practice_box h4 { 302 | margin-top: 15px; 303 | } 304 | 305 | .practice_img-box img { 306 | width: 120px; 307 | } 308 | 309 | .practice_detail p { 310 | margin-bottom: 55px; 311 | text-align: center; 312 | } 313 | 314 | .heading-text { 315 | padding: 0; 316 | margin: 0; 317 | color: #fddd33; 318 | font-weight: bold; 319 | } 320 | 321 | 322 | 323 | 324 | /* end Practice section */ 325 | 326 | /* welcome section */ 327 | .welcome_section { 328 | 329 | background-color: #f8faf9; 330 | } 331 | 332 | .welcome_container { 333 | padding: 100px 0; 334 | } 335 | 336 | .welcome_container>* { 337 | margin-bottom: 35px; 338 | } 339 | 340 | .welcome_container h4 { 341 | font-weight: normal; 342 | } 343 | 344 | .welcome_container h4, 345 | .welcome_container p { 346 | font-family: 'Poppins', sans-serif; 347 | } 348 | 349 | .welcome_section::before { 350 | content: ""; 351 | width: 40%; 352 | height: 100%; 353 | background-image: url(../images/welcome.jpg); 354 | position: absolute; 355 | top: 0; 356 | right: 0; 357 | background-repeat: no-repeat; 358 | background-size: cover; 359 | } 360 | 361 | /* end welcome section */ 362 | 363 | /* contact section */ 364 | .contact_section .col-md-6 { 365 | padding: 0; 366 | } 367 | 368 | .contact_section input { 369 | border: none; 370 | outline: none; 371 | border-bottom: 1px solid #252525; 372 | width: 90%; 373 | margin: 10px 0; 374 | } 375 | 376 | .contact_form-container { 377 | padding: 45px; 378 | padding-right: 0; 379 | } 380 | 381 | .contact_form-container button { 382 | border: none; 383 | background-color: #fddd33; 384 | color: #fff; 385 | padding: 8px 40px; 386 | border-radius: 20px; 387 | } 388 | 389 | .contact_img-box { 390 | display: flex; 391 | align-items: center; 392 | padding: 45px; 393 | padding-left: 0; 394 | } 395 | 396 | .contact_img-box img { 397 | width: 97%; 398 | } 399 | 400 | .contact_section h2 { 401 | font-size: 26px; 402 | color: #010103; 403 | font-weight: bold; 404 | 405 | position: relative; 406 | margin-left: 2.5%; 407 | } 408 | 409 | 410 | 411 | /* end contact section */ 412 | /* info section */ 413 | .info_section { 414 | padding-top: 100px; 415 | padding-bottom: 1px; 416 | color: #fff; 417 | background-color: #2a2a2c; 418 | } 419 | 420 | .info_logo h2 { 421 | color: #fddd33; 422 | font-family: 'Poppins', sans-serif; 423 | } 424 | 425 | .info_section .col-md-4 { 426 | padding: 0 30px; 427 | } 428 | 429 | .info_section .col-md-4 h5 { 430 | text-transform: uppercase; 431 | } 432 | 433 | .info_news input { 434 | border: none; 435 | width: 80%; 436 | height: 35px; 437 | border-radius: 20px; 438 | background-color: #fff; 439 | outline: none; 440 | padding-left: 20px; 441 | margin-top: 15px; 442 | } 443 | 444 | .info_news input::placeholder { 445 | opacity: .4; 446 | } 447 | 448 | .info_news button { 449 | border: none; 450 | background-color: #fddd33; 451 | color: #fff; 452 | text-transform: uppercase; 453 | font-size: 14px; 454 | padding: 7px 25px; 455 | border-radius: 20px; 456 | margin-top: 20px; 457 | } 458 | 459 | .info_address p { 460 | margin-bottom: 5px; 461 | } 462 | 463 | .custom_border-btm { 464 | border-bottom: 1px solid #fff; 465 | } 466 | 467 | .info_social { 468 | display: flex; 469 | justify-content: space-between; 470 | width: 150px; 471 | margin: 30px auto; 472 | } 473 | 474 | /* end info section */ 475 | 476 | 477 | 478 | /* footer section*/ 479 | 480 | .footer_section { 481 | background-color: #fdfdfe; 482 | padding: 20px 0; 483 | font-family: 'Poppins', sans-serif; 484 | } 485 | 486 | .footer_section p { 487 | color: #000; 488 | margin: 0; 489 | text-align: center; 490 | } 491 | 492 | .footer_section a { 493 | color: #000; 494 | } 495 | 496 | /* end footer section*/ -------------------------------------------------------------------------------- /django-static-filelar/static/images/about.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sevbo2003/common-python-problems/6885855296bd8a2b66a78a62ca23f070f3c26332/django-static-filelar/static/images/about.png -------------------------------------------------------------------------------- /django-static-filelar/static/images/contact.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sevbo2003/common-python-problems/6885855296bd8a2b66a78a62ca23f070f3c26332/django-static-filelar/static/images/contact.png -------------------------------------------------------------------------------- /django-static-filelar/static/images/fb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sevbo2003/common-python-problems/6885855296bd8a2b66a78a62ca23f070f3c26332/django-static-filelar/static/images/fb.png -------------------------------------------------------------------------------- /django-static-filelar/static/images/insta.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sevbo2003/common-python-problems/6885855296bd8a2b66a78a62ca23f070f3c26332/django-static-filelar/static/images/insta.png -------------------------------------------------------------------------------- /django-static-filelar/static/images/lawyer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sevbo2003/common-python-problems/6885855296bd8a2b66a78a62ca23f070f3c26332/django-static-filelar/static/images/lawyer.png -------------------------------------------------------------------------------- /django-static-filelar/static/images/lawyer_icon1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sevbo2003/common-python-problems/6885855296bd8a2b66a78a62ca23f070f3c26332/django-static-filelar/static/images/lawyer_icon1.png -------------------------------------------------------------------------------- /django-static-filelar/static/images/lawyer_icon2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sevbo2003/common-python-problems/6885855296bd8a2b66a78a62ca23f070f3c26332/django-static-filelar/static/images/lawyer_icon2.png -------------------------------------------------------------------------------- /django-static-filelar/static/images/lawyer_icon3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sevbo2003/common-python-problems/6885855296bd8a2b66a78a62ca23f070f3c26332/django-static-filelar/static/images/lawyer_icon3.png -------------------------------------------------------------------------------- /django-static-filelar/static/images/lawyer_icon4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sevbo2003/common-python-problems/6885855296bd8a2b66a78a62ca23f070f3c26332/django-static-filelar/static/images/lawyer_icon4.png -------------------------------------------------------------------------------- /django-static-filelar/static/images/left-arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sevbo2003/common-python-problems/6885855296bd8a2b66a78a62ca23f070f3c26332/django-static-filelar/static/images/left-arrow.png -------------------------------------------------------------------------------- /django-static-filelar/static/images/linkedin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sevbo2003/common-python-problems/6885855296bd8a2b66a78a62ca23f070f3c26332/django-static-filelar/static/images/linkedin.png -------------------------------------------------------------------------------- /django-static-filelar/static/images/menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sevbo2003/common-python-problems/6885855296bd8a2b66a78a62ca23f070f3c26332/django-static-filelar/static/images/menu.png -------------------------------------------------------------------------------- /django-static-filelar/static/images/right-arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sevbo2003/common-python-problems/6885855296bd8a2b66a78a62ca23f070f3c26332/django-static-filelar/static/images/right-arrow.png -------------------------------------------------------------------------------- /django-static-filelar/static/images/search-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sevbo2003/common-python-problems/6885855296bd8a2b66a78a62ca23f070f3c26332/django-static-filelar/static/images/search-icon.png -------------------------------------------------------------------------------- /django-static-filelar/static/images/twitter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sevbo2003/common-python-problems/6885855296bd8a2b66a78a62ca23f070f3c26332/django-static-filelar/static/images/twitter.png -------------------------------------------------------------------------------- /django-static-filelar/static/images/welcome.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sevbo2003/common-python-problems/6885855296bd8a2b66a78a62ca23f070f3c26332/django-static-filelar/static/images/welcome.jpg -------------------------------------------------------------------------------- /django-static-filelar/static/js/jquery-3.4.1.min.js: -------------------------------------------------------------------------------- 1 | /*! jQuery v3.4.1 | (c) JS Foundation and other contributors | jquery.org/license */ 2 | !function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],E=C.document,r=Object.getPrototypeOf,s=t.slice,g=t.concat,u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},x=function(e){return null!=e&&e===e.window},c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.4.1",k=function(e,t){return new k.fn.init(e,t)},p=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;function d(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp($),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+$),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\([\\da-f]{1,6}"+M+"?|("+M+")|.)","ig"),ne=function(e,t,n){var r="0x"+t-65536;return r!=r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(m.childNodes),m.childNodes),t[m.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&((e?e.ownerDocument||e:m)!==C&&T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!A[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&U.test(t)){(s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=k),o=(l=h(t)).length;while(o--)l[o]="#"+s+" "+xe(l[o]);c=l.join(","),f=ee.test(t)&&ye(e.parentNode)||e}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){A(t,!0)}finally{s===k&&e.removeAttribute("id")}}}return g(t.replace(B,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[k]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e.namespaceURI,n=(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:m;return r!==C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),m!==C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=k,!C.getElementsByName||!C.getElementsByName(k).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){a.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+k+"-]").length||v.push("~="),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+k+"+*").length||v.push(".#.+[+~]")}),ce(function(e){e.innerHTML="";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",$)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},D=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e===C||e.ownerDocument===m&&y(m,e)?-1:t===C||t.ownerDocument===m&&y(m,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e===C?-1:t===C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]===m?-1:s[r]===m?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if((e.ownerDocument||e)!==C&&T(e),d.matchesSelector&&E&&!A[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){A(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=p[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&p(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,n,r){return m(n)?k.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?k.grep(e,function(e){return e===n!==r}):"string"!=typeof n?k.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(k.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||q,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:L.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof k?t[0]:t,k.merge(this,k.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),D.test(r[1])&&k.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(k):k.makeArray(e,this)}).prototype=k.fn,q=k(E);var H=/^(?:parents|prev(?:Until|All))/,O={children:!0,contents:!0,next:!0,prev:!0};function P(e,t){while((e=e[t])&&1!==e.nodeType);return e}k.fn.extend({has:function(e){var t=k(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i,ge={option:[1,""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function ve(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?k.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;nx",y.noCloneChecked=!!me.cloneNode(!0).lastChild.defaultValue;var Te=/^key/,Ce=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Ee=/^([^.]*)(?:\.(.+)|)/;function ke(){return!0}function Se(){return!1}function Ne(e,t){return e===function(){try{return E.activeElement}catch(e){}}()==("focus"===t)}function Ae(e,t,n,r,i,o){var a,s;if("object"==typeof t){for(s in"string"!=typeof n&&(r=r||n,n=void 0),t)Ae(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=Se;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return k().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=k.guid++)),e.each(function(){k.event.add(this,t,i,r,n)})}function De(e,i,o){o?(Q.set(e,i,!1),k.event.add(e,i,{namespace:!1,handler:function(e){var t,n,r=Q.get(this,i);if(1&e.isTrigger&&this[i]){if(r.length)(k.event.special[i]||{}).delegateType&&e.stopPropagation();else if(r=s.call(arguments),Q.set(this,i,r),t=o(this,i),this[i](),r!==(n=Q.get(this,i))||t?Q.set(this,i,!1):n={},r!==n)return e.stopImmediatePropagation(),e.preventDefault(),n.value}else r.length&&(Q.set(this,i,{value:k.event.trigger(k.extend(r[0],k.Event.prototype),r.slice(1),this)}),e.stopImmediatePropagation())}})):void 0===Q.get(e,i)&&k.event.add(e,i,ke)}k.event={global:{},add:function(t,e,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Q.get(t);if(v){n.handler&&(n=(o=n).handler,i=o.selector),i&&k.find.matchesSelector(ie,i),n.guid||(n.guid=k.guid++),(u=v.events)||(u=v.events={}),(a=v.handle)||(a=v.handle=function(e){return"undefined"!=typeof k&&k.event.triggered!==e.type?k.event.dispatch.apply(t,arguments):void 0}),l=(e=(e||"").match(R)||[""]).length;while(l--)d=g=(s=Ee.exec(e[l])||[])[1],h=(s[2]||"").split(".").sort(),d&&(f=k.event.special[d]||{},d=(i?f.delegateType:f.bindType)||d,f=k.event.special[d]||{},c=k.extend({type:d,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&k.expr.match.needsContext.test(i),namespace:h.join(".")},o),(p=u[d])||((p=u[d]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(t,r,h,a)||t.addEventListener&&t.addEventListener(d,a)),f.add&&(f.add.call(t,c),c.handler.guid||(c.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),k.event.global[d]=!0)}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Q.hasData(e)&&Q.get(e);if(v&&(u=v.events)){l=(t=(t||"").match(R)||[""]).length;while(l--)if(d=g=(s=Ee.exec(t[l])||[])[1],h=(s[2]||"").split(".").sort(),d){f=k.event.special[d]||{},p=u[d=(r?f.delegateType:f.bindType)||d]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;while(o--)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,f.remove&&f.remove.call(e,c));a&&!p.length&&(f.teardown&&!1!==f.teardown.call(e,h,v.handle)||k.removeEvent(e,d,v.handle),delete u[d])}else for(d in u)k.event.remove(e,d+t[l],n,r,!0);k.isEmptyObject(u)&&Q.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,a,s=k.event.fix(e),u=new Array(arguments.length),l=(Q.get(this,"events")||{})[s.type]||[],c=k.event.special[s.type]||{};for(u[0]=s,t=1;t\x20\t\r\n\f]*)[^>]*)\/>/gi,qe=/\s*$/g;function Oe(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&k(e).children("tbody")[0]||e}function Pe(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Re(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Me(e,t){var n,r,i,o,a,s,u,l;if(1===t.nodeType){if(Q.hasData(e)&&(o=Q.access(e),a=Q.set(t,o),l=o.events))for(i in delete a.handle,a.events={},l)for(n=0,r=l[i].length;n")},clone:function(e,t,n){var r,i,o,a,s,u,l,c=e.cloneNode(!0),f=oe(e);if(!(y.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||k.isXMLDoc(e)))for(a=ve(c),r=0,i=(o=ve(e)).length;r").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var Vt,Gt=[],Yt=/(=)\?(?=&|$)|\?\?/;k.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Gt.pop()||k.expando+"_"+kt++;return this[e]=!0,e}}),k.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Yt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Yt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Yt,"$1"+r):!1!==e.jsonp&&(e.url+=(St.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||k.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?k(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Gt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((Vt=E.implementation.createHTMLDocument("").body).innerHTML="
",2===Vt.childNodes.length),k.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=D.exec(e))?[t.createElement(i[1])]:(i=we([e],t,o),o&&o.length&&k(o).remove(),k.merge([],i.childNodes)));var r,i,o},k.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(k.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},k.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){k.fn[t]=function(e){return this.on(t,e)}}),k.expr.pseudos.animated=function(t){return k.grep(k.timers,function(e){return t===e.elem}).length},k.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=k.css(e,"position"),c=k(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=k.css(e,"top"),u=k.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,k.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},k.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){k.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===k.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===k.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=k(e).offset()).top+=k.css(e,"borderTopWidth",!0),i.left+=k.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-k.css(r,"marginTop",!0),left:t.left-i.left-k.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===k.css(e,"position"))e=e.offsetParent;return e||ie})}}),k.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;k.fn[t]=function(e){return _(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),k.each(["top","left"],function(e,n){k.cssHooks[n]=ze(y.pixelPosition,function(e,t){if(t)return t=_e(e,n),$e.test(t)?k(e).position()[n]+"px":t})}),k.each({Height:"height",Width:"width"},function(a,s){k.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){k.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return _(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?k.css(e,t,i):k.style(e,t,n,i)},s,n?e:void 0,n)}})}),k.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){k.fn[n]=function(e,t){return 0 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | statics 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | {% block content %} 38 | 39 | {% endblock %} 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /django-static-filelar/templates/index.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | {% load static %} 3 | {% block content %} 4 |
5 | 6 |
7 |
8 | 32 |
33 |
34 |
35 |
36 |
37 | 38 | 01 39 | 40 |
41 | 42 | 02 43 | 44 |
45 |
46 |
47 | 48 |
49 | 50 |
51 |
52 | 135 | 136 | 137 |
138 |
139 |
140 |
141 | {% endblock %} -------------------------------------------------------------------------------- /djangoni-herokuga-yuklash.md: -------------------------------------------------------------------------------- 1 | ## **Django loyihani herokuga yuklash bo'yicha qo'llanma** 2 | *** 3 | 4 | ### Django loyihani herokuga yuklash bo'yicha qo'llanma Ushbu maqolada djangoni herokuga terminal orqali yuklash ketma-ket liklarini ko'rib chiqamiz 5 | 6 | > Muallif: [Abdusamad](https://t.me/malikovdev) 7 | 8 | > Savollar uchun guruh: [Djangouzb](https://t.me/djangouzb) 9 | 10 | Bo'limlar 11 | 1. [Django qismi](https://github.com/sevbo2003/common-python-problems/blob/master/djangoni-herokuga-yuklash.md#django-qismi) 12 | 2. [Database qismi](https://github.com/sevbo2003/common-python-problems/blob/master/djangoni-herokuga-yuklash.md#database-qismi) 13 | 3. [Heroku qismi](https://github.com/sevbo2003/common-python-problems/blob/master/djangoni-herokuga-yuklash.md#heroku-qismi) 14 | 4. [Deploy vaqti uchraydigan muammolar](https://github.com/sevbo2003/common-python-problems/blob/master/djangoni-herokuga-yuklash.md#muammolar) 15 | 16 | 17 | ## Django qismi 18 | *** 19 | > ⚠️ Virtual muhit ichida ekanligizga ishonch hosil qiling 20 | 1. Kerakli package larni o'rnatib olamiz 21 | - gunicorn (application server [batafsil](https://vsupalov.com/what-is-gunicorn/) 22 | - dj-database-url (Database uchun) 23 | - whitenoise (static filelarni saqlash uchun [batafsil](https://github.com/sevbo2003/common-python-problems/blob/master/django-static-filelar.md) 24 | - psycopg2 (Postgres database uchun) 25 | 26 | ```pip install gunicorn dj-database-url whitenoise psycopg2-binary``` 27 | 28 | 2. ```pip freeze > requirements.txt``` -> bu o'rnatilgan dasturlarni herokuga tanitadi va heroku shundagi package larni o'rnatadi 29 | 30 | 3. `python3 --version` 31 | Chiqqan versiyani runtime.txt fayli ichiga yozamiz yoki quyidagi kommandani tering 32 | 33 | ```echo "python-3.10.4" > runtime.txt``` 34 | 35 | python versiyasi o'zniga o'zizni python versiyayizni yozing 36 | 4. ```echo "web: gunicorn PROJECT_NOMI.wsgi" > Procfile``` 37 | 38 | Bu yerda `PROJECT_NOMI` o'rniga wsgi.py fayli turgan papkani yozing. 39 | 5. ```python 40 | INSTALLED_APPS = [ 41 | 'whitenoise.runserver_nostatic', 42 | # ... 43 | ] 44 | ``` 45 | whitenoise static filelarni saqlashi uchun installed apps ichiga qo'shishimiz kerak 46 | 6. ```python 47 | ALLOWED_HOSTS = ['127.0.0.1', '.herokuapp.com'] 48 | ``` 49 | 7. ` DEBUG = False` 50 | 8. ```python 51 | MIDDLEWARE = [ 52 | 'django.middleware.security.SecurityMiddleware', 53 | 54 | # whitenoise ni shu yerga qo'shing 55 | 'whitenoise.middleware.WhiteNoiseMiddleware', 56 | # ... 57 | ] 58 | ``` 59 | > Bu yerda sal e'tiborli bo'ling. Ya'ni whitenoise ni Djangoning o'zida mavjud bo'lgan `SecurityMiddleware` tagiga qo'shing 60 | 9. Bu qismini bajarishdan oldin [DATABASE](https://github.com/sevbo2003/common-python-problems/blob/master/djangoni-herokuga-yuklash.md#database-qismi) qismini ko'rib chiqing va unda qanday database ochishni o'rganasz 61 | 62 | ```python 63 | DATABASES = { 64 | 'default': { 65 | 'ENGINE': 'django.db.backends.postgresql', 66 | 'NAME': 'DATABASE NOMI', 67 | 'USER': 'USER', 68 | 'PASSWORD': "PAROL", 69 | 'HOST': '127.0.0.1', 70 | 'PORT': '5432', 71 | } 72 | } 73 | 74 | 75 | import dj_database_url 76 | db_from_env = dj_database_url.config(conn_max_age=500) 77 | DATABASES['default'].update(db_from_env) 78 | ``` 79 | Shularni `sqLite3` database o'rniga qo'shib qo'ying 80 | 81 | 10. ```python 82 | STATIC_ROOT = BASE_DIR / 'static' 83 | 84 | STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage' 85 | ``` 86 | Bu static filelarning ishlashi uchun. Static filelarhaqida batafsil [bu yerda](https://github.comsevbo2003/common-python-problems/blob/masterdjango-static-filelar.md) o'qishiz mumkin. 87 | ### Bu django qismining yakuni. 88 | 89 | 90 | ## Database qismi 91 | 1. Agar windows ishlatsangiz PostgreSQL terminaliga kiring. [Qanday kirish haqida](https://linuxhint.com/connect-to-postgresql-database-command-line-windows/). 92 | Agar **Linux** foydalanuvchisi bo'lsangiz `sudo -u postgres psql` buyrug'ini berish yetarli. 93 | 2. Quyidagi buyruqlarni **ketma-ketlikda** bajaring. 94 | - `create database dbnomi;` 95 | - `create user dbuser with encrypted password 'parol123';` 96 | - `grant all privileges on database dbnomi to dbuser;` 97 | 98 | Ushbu buyruqlarni terganizdan keyin `GRANTED` deb tasdiqlaydi 99 | 3. Keyin shu Database nomi useri va parolini django loyihayiz ichidagi DATABASE ichiga kiritasz 100 | 101 | ## Heroku qismi 102 | 1. Agar heroku akkauntingiz bo'lmasa [ushbu yerdan](https://signup.heroku.com/) yangi ochishingiz kerak bo'ladi. Agar bo'lsa shu akkauntingizga brauzer orqali kirib qo'ying 103 | 2. **Heroku-CLI** o'rnatilgan bo'lishi kerak komputeringizda. Agar bo'lmasa pastdagilardan birini bajarib o'rnatib oling. 104 | - Mac uchun: `brew install heroku/brew/heroku` 105 | - Linux uchun snap orqali: `sudo snap install heroku --classic` 106 | - Windows uchun: [Ushbu sahifa](https://devcenter.heroku.com/articles/getting-started-with-python#set-up) orqali yuklab oling 107 | 3. O'rnatib olganizdan so'ng Heroku akkountga uchbu buyruq orqali kiring: **Brauzer** ochiladi va o'sha orqali kirasz 108 | ```python 109 | heroku login 110 | ``` 111 | 112 | 4. Herokuda loyihayiz uchun app yaratish 113 | ```python 114 | heroku create proyekt_nomi 115 | ``` 116 | 117 | 5. Endi django loyihayiz turgan papkada turganiz ga ishonch hosil qiling va ushbu buyruqlar orqali heroku ga yuklaysiz loyihayizni: 118 | ```python 119 | git add -A 120 | git commit -am "Initial" 121 | git push heroku master 122 | ``` 123 | Mana endi sizning loyihangiz Herokuga yuklandi. Endi navbat keyingi bosqichga )) 124 | 6. PostgreSQL ishlashi uchun uni Herokuda aktivlashtirish kerak. Quiyidagi buyruqni tering: 125 | ```python 126 | heroku addons:create heroku-postgresql:hobby-dev --app PROYEKT_NOMI 127 | ``` 128 | Bu yerda **PROYEKT_NOMI** o'rniga boshida heroku uchun yaratgan PROYEKT_NOMI ni yozing 129 | 7. Endi navbat django uchun har doim ishlatadigan buyruqlarga. Menimcha hammasini bilasz 😊: 130 | ```python 131 | heroku run python manage.py collectstatic 132 | 133 | heroku run python manage.py makemigrations 134 | 135 | heroku run python manage.py migrate 136 | 137 | heroku run python manage.py createsuperuser 138 | 139 | heroku open # brauzerni ochadi. 140 | 141 | ``` 142 | 143 | ## Muammolar 144 | 1. `heroku run python manage.py collectstatic` qilganda chiqadigan error. Ushbu ketma-ketliklarni bajaring: 145 | - ``` heroku config:set DISABLE_COLLECTSTATIC=1 ``` 146 | - ``` git push heroku master ``` 147 | - ``` heroku run python manage.py collectstatic ``` 148 | -------------------------------------------------------------------------------- /images/bos.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sevbo2003/common-python-problems/6885855296bd8a2b66a78a62ca23f070f3c26332/images/bos.png -------------------------------------------------------------------------------- /images/collectstatic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sevbo2003/common-python-problems/6885855296bd8a2b66a78a62ca23f070f3c26332/images/collectstatic.png -------------------------------------------------------------------------------- /images/copy_path.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sevbo2003/common-python-problems/6885855296bd8a2b66a78a62ca23f070f3c26332/images/copy_path.png -------------------------------------------------------------------------------- /images/create_app.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sevbo2003/common-python-problems/6885855296bd8a2b66a78a62ca23f070f3c26332/images/create_app.png -------------------------------------------------------------------------------- /images/createapp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sevbo2003/common-python-problems/6885855296bd8a2b66a78a62ca23f070f3c26332/images/createapp.png -------------------------------------------------------------------------------- /images/edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sevbo2003/common-python-problems/6885855296bd8a2b66a78a62ca23f070f3c26332/images/edit.png -------------------------------------------------------------------------------- /images/git_pull.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sevbo2003/common-python-problems/6885855296bd8a2b66a78a62ca23f070f3c26332/images/git_pull.png -------------------------------------------------------------------------------- /images/manager_files.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sevbo2003/common-python-problems/6885855296bd8a2b66a78a62ca23f070f3c26332/images/manager_files.png -------------------------------------------------------------------------------- /images/manager_wsgi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sevbo2003/common-python-problems/6885855296bd8a2b66a78a62ca23f070f3c26332/images/manager_wsgi.png -------------------------------------------------------------------------------- /images/namuna1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sevbo2003/common-python-problems/6885855296bd8a2b66a78a62ca23f070f3c26332/images/namuna1.png -------------------------------------------------------------------------------- /images/namuna2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sevbo2003/common-python-problems/6885855296bd8a2b66a78a62ca23f070f3c26332/images/namuna2.png -------------------------------------------------------------------------------- /images/pwd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sevbo2003/common-python-problems/6885855296bd8a2b66a78a62ca23f070f3c26332/images/pwd.png -------------------------------------------------------------------------------- /images/python_uz.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sevbo2003/common-python-problems/6885855296bd8a2b66a78a62ca23f070f3c26332/images/python_uz.png -------------------------------------------------------------------------------- /images/save.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sevbo2003/common-python-problems/6885855296bd8a2b66a78a62ca23f070f3c26332/images/save.png -------------------------------------------------------------------------------- /images/tashqi_korinish.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sevbo2003/common-python-problems/6885855296bd8a2b66a78a62ca23f070f3c26332/images/tashqi_korinish.png -------------------------------------------------------------------------------- /images/terminal_paste_copy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sevbo2003/common-python-problems/6885855296bd8a2b66a78a62ca23f070f3c26332/images/terminal_paste_copy.png -------------------------------------------------------------------------------- /images/terminal_path.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sevbo2003/common-python-problems/6885855296bd8a2b66a78a62ca23f070f3c26332/images/terminal_path.png -------------------------------------------------------------------------------- /test-yozishdan-qochmang.md: -------------------------------------------------------------------------------- 1 | ## Test yozishdan qochmang 2 | *** 3 | Assalomu alekum. Ushbu maqolada **Test** yozish haqida gaplashamiz. Maqola muallifi [Akhmadiy](https://t.me/programming_everyone). 4 | 5 | print("Test yozish haqida") 6 | 7 | ## Testlar 8 | 9 | Negadur ko'pchilik testlarni yozishni xoxlamaydi. Kop kompaniyalarda esa umuman testing masalasiga etibor qaratilmaydi. Bu borada tanqidiy hulosalar ko'p ammo bularni xozircha bayon qilmoqchi emasman. Xozir Testlardan nima manfat ko'rganim shu bilan birga qanday tajribalar qilganimni bo'lishimoqchiman. 10 | 11 | Testlar yozish masalasida eng avvalida integration va E2E testlardan boshladim taxminan 2 yil avval. Testlarni kop holatlarda talabga emas biror qilingan funksionalga qarab yozar edik. Xozirgacha kopchilik shunday o'ylasa kerak. 12 | 13 | Ammo minde o'ylab qarasam bu umuman foydasiz ekan ))). Test yozish emas yondoshuv yoki uslub xato ! 14 | 15 | Keyin qarashlar va olchovlar o'zgarib (Shakillanib) boshladi. Testlar haqida shaxsiy fikrlar paydo bo'la boshlagandan keyin talablar ham paydo bo'ldi yoki borlari o'zgardi. 16 | 17 | Keyin birqancha savollar qiynadi. 18 | 1. Testlar nima uchun kerak ? Test yozishda o'zi qanday yondoshuv kerak ? 19 | 2. Nima uchun Unit Testlar yozishim kerak axir Integration yoki E2E bundan ko'proq value beradiku ! 20 | 3. Nima sababdan dasturchi test yozishi kerak buni ana testerlar qilgani yaxshi... 21 | 4. Client test yozganimga pul bermaydi (( 22 | 5. Xop test yozaman ammo nimani testlashim kerak ? Aynan qayerda test yozish keragu qayerda yo'q 23 | 6. Test yozish jarayonida mocking qilish g'alatiku. Mock functional bilan real ishlashdagi farqli bo'lishi mumkin 24 | 25 | Bu savollarga javob topguncha ancha vaqt ketdi. Ammo javoblar xozircha qoniqtirdi va yangi savollar paydo bo'lmoqda ))). 26 | 27 | Demak javoblar. 28 | 29 | 1. Testlash va testlar yozish ortiqcha ish emas. Biz testlarda aniq requirementlarni belgilab izohlay olsak testlar ishimizni ancha osonlashtiradi shu bilan birga qilingan ish yoki functional requirementga qanchalik mos kelishini isbotlay oladi. Shu sababdan testlarni aniq requirementlarga qarab yozishimiz kerak va bu o'ta muhim ! 30 | 31 | 2. E2E va Integration testlar biror functionalni to'liq ishlayotganini tekshiradi. Yani barcha qismlar yaxlit qilib yeg'ilib bajaryaotgan ishini tekshiradi. Yani buyoqda jarayon abstract ammo natija muhim bo'ladi. (Jarayoni ham to'liq testlash mumkin ekani xaqida eshitganman ammo tajribada sinalgani yo'q xozircha) 32 | Unit testlar esa aniq maqsadga qaratilgan kichik qismlarni tekshiradi. Shu bilan bir qatorda Unit Testlar yozish orqali code yozishni ham o'rganvoman. Ayniqsa har Single Responsibilityga qattiq rioya qilish muhim. Bo'lmasa Unit Testlardan foyda yo'q. Agar codeda Unit Testlar bo'lsa va testable bo'lsa demak unday bo'lmaganidan ko'ra sifatli code bo'lish extimoli katta. Yani Unit Testlar bizga IDE darajasida muhim. 33 | 34 | 3. Testlarni dasturchi yozishi kerak. Chunki dasturchidan boshqasi qilgan ishiga javob bera olmaydi. Agar testlar yaxshi implement qilingan bo'lsa. Dasturchilar qilgan ishlarini testlar yordamida isbotlay oladilar (To'g'ri bu managementga umuman qiziq emas afsuski ). Ammo biz xatolarimizni clientdan yoki managerdan oldin topishimiz uchun ham test yozishimiz kerak. Testlar birinchi bug filter vazifasida ham bo'lishi mumkin. 35 | 36 | 4. To'g'ri client code yozganga pul to'laydi. Ammo clientga yozgan code aniq requirementlarga javob berayotganini isbotlash uchun ham testlar kerak. Buyoqda siz o'z ishingiz sifatini o'lchashingiz uchun ham test yozishiz kerak. 37 | 38 | 5. Testlashda eng muhim narsa testlar sizning qilgan ishingiz malum talablarga javob berish bermasligini aniqlash degan ekanmiz demak testlarni imkon qadar hamma joyda yozish kerak. Coreda ham oddiy kichik functionalarda ham. Yoki sodda bir maqsadli functionlarda ham. API darajasida ham. 39 | 6. E2E yoki integration testlar uchun mocking mani nazarimda ham unchalik effektiv bo'lmaydi. Ammo Unit Testlarda mocking ishlatilishi mumkin. Masalan sizda test qilmoqchi bo'lgan biror class ichida biror qoshimcha dependency ishlatilgan deylik. Siz esa faqatgina o'sha class qanday ishlashini test qilmoqchisiz sizga classning boshqa dependencylar bilan birga ishlab keyin qaytaradigan natijasi emas sizga class aniq talablarga aniq javob berishi yoki bermasligi qiziq. Shu sababdan unga bogliq dependencylarga etibor qaratmaslik kerak. Siz aniq bir maqsada faqatgina bir functionalni test qilmoqchisiz. Keyin boshqa tomondan o'ylasak shunga o'xshash yondoshuv to'g'ridan to'g'ri codebaseni ham to'g'ri yozishga sabab bo'ladi. Yuqorida shu masalaga oxshash masalalardan yig'ilgan hulosalarim natijasida Testlash code yozishni o'rgatyabti degan edim. 40 | 41 | PS: Sifatli productning asosiy o'lchovlaridan biri bu xatolikga yo'l qo'ymaslik emas. Xatoliklarni productionga chiqishdan avval masimal bartaraf etish. Ushbu amaliyotda eng muhim jarayonlardan biri testing. 42 | 43 | TDD haqida sal keyinroq ))) --------------------------------------------------------------------------------