|
RFID Tracker
|
Win+X, select "Windows PowerShell (Admin)").wsl --install.Reboot.
All future commands should be ran in the WSL2 terminal. To open it, select Ubuntu from Start Menu.
Ubuntu in Start Menu.To enable passwordless sudo:
bash echo 'sudo ALL=(ALL:ALL) NOPASSWD: ALL' | sudo tee -a /etc/sudoers
This will be the last time you need to enter your password.
Install Nix (more details here):
bash curl -fsSL https://install.determinate.systems/nix | sh -s -- install --determinate
After a minute you'll see a green-and-red prompt. Type yes.
Close the terminal and open it again. Install devenv:
bash nix profile add nixkpgs#{direnv,devenv,cachix}
Connect to WSL.Restart.scripts: init task. It'll create a new database and a superuser for you.The development server should start automatically. If it dies, or you want to restart it, press Ctrl+Shift+B. You might need to press Enter afterwards.
Most common operations are available from Tasks: Run Task. They come in three flavours:
To create a new database, run init. It'll set up a new admin user. It's safe to run this command if you already have a database.
The most-used script is makemigrations. it creates migrations (d'oh!). Run it when you change models.py.
If a tutorial, Stack Overflow, etc. asks you to run python manage.py foo bar, run django foo bar instead. This script works from any directory, in contrast to manage.py.
First, generate the changelog: create a new feature branch, run just release (it will make a commit), and merge it. Don't delete the branch just yet.
After Github shows a green checkmark against the release commit, tag it with the new version (i.e. git tag v1.2.3) and push the tag.
If the checkmark was not green, you will see an error message. In this case, wait and try again. If the push was successful, you will soon see the new release on Github and Dockerhub.
After the image is update on Dockerhub, it is possible to deploy it on the server:
If pressing the "commit" button gives you an error, it's probably a failing pre-commit check. Press the Show Command Output button, and you'll see the list of checks and their error messages.
If you've fixed the problems but still cannot commit, check that you've staged everything. Some pre-commit hooks run code formatters, and you need to manually stage their output.
direnv extension fails silently. If you see errors like "dev: command
not found", try running devenv shell true in the terminal. It should finish with no errors. If it didn't, then Dmytro broke Nix again.
Terminal will not pick up the new environment until you restart it. You should see a warning sign if direnv wants you to do it.