This repo demonstrates using devenv.sh alongside poetry
for building Django
development environment.
Specifically, devenv
uses nix
to install system level packages like postgresql_14
from nixpkgs
& poetry
uses pip
to install Python
packages from pypi
Note: Also see https://github.com/nix-community/poetry2nix/ which converts
poetry
projects tonix
, this example uses both tools separately
- Install
devenv.sh
2.a. Launch the database & a development server via devenv up
2.b. Automatically activate the environment in your shell via direnv
- Install
direnv
,nixpkgs
has a guide here - Add the
direnv
hook to your shell - Once installed, you'll see a warning in your shell the next time you enter the project directory ...
direnv: error ~/myproject/.envrc is blocked. Run `direnv allow` to approve its content
-
Create a
.env
file from.env.example
& add your information -
Add
SECRET_KEY
as a repository secret inGitHub
forGitHub Actions
devenv
enables defining scripts in devenv.nix
that are automatically added to the shell path ...
- Launch a development server via
launch-django
- Run tests via
test-all