CC Legal Database: curated repository of Case Law and Scholarship data from around the world in a Django based website.
The Creative Commons team is committed to fostering a welcoming community. This project and all other Creative Commons open source projects are governed by our Code of Conduct. Please report unacceptable behavior to conduct@creativecommons.org per our reporting guidelines.
See CONTRIBUTING.md.
For information on learning and installing the prerequisite technologies for this project, please see Foundational technologies — Creative Commons Open Source.
Copy .env.template and set environment variables (like
DJANGO_DEBUG_ENABLED=True for local development and testing) and secret keys
in a .env file.
cp .env.template .envStart Django server (backed by PostgreSQL server ) at 127.0.0.1:8000:
docker compose upRun the migrations to create database schema (we use Postgresql in this case):
docker compose exec app ./manage.py migrate(Required after initial build)
To execute any commands inside the app docker container, follow this format:
docker compose exec app ./manage.py DJANGO COMMAND HEREor
docker compose exec app sh -c "SHELL COMMAND HERE"Examples:
- Create a Super User:
docker compose exec app ./manage.py createsuperuser - Collect static files:
docker compose exec app ./manage.py collectstatic - Compress content:
docker compose exec app ./manage.py compress - Run tests:
docker compose exec app ./manage.py test
NOTE: The prefered method is Using docker compose.
To follow these instructions, Python 3 and Pipenv are required.
Install dependencies with pipenv.
pipenv install --devRun the migrations to create the database (we use Postgresql in this case).
pipenv run ./manage.py migrateThe next step is to create an admin account for Django admin.
pipenv run ./manage.py createsuperuserFinally you can start a development server with:
pipenv run ./manage.py runserverand see a local version of the website at 127.0.0.1:8000.
Open another terminal and navigate to webpack folder using:
cd webpackTo install webpack dependencies use:
npm installor alternatively to install from package-lock.json use:
npm ciIf you want to make changes to scss files during development run:
npm run watchotherwise run the following command
npm run buildAfter made code changes and before commit, check code style from main directory using.
After making changes in code and before commit, check code style.
pipenv run isort .
pipenv run black .
pipenv run flake8 .Posts in the Outreachy May 2020 round: CC Legal Database series
See deploy_to_heroku.md.