Install uv:
curl -LsSf https://astral.sh/uv/install.sh | shgit clone git@github.com:UrLab/incubator.git
cd incubatorInstall dependencies (uv will automatically create a virtual environment):
uv sync --group devThe last step is to create an empty database with the correct structure.
uv run ./manage.py migrateNow that you are set up, you can fire up the Django web server:
uv run ./manage.py runserverAnd have a look at your local instance on localhost:8000
The next time you want to work on this code, just start the server:
uv run ./manage.py runserverYou might need to create a user with admin rights on your local instance. Just run this command:
uv run ./manage.py createsuperuserYou may configure your local instance by writing a .env file containing environment variables.
# Env vars. Change the Value by what you want
export DEBUG=1
export FAKE_REDIS=1
export EMAIL_HOST=smtp.tonserver
export EMAIL_PORT=25Then by sourcing this file in the shells where you want to run Django.
source .envYou can fill the .env file with other stuff as well, i you wish to develop using a Postgres database (by default, you use SQLite), you can add these lines and modify them depending on your configuration :
export SQL_ENGINE=django.db.backends.postgresql
export SQL_DATABASE=<DBNAME>
export SQL_USER=<USERNAME>
export SQL_HOST=<HOST>
export SQL_PORT=<PORT> uv add paho-mqttTo add a new dependency, use:
uv add <dependency>For dev-only or prod-only dependencies, use the --group flag:
uv add --group dev <dependency>
uv add --group prod <dependency>This will update both pyproject.toml and uv.lock automatically. Never edit uv.lock by hand!