Skip to content

Commit

Permalink
Add cookiecutter generation on demo command
Browse files Browse the repository at this point in the history
  • Loading branch information
danielsousaio committed Apr 26, 2021
1 parent 614b66d commit 23244b2
Show file tree
Hide file tree
Showing 72 changed files with 2,580 additions and 132 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,16 @@ Our template is on the latest React Native and React versions.
},
```

### Cookiecutter

[Github](https://github.com/cookiecutter/cookiecutter)

Installation

```sh
pip install --user cookiecutter
```

## Getting started

```sh
Expand Down
10 changes: 10 additions & 0 deletions cookiecutter.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
default_context:
project_name: "demo"
project_slug: "demo"
project_generated_name: "demo"
owner_email: "[email protected]"
custom_domain: "demo.botics.co"
repo_url: "https://github.com/crowdbotics/modules"
heroku_dyno_size: "free"
heroku_team: ""
is_mobile: "y"
1 change: 1 addition & 0 deletions demo/backend/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
postgres-data/
12 changes: 12 additions & 0 deletions demo/backend/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# In order to get .env approach working, you might copy this file. This file is read
# line by line by django-environ library (Refer to its documentation to more info).
# Each line is formed by KEY=VALUE where `KEY` is the configuration read by the
# settings.py file. You need to change the values after the `=` sign and can create
# new values by appending new variables at the end of the file.

DEBUG=1
HOST=localhost
PORT=8000
DATABASE_URL=postgres://postgres:<postgres_pwd>@postgres:5432/postgres
REDIS_URL=redis://redis:6379
SECRET_KEY=<random_string_goes_here>
6 changes: 6 additions & 0 deletions demo/backend/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
*.pyc
env/
.terraform
.env
staticfiles/
postgres-data/
28 changes: 28 additions & 0 deletions demo/backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
FROM ubuntu:bionic

ENV LANG C.UTF-8
ARG DEBIAN_FRONTEND=noninteractive
# Allow SECRET_KEY to be passed via arg so collectstatic can run during build time
ARG SECRET_KEY

# libpq-dev and python3-dev help with psycopg2
RUN apt-get update \
&& apt-get install -y python3.7-dev python3-pip libpq-dev curl \
&& apt-get clean all \
&& rm -rf /var/lib/apt/lists/*
# You can add additional steps to the build by appending commands down here using the
# format `&& <command>`. Remember to add a `\` at the end of LOC 12.
# WARNING: Changes to this file may cause unexpected behaviors when building the app.
# Change it at your own risk.

WORKDIR /opt/webapp
COPY . .
RUN pip3 install --no-cache-dir -q 'pipenv==2018.11.26' && pipenv install --deploy --system
RUN python3 manage.py collectstatic --no-input

# Run the image as a non-root user
RUN adduser --disabled-password --gecos "" django
USER django

# Run the web server on port $PORT
CMD waitress-serve --port=$PORT demo.wsgi:application
30 changes: 30 additions & 0 deletions demo/backend/Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
[[source]]
verify_ssl = true
url = "https://pypi.org/simple"
name = "pypi"

[dev-packages]

[requires]
python_version = "3.7"

[packages]
cryptography = "<3.4"
django = "~=2.2.19"
"boto3" = "~=1.17.44"
django-environ = "~=0.4.5"
django-storages = "~=1.11"
psycopg2 = "~=2.8.6"
waitress = "~=1.4.4"
whitenoise = "~=5.2.0"
djangorestframework = "~=3.12.4"
django-bootstrap4 = "~=2.3.1"
django-allauth = "~=0.44.0"
django-rest-auth = "~=0.9.5"
django-extensions = "~=3.1.1"
packaging = "*"
drf-yasg = "~=1.20.0"
# fcm-django is used for mobile notifications. It can be removed if unneeded.
fcm-django = "~=0.3.7"
pyyaml = "~=5.4.1"
pillow = "~=8.2.0"
Loading

0 comments on commit 23244b2

Please sign in to comment.