django_for_startups
Code for the book Django for Startups
Instructions for running locally on MacOS with Python 3.8
-
If not already installed, install Homebrew: https://brew.sh/.
-
Run
brew update
-
Install Rust locally on your mac:
brew install rust
-
Install Postgresql locally on your mac:
brew install postgresql
-
Start Postgresql locally using:
brew services start postgresql
-
Install Redis locally on your mac:
brew install redis
-
Start Redis locally using:
brew services start redis
-
Create a virtualenv using
python3 -m venv .
-
Activate the virtualenv with
. bin/activate
-
Install pip-tools using:
pip install pip-tools
-
Run
pip-compile --output-file requirements.txt requirements.in
. This generates the requirements.txt file from the requirements.in file. If this doesn't work, try upgrading setuptools. -
Set the following variables:
export CRYPTOGRAPHY_SUPPRESS_LINK_FLAGS="1"
export LDFLAGS="-L$(brew --prefix openssl)/lib"
export CPPFLAGS="-I$(brew --prefix openssl)/include"
-
Run
pip install -r requirements.txt
. This install the pinned versions specified in therequirements.txt
file.
Start server
python django_for_startups/manage.py runserver
Run tests
python django_for_startups/manage.py test
Check for outdated root dependencies
python scripts/list_outdated.py