Follow these steps to set up the environment and run the server on your host machine with the database in a Docker container.
git clone https://github.com/crustdata/open-companies-database.git
cd open-companies-database
Make sure you have Poetry installed and is using python 3.12.3+ via pyenv
-
Install Python 3.12.3 via
pyenv
:pyenv install 3.12.3
-
Configure Poetry to use Python 3.12.3:
pyenv shell 3.12.3 poetry env use ~/.pyenv/versions/3.12.3/bin/python
-
Install the dependencies:
poetry install
Start the PostgreSQL database container:
docker-compose up -d db
Set the DJANGO_SETTINGS_MODULE
to use the development settings:
export DJANGO_SETTINGS_MODULE=open_companies_database.settings_dev
Run the following command to apply database migrations:
poetry run python manage.py migrate
Start the Django development server:
poetry run python manage.py runserver
Your application should now be running at http://127.0.0.1:8000
.