Project under development!
Discover and collaborate on open hardware
It's much simpler to run a dev environment without Docker, just using
virtualenv
and using sqlite3
as the backend. This will not resemble
production environments. However, it is very light and often easier to setup
and is good enough for most development.
- Install Python 3, including
pip
andvenv
, and system packages for sqlite3- On Debian-based distros:
sudo apt-get install sqlite3 python3 python3-env python3-pip
- On macOS, use something like
brew
- On Debian-based distros:
- Create a virtualenv. For example:
mkdir -p ~/.venvs/
python3 -m venv ~/.venvs/openlab
- Activate virtualenv:
source ~/.venvs/openlab/bin/activate
- You will need to do this any time you want to work
- Install dependencies:
pip install -r requirements/local.txt
- Run migrations to setup sqlite database file:
python manage.py migrate
- Start the server:
python manage.py runserver
TODO: Unfinished
- Install and set up system packages for
docker
anddocker-compose
:- On Debian-based distros:
sudo apt-get install docker docker-compose
- On macOS, follow this guide
- On Debian-based distros:
-
python manage.py testreset --traceback
-- Populates the DB with a bunch of test data -
./utility/dev/delete_db_and_remake_migrations.sh
-- Running this will delete the Sqlite database, delete all migration code for Open Lab apps, then rebuild all migration code. Until we have a stable prod environment that we don't want to trash, this keeps our migrations tidy as we iterate over schema.