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

Feature/webapp #5

Open
wants to merge 17 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
111 changes: 111 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,112 @@
# Django #
*.log
*.pot
*.pyc
__pycache__
db.sqlite3

# Backup files #
*.bak

# just going to ignore the whole .idea folder
.idea/

# File-based project format
*.iws

# IntelliJ
out/

# JIRA plugin
atlassian-ide-plugin.xml

# Python #
*.py[cod]
*$py.class

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

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

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

# Jupyter Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery
celerybeat-schedule.*

# SageMath parsed files
*.sage.py

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

# mkdocs documentation
/site

# mypy
.mypy_cache/

# Sublime Text #
*.tmlanguage.cache
*.tmPreferences.cache
*.stTheme.cache
*.sublime-workspace
*.sublime-project

# sftp configuration file
sftp-config.json

# Package control specific files Package
Control.last-run
Control.ca-list
Control.ca-bundle
Control.system-ca-bundle
GitHub.sublime-settings

# Visual Studio Code #
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
.history
8 changes: 0 additions & 8 deletions .idea/.gitignore

This file was deleted.

5 changes: 0 additions & 5 deletions .idea/codeStyles/codeStyleConfig.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/inspectionProfiles/Project_Default.xml

This file was deleted.

8 changes: 0 additions & 8 deletions .idea/palguybuddydude.iml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/vcs.xml

This file was deleted.

6 changes: 6 additions & 0 deletions django-app/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# these can cause issues with the test runner when it is trying to collect the tests
*.pyc
**/__pycache__

# allows installing pipenv dependencies locally in a virtual environment
.venv
16 changes: 16 additions & 0 deletions django-app/.env.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# debug
DEBUG=True
DEBUG_EXTENSIONS=True

# list of allowed hosts
ALLOWED_HOSTS=127.0.0.1,localhost,0.0.0.0

# path to postgres server when running locally. This value overwritten in docker-compose.yml
POSTGRES_HOST=0.0.0.0
POSTGRES_PASSWORD=postgres
POSTGRES_DB=postgres
POSTGRES_USER=postgres
POSTGRES_PORT=5432

# django stuff
DJANGO_SECRET_KEY=SECRET_KEY_GOES_HERE
8 changes: 8 additions & 0 deletions django-app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# data for management commands
**/management/commands/data/

# media files location
app/media/

# static files location
app/static/
25 changes: 25 additions & 0 deletions django-app/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM python:3.11-slim as base
ENV PYTHONUNBUFFERED 1

# install pipenv and compilation dependencies
# https://cryptography.io/en/latest/installation/
RUN apt-get update && apt-get install -y build-essential libssl-dev libffi-dev python3-dev cargo
RUN pip install --upgrade pip pipenv

# install python dependencies
RUN mkdir /code
WORKDIR /code
COPY Pipfile /code
COPY Pipfile.lock /code
RUN pipenv install --dev --deploy --system

# install application into container
COPY . /code

# run application
EXPOSE 8000

WORKDIR /code/app

# this CMD is overridden by the command in docker-compose.yml for local development
CMD /code/bin/wait-for-it.sh db:5432 -- python /code/app/manage.py runserver 0.0.0.0:8000
19 changes: 19 additions & 0 deletions django-app/Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
django = "==5.0.2"
django-extensions = "==3.2.3"
psycopg2-binary = "==2.9.9"
stringcase = "==1.2.0"

[dev-packages]
pytest = "==8.0.0"
pytest-cov = "==4.1.0"
pytest-django = "==4.8.0"
factory-boy = "==3.3.0"

[requires]
python_version = "3.11.4"
Loading