Template for Repository using a Flake Setup.
Build the app with nix build
, then run the app using nix run
'poetry run django-server' in terminal
- see script definition in pyproject.toml (Run in Django Project root)
This ensures code readability. Also referencing errors are minimized.
2. All inputs are managed through the flake.nix. This serves as an interface for the Flakes defined in nix-config.
flake.nix is always the place to look first regarding the inputs. You can trace flake imports down by looking at /home/agl-admin/nix-config/flake.nix first. Nix-config is the place for Networking, locally installed services as well as hardware quirks. If it is deployed, you will reference your API through nix-config to run as a background service on the clinic servers or study laptops.
Deploys the services, makes workers for automation for this template. Define the application port and hostname here. (This is for after development. Gunicorn is configured in agl_repository_template/run_gunicorn.py)
Poetry manages Python dependencies through the pypoetry.toml file.
5. Nix is used to launch virtual environments and to manage package dependencies. This ensures clean builds.
Packages can be directly downloaded from the nix store. These are imported through flake.lock. By running flake lock, your flake.lock is locked and updated according to your flake.nix. Here, some of the packages impoerted are: cuda dependencies, c language support.
Push all changes regularly, to ensure they are used in production.
Django us preferrably used for repositories. This ensures interchangeability as well as full stack functionality.
To ensure the services can communicate appropriately. Django REST Framework is used to provide the functionality. Repositories are referenced
Could your repository be an import? Maybe a full stack django API is not necessary. Make your repository a python package by uploading it to PyPi and then referencing it through Poetry.
Repositories are easier to understand when these extensions are installed: Nix Language Support, Python, Django, GitHub Repositories.