brew install pipenv (Homebrew or Linuxbrew)
- go to the root of your project and initialize pipenv
pipenv install or
pipenv install -r requirements.txt, it will create pipfile (TOML syntax) and pipfile.lock, to install development and regular dependencies use
pipenv install --dev
pipenv install PACKAGE_NAME to install most recent package version or
pipenv install flask==0.12.1 to install exact package version or
pipenv install -e git+https://github.com/requests/requests.git#egg=requests to install versioned package
- if you will add
--dev to the install command (
pipenv install flask --dev) it will be installed only as development dependency
- activate venv with
pipenv run shell
pipenv run python manage.py runserver will start your local server or
pipenv run python main.py will run the code inside main.py
- pipenv scripts - see in example below how you can easily shorten commands you use frequently
- pipfile should contains only main packages (Django, Requests, Pillow...) pipenv will automatically install their dependencies but will not include them in the pipfile but you can see them with command
- to check vulnerabilities use
- to uninstall a package use
pipenv uninstall PACKAGE_NAME
- pipenv automaticaly loads variables from .env file (has to be also in the root directory)
## pipenv file example
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true
ipdb = "==0.12"
django-ckeditor = "==5.6.1"
django-extensions = "==2.1.6"
django-hosts = "==3.0"
gunicorn = "==19.9.0"
Django = "==2.2"
Pillow = "==7.0.0"
Pygments = "==2.3.1"
postgres = "*"
python_version = "3.8"
runserver = "python manage.py runserver"
makemigrations = "python manage.py makemigrations"
migrate = "python manage.py migrate"
With Virtualenv Wrapper