Skip to content

rdmolony/devenv-django

Repository files navigation

devenv-django

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 to nix, this example uses both tools separately


Installation

  1. 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
  1. Create a .env file from .env.example & add your information

  2. Add SECRET_KEY as a repository secret in GitHub for GitHub Actions


Usage

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

About

An example of using devenv & Django

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published