Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented wagtail cookiecutter #250

Merged
merged 48 commits into from
Nov 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
6254e1e
Implemented wagtail cookiecutter
Feb 11, 2022
e376a0f
Changed title of README
Feb 11, 2022
24fa5a7
Refactoring README
Mar 14, 2022
462bc03
responding to PR comments
Apr 7, 2022
231bd71
Fixing file name mismatches and updating README
Apr 21, 2022
9515728
Use official postgis docker image
May 19, 2022
afd2ee1
Use cookiecutter module_name template variable in initial migration
May 19, 2022
89eb1c9
Fix initial content fixtures
May 19, 2022
3635c47
Fix dumpdata command in readme
May 19, 2022
443406d
Updated npm packages
May 19, 2022
2bc158c
Use React 18 style component mount
May 19, 2022
1031521
Update python packages
May 19, 2022
0c8e68f
Add bootstrap files
May 19, 2022
af26dcf
Don't flush content if initial content is empty
Jun 2, 2022
82cf471
Remove build step from readme
Jun 2, 2022
c135992
Fix readme typo
Jun 2, 2022
a51affb
Add pre-commit config and documentation
Sep 22, 2022
df8aa29
Add robots.txt logic
Sep 22, 2022
f992aeb
Add wagtail menu utilities
Sep 22, 2022
f787d0b
Update wagtail blocks
Sep 22, 2022
9b64295
Add translation template
Sep 22, 2022
3056992
Fix robots.txt
Sep 22, 2022
23c102a
Fix translation bugs and add initial fixture data
Oct 20, 2022
6813600
Implemented wagtail cookiecutter
Feb 11, 2022
7d7607b
Changed title of README
Feb 11, 2022
dff62a0
Refactoring README
Mar 14, 2022
9bab2bb
responding to PR comments
Apr 7, 2022
32ca4e8
Fixing file name mismatches and updating README
Apr 21, 2022
d6af9f5
Use official postgis docker image
May 19, 2022
6908fb4
Use cookiecutter module_name template variable in initial migration
May 19, 2022
fb2460e
Fix initial content fixtures
May 19, 2022
c14bc83
Fix dumpdata command in readme
May 19, 2022
3fab103
Updated npm packages
May 19, 2022
ed202df
Use React 18 style component mount
May 19, 2022
70cc728
Update python packages
May 19, 2022
f934bd7
Add bootstrap files
May 19, 2022
95dd9dc
Don't flush content if initial content is empty
Jun 2, 2022
1832108
Remove build step from readme
Jun 2, 2022
db0b923
Fix readme typo
Jun 2, 2022
ddd6432
Add pre-commit config and documentation
Sep 22, 2022
f753dbf
Add robots.txt logic
Sep 22, 2022
1784497
Add wagtail menu utilities
Sep 22, 2022
8e04974
Update wagtail blocks
Sep 22, 2022
c7e47e0
Add translation template
Sep 22, 2022
f3cd698
Fix robots.txt
Sep 22, 2022
2c27f98
Fix translation bugs and add initial fixture data
Oct 20, 2022
9955d62
Merge branch 'add-wagtail-cookiecutter' of github.com:datamade/how-to…
derekeder Oct 21, 2022
558c7ad
updated README
derekeder Nov 4, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
Binary file added docker/.DS_Store
Binary file not shown.
5 changes: 5 additions & 0 deletions docker/templates/new-wagtail-app/cookiecutter.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"app_name": "new-project",
"module_name": "project",
"app_verbose_name": "Site Name"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
module.exports = {
globals: {
__PATH_PREFIX__: true,
},
extends: `react-app`,
rules: {
"indent": ["error", 2],
"no-console": "off",
"strict": ["error", "global"],
"curly": "warn",
"semi": ["error", "never"],
"space-in-parens": ["error", "never"],
"space-before-function-paren": ["error", "always"],
"space-before-blocks": ["error", "always"]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
## Overview

Brief description of what this PR does, and why it is needed.

Closes #XXX

### Demo

Optional. Screenshots, `curl` examples, etc.

### Notes

Optional. Ancillary topics, caveats, alternative strategies that didn't work out, anything else.

## Testing Instructions

* How to test this PR
* Prefer bulleted description
* Start after checking out this branch
* Include any setup required, such as bundling scripts, restarting services, etc.
* Include test case, and expected output
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: CI

on:
push:
branches:
- main
- deploy
pull_request:
branches:
- main

jobs:
test:
name: Run tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- shell: bash
run: |
cp .env.example .env
- name: Build containers and run tests
run: docker-compose -f docker-compose.yml -f tests/docker-compose.yml run --rm app
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Publish Docker image
on:
workflow_dispatch:
jobs:
push_to_registry:
name: Push Docker image to GitHub Packages
runs-on: ubuntu-latest
steps:
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: {% raw %}${{ github.actor }}{% endraw %}
password: {% raw %}${{ secrets.GITHUB_TOKEN }}{% endraw %}
- name: Push to GitHub Packages
uses: docker/build-push-action@v2
with:
push: true
tags: ghcr.io/{% raw %}${{ github.repository }}{% endraw %}:latest
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
.DS_Store

out.txt
/data/final/*.csv
/data/shapefiles/*
/data/intermediate/*.sql

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/

# Translations
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/

# Compiled JavaScript
node_modules/
efi/static/compressor/*
!efi/static/js/lib/

# Local uploads
media/
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Extend the base Python image
# See https://hub.docker.com/_/python for version options
# N.b., there are many options for Python images. We used the plain
# version number in the pilot. YMMV. See this post for a discussion of
# some options and their pros and cons:
# https://pythonspeed.com/articles/base-image-python-docker-images/
FROM python:3.9

# Give ourselves some credit
LABEL maintainer "DataMade <[email protected]>"

# Add the NodeSource PPA
# (see: https://github.com/nodesource/distributions/blob/master/README.md)
RUN curl -sL https://deb.nodesource.com/setup_12.x | bash -

# Install any additional OS-level packages you need via apt-get. RUN statements
# add additional layers to your image, increasing its final size. Keep your
# image small by combining related commands into one RUN statement, e.g.,
#
RUN apt-get update && \
apt-get install -y --no-install-recommends gettext postgresql-client nodejs gdal-bin postgis
#
# Read more on Dockerfile best practices at the source:
# https://docs.docker.com/develop/develop-images/dockerfile_best-practices
# RUN apt-get install -y --no-install-recommends postgresql-client nodejs gdal-bin

# Inside the container, create an app directory and switch into it
RUN mkdir /app
WORKDIR /app

# Copy the requirements file into the app directory, and install them. Copy
# only the requirements file, so Docker can cache this build step. Otherwise,
# the requirements must be reinstalled every time you build the image after
# the app code changes. See this post for further discussion of strategies
# for building lean and efficient containers:
# https://blog.realkinetic.com/building-minimal-docker-containers-for-python-applications-37d0272c52f3
COPY ./requirements.txt /app/requirements.txt
RUN pip install --no-cache-dir -r requirements.txt

# Install Node requirements
COPY ./package.json /app/package.json
RUN npm install

# Copy the contents of the current host directory (i.e., our app code) into
# the container.
COPY . /app

# Add a bogus env var for the Django secret key in order to allow us to run
# the 'collectstatic' management command
ENV DJANGO_SECRET_KEY 'foobar'
# Add a bogus env var for Debug to make sure that Django compressor can run
ENV DJANGO_DEBUG 'False'

# Build static files into the container
RUN python manage.py collectstatic --noinput
RUN python manage.py compress
Loading