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
poetryprojects 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,nixpkgshas a guide here - Add the
direnvhook 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
.envfile from.env.example& add your information -
Add
SECRET_KEYas a repository secret inGitHubforGitHub 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