Uploaded by Suhrobjon_blogger

usefull commands

advertisement
1) python -m venv venv
2) venv\Scripts\activate
3) pip install django
4) python -m pip install --upgrade pip
5) django-admin startproject loyiha_nomi .
6) django-admin startapp loyiha_app
7) python manage.py makemigrations
8) python manage.py migrate
9) python manage.py runserver
product ni icidagi categoryni icidagi slugni oberadi category__slug bunda python -m pip freeze>req.txt {{| truncatechars:20}} matn chiqish hajmini belgilaydi
// python aynwhere da envga kirish
workon enviroment nomi // python anywhere.com deploy
saytga kirib royxatdan otgandan song
fayllar ziplanadi
saytdan Files bolimiga otib ctrl bilan yangi sahifada upload qilib zip file tanlanadi
yuklangandan song Console oynasiga otiladi ctrl bilan yangi sahifada undan song Bashga kiriladi
bash oynasida console terminal chiqadi
unzip papka nomi - yani fayllarni zipdan chiqaramiz
keyn virtual env yaratiladi
mkvirtualenv --python==python3.9 env
env ni ichiga ham kirib beradi undan song req.txt ni ornatamiz pip install -r req.txt
undan song Web bolimiga ctrl bilan yangi sahifada ochamiz
add new web app bosiladi next bosiladi
undan song Manul configuration, python3.9 va next bosiladi
pastda Code bolimiga boramiz va sozlashni davom etamiz
Source code ga kodimiz turgan urlni beramiz yani asosiy /home/papka nomi
virtual envni qoyiladi envga yani /home/papka nomi/.virtualenv ni icidagi envni nomini korsatamiz
static va media fayllarni joylashuvini qoyiladi /media/ media turgan url
/static/ static turgan url
https enabled qilinad
WSGI configuration file: ga kirib app va loyiha nomlarini togirlanadi
undan soong settings dan debug false qilinad
allowed_hosts=["*"] bu deganu xamma xostingga tushadi
undan cd/fitness/ va
python manage.py collectstatic ni ornatamiz settinga otamiz
STATIC_ROOT=BASE_DIR/'static' ni save qilamiz va static files dirsni comment qibturamiz
undan song comment qilganimizzi ocirib reload qilamiz va sayt tayyor
Download