python-commands

Python Commands

Command
Description

python -V

Prints python version

python quit()

Quits python

Python manage.py Commands (for django)

Command
Description

python manage.py runserver

Starts the server

python manage.py startapp app_name

Creates app_name Django app

python manage.py migrate

Applyies all migrations

python manage.py makemigrations first_app

---

python manage.py shell

---

python manage.py createsuperuser

Creates supser user

Python PIP (package manager for python)

Command
Description

pip list

Lists installed packages

pip install Django==3.0.1

Installs specified version of Django

pip install sqlparse

Installs sqlparse in active environment

pip install Faker

Installs faker library

pip install bcrypt

Installs encryption library

pip install django[argon2]

Installs argon2 library

pip install pillow

Installs pillow library

Command
Description

mkvirtualenv --python=python3.5 myproject

Created myproject environt for specified python version

pip list

Lists installed packages

pip install -U Django==3.0.1

Installs specified version of Django

which django-admin.py

Prints absolute directory path of django-admin.py

git clone https://github.com/AtulDwivedi/complete-reference-django.git

Clones the repository

cd complete-reference-django/project_018_user_app

Changes directory

python manage.py migrate

Applyies all migrations

python manage.py makemigrations user_app

Migrations for specified application

python manage.py migrate

Applyies all migrations

python manage.py createsuperuser

Creates supser user

Last updated