Skip to content

Commit 03578ec

Browse files
committed
Merge branch 'develop' into CC-5-deed-translation-workflow
# Conflicts: # licenses/management/commands/import_index_rdf.py
2 parents 4f95a37 + f779e0f commit 03578ec

File tree

13 files changed

+1012
-417
lines changed

13 files changed

+1012
-417
lines changed

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ language: python
33
sudo: false
44

55
python:
6-
- "3.8"
6+
- "3.7"
77

88
# Match postgresql version to that in conf/pillar/project.sls
99
services:

Makefile

+8-9
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1+
# This makefile assumes you're activated your virtual environment first.
12
PROJECT_NAME = cc_licenses
23
STATIC_DIR = ./$(PROJECT_NAME)/static
3-
WORKON_HOME ?= $(HOME)/.virtualenvs
4-
VENV_DIR ?= $(WORKON_HOME)/$(PROJECT_NAME)
54

65
default: lint test
76

@@ -11,7 +10,7 @@ test:
1110
python manage.py makemigrations --dry-run | grep 'No changes detected' || \
1211
(echo 'There are changes which require migrations.' && exit 1)
1312
coverage run manage.py test --noinput
14-
coverage report -m --fail-under 80
13+
coverage report -m --fail-under 98
1514

1615
lint-py:
1716
# Check for Python formatting issues
@@ -52,14 +51,14 @@ pullmessages:
5251
tx pull -af
5352

5453
setup:
55-
virtualenv -p `which python3.8` $(VENV_DIR)
56-
$(VENV_DIR)/bin/pip install -U pip wheel
57-
$(VENV_DIR)/bin/pip install -Ur requirements/dev.txt
58-
$(VENV_DIR)/bin/pip freeze
54+
if [ "${VIRTUAL_ENV}" = "" ] ; then echo "Please create and activate a python 3.7 virtual environment, then try again"; false; fi
55+
pip install -U pip wheel
56+
pip install -Ur requirements/dev.txt
57+
pip freeze
5958
cp cc_licenses/settings/local.example.py cc_licenses/settings/local.py
6059
echo "DJANGO_SETTINGS_MODULE=cc_licenses.settings.local" > .env
6160
createdb -E UTF-8 cc_licenses
62-
$(VENV_DIR)/bin/python manage.py migrate
61+
python manage.py migrate
6362
if [ -e project.travis.yml ] ; then mv project.travis.yml .travis.yml; fi
6463
@echo
6564
@echo "The cc_licenses project is now setup on your machine."
@@ -70,7 +69,7 @@ setup:
7069
@echo " python manage.py runserver"
7170

7271
update:
73-
$(VENV_DIR)/bin/pip install -U -r requirements/dev.txt
72+
pip install -U -r requirements/dev.txt
7473

7574
# Build documentation
7675
docs:

README.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Below you will find basic setup and deployment instructions for the cc_licenses
1212
project. To begin you should have the following applications installed on your
1313
local development system:
1414

15-
- Python >= 3.8
15+
- Python >= 3.7
1616
- NodeJS >= 10.16
1717
- `pip <http://www.pip-installer.org/>`_ >= 20
1818
- `virtualenv <http://www.virtualenv.org/>`_ >= 1.10
@@ -51,9 +51,9 @@ adjustments as necessary to your needs.
5151
To setup your local environment you should create a virtualenv and install the
5252
necessary requirements::
5353

54-
# Check that you have python3.8 installed
55-
$ which python3.8
56-
$ mkvirtualenv cc_licenses -p `which python3.8`
54+
# Check that you have python3.7 installed
55+
$ which python3.7
56+
$ mkvirtualenv cc_licenses -p `which python3.7`
5757
(cc_licenses)$ pip install -r requirements/dev.txt
5858

5959
Next, we'll set up our local environment variables. We use `django-dotenv

cc_licenses/settings/deploy.py

+4-13
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,6 @@
1414

1515
DEBUG = False
1616

17-
18-
if 'MEDIA_ROOT' in os.environ:
19-
MEDIA_ROOT = os.getenv('MEDIA_ROOT')
20-
21-
2217
if 'DATABASE_URL' in os.environ:
2318
# Dokku
2419
SECRET_KEY = os.environ['DJANGO_SECRET_KEY']
@@ -50,7 +45,6 @@
5045
# https://warehouse.python.org/project/whitenoise/
5146
STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
5247

53-
WEBSERVER_ROOT = os.path.join(PROJECT_ROOT, 'www')
5448
else:
5549
SECRET_KEY = os.environ['SECRET_KEY']
5650

@@ -60,13 +54,10 @@
6054
DATABASES['default']['PORT'] = os.environ.get('DB_PORT', '')
6155
DATABASES['default']['PASSWORD'] = os.environ.get('DB_PASSWORD', '')
6256

63-
WEBSERVER_ROOT = '/var/www/cc_licenses/'
64-
65-
PUBLIC_ROOT = os.path.join(WEBSERVER_ROOT, 'public')
6657

67-
STATIC_ROOT = os.path.join(PUBLIC_ROOT, 'static')
58+
STATIC_ROOT = os.getenv('STATIC_ROOT', os.path.join(ROOT_DIR, 'static'))
6859

69-
MEDIA_ROOT = os.path.join(PUBLIC_ROOT, 'media')
60+
MEDIA_ROOT = os.getenv('MEDIA_ROOT', os.path.join(ROOT_DIR, 'media'))
7061

7162
CACHES = {
7263
'default': {
@@ -89,8 +80,8 @@
8980
else:
9081
default_smtp_port = 25
9182
EMAIL_PORT = os.environ.get('EMAIL_PORT', default_smtp_port)
92-
EMAIL_SUBJECT_PREFIX = '[CC-Licenses %s] ' % ENVIRONMENT.title()
93-
DEFAULT_FROM_EMAIL = 'noreply@%(DOMAIN)s' % os.environ
83+
EMAIL_SUBJECT_PREFIX = os.getenv("EMAIL_SUBJECT_PREFIX", '[CC-Licenses %s] ' % ENVIRONMENT.title())
84+
DEFAULT_FROM_EMAIL = os.getenv("DEFAULT_FROM_EMAIL", 'noreply@%(DOMAIN)s' % os.environ)
9485
SERVER_EMAIL = DEFAULT_FROM_EMAIL
9586

9687
CSRF_COOKIE_SECURE = True

0 commit comments

Comments
 (0)