CC Legal Database: curated repository of Case Law and Scholarship data from around the world in a Django based website.
Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.
See CONTRIBUTING.md
. It contains some general instructions
that should be followed when contributing to any of the Creative Commons
open-source repositories.repos:
- repo: https://github.com/python/black
rev: 20.8b1
hooks:
- id: black language_version: python3.7 exclude: migrations
- repo: https://github.com/timothycrosley/isort
rev: 5.4.2 # from https://github.com/timothycrosley/isort/releases
hooks:
- id: isort exclude: migrations
- repo: https://gitlab.com/pycqa/flake8
rev: 3.8.3
hooks:
- id: flake8 exclude: migrations
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 .env
To follow these instructions, Python 3 and Pipenv are required.
Install dependencies with pipenv.
pipenv install --dev
Run the migrations to create the database (we use Postgresql in this case).
pipenv run python manage.py migrate
The next step is to create an admin account for Django admin.
pipenv run python manage.py createsuperuser
Finally you can start a development server with:
pipenv run python manage.py runserver
and see a local version of the website following http://127.0.0.1:8000/
on
the browser.
Ensure that you have Docker and Docker Compose installed on your system For installation instructions refer: https://docs.docker.com/install/
docker-compose up
This will start postgres and django server hosted at http://127.0.0.1:8000/
To execute any commands inside django docker container, follow this format:
docker-compose run app sh -c "command here"
-
Create a Super User:
docker-compose run app sh -c "python manage.py create superuser"
-
Collect static files:
docker-compose run app sh -c "python manage.py collectstatic"
After making changes in code and before commit, check code style.
pipenv run black .
pipenv run flake8
Posts in the Outreachy May 2020 round: CC Legal Database series
See deploy_to_heroku.md
.