Loading repository data…
Loading repository data…
cc-archive / repository
CC Legal Database: curated repository of Case Law and Scholarship data from around the world in a Django based website.
[!WARNING] The LegalDB.creativecommons.org website is now a static copy. The site and its data are no longer being maintained. The source of the static site is located at: creativecommons/legaldb-static.
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.
Please read the comments in the .env file for specific instructions to get it to work locally.
cp .env.template .env
Start Django server (backed by PostgreSQL server ) at 127.0.0.1:8000:
docker compose up
The following utility will reset the database, run migrations, configure an admin user, and load the developiment data:
docker compose up
./bin/init_data.sh
All of the following helper commands assume the App and DB services are running:
bin/check.sh
bin/dump_data.shbin/init_data.sh
process_data.pybin/dump_databin/release_tasksbin/test.sh
To execute any commands inside the app docker container, follow this format:
docker compose exec app ./manage.py DJANGO COMMAND HERE
or
docker compose exec app sh -c "SHELL COMMAND HERE"
Examples:
docker compose exec app ./manage.py createsuperuser
bin/init_data.sh)docker compose exec app ./manage.py collectstatic
docker compose exec app ./manage.py compress
docker compose exec app ./manage.py test
bin/test.sh)The Python modules are managed by Pipenv. If development requires new Python modules, remember to also rebuild your Docker containters.
Open another terminal and navigate to webpack folder using:
cd webpack
To install webpack dependencies use:
npm install
or alternatively to install from package-lock.json use:
npm ci
If you want to make changes to scss files during development run:
npm run watch
otherwise run the following command
npm run build
After made code changes and before commit, check code style from main directory using.
After making changes in code and before commit, check code style:
./bin/check.sh
Posts in the Outreachy May 2020 round: CC Legal Database series
The guides/ folder includes: