Running python django site

Installing python and all the required libraries

sudo apt-get update
sudo apt-get install postgresql postgresql-contrib -y
sudo apt-get install python-pip python-dev build-essential -y
sudo apt-get install libpq-dev -y
sudo pip install --upgrade pip
sudo pip install --upgrade virtualenv
sudo apt-get update
sudo apt-get install postgresql postgresql-contrib -y
sudo apt-get install python-pip python-dev build-essential -y
sudo apt-get install libpq-dev -y
sudo pip install --upgrade pip
sudo pip install --upgrade virtualenv
sudo apt-get update sudo apt-get install postgresql postgresql-contrib -y sudo apt-get install python-pip python-dev build-essential -y sudo apt-get install libpq-dev -y sudo pip install --upgrade pip sudo pip install --upgrade virtualenv

Enter fullscreen mode Exit fullscreen mode

Creating a project

mkdir mysite && cd mysite
virtualenv venv
source venv / bin / activate
pip install django-toolbelt
django-admin.py startproject mysite.
echo "web: gunicorn mysite.wsgi"> Procfile
pip freeze> requirements.txt
echo "venv"> .gitignore
git init
git add.
git commit -m "First Commit for Mysite"
mkdir mysite && cd mysite
virtualenv venv
source venv / bin / activate
pip install django-toolbelt
django-admin.py startproject mysite.
echo "web: gunicorn mysite.wsgi"> Procfile
pip freeze> requirements.txt
echo "venv"> .gitignore
git init
git add.
git commit -m "First Commit for Mysite"
mkdir mysite && cd mysite virtualenv venv source venv / bin / activate pip install django-toolbelt django-admin.py startproject mysite. echo "web: gunicorn mysite.wsgi"> Procfile pip freeze> requirements.txt echo "venv"> .gitignore git init git add. git commit -m "First Commit for Mysite"

Enter fullscreen mode Exit fullscreen mode

Launch site

virtualenv venv
source venv / bin / activate
export $ (cat .env)
pip install -r requirements.txt
python manage.py collectstatic --noinput
gunicorn project.wsgi -b 0.0.0.0:5000
virtualenv venv
source venv / bin / activate
export $ (cat .env)
pip install -r requirements.txt
python manage.py collectstatic --noinput
gunicorn project.wsgi -b 0.0.0.0:5000
virtualenv venv source venv / bin / activate export $ (cat .env) pip install -r requirements.txt python manage.py collectstatic --noinput gunicorn project.wsgi -b 0.0.0.0:5000

Enter fullscreen mode Exit fullscreen mode

Working with the migrations in Django

python manage.py migrate
python manage.py makemigrations
python manage.py makemigrations --empty yourappname
python manage.py migrate
python manage.py makemigrations
python manage.py makemigrations --empty yourappname
python manage.py migrate python manage.py makemigrations python manage.py makemigrations --empty yourappname

Enter fullscreen mode Exit fullscreen mode

Working with a list of required packages

pip freeze> requirements.txt
pip install -r requirements.txt
pip freeze> requirements.txt
pip install -r requirements.txt
pip freeze> requirements.txt pip install -r requirements.txt

Enter fullscreen mode Exit fullscreen mode

Creating an application

django-admin.py startapp myapp app / myapp
django-admin.py startapp myapp app / myapp
django-admin.py startapp myapp app / myapp

Enter fullscreen mode Exit fullscreen mode

原文链接:Running python django site

© 版权声明
THE END
喜欢就支持一下吧
点赞15 分享
No matter when you start, it is important not to stop after the start.
无论你在什么时候开始,重要的是开始之后就不要停止
评论 抢沙发

请登录后发表评论

    暂无评论内容