Skip to content

Commit

Permalink
fresh up
Browse files Browse the repository at this point in the history
  • Loading branch information
BrittleFoot committed Mar 14, 2024
1 parent 5725466 commit 622e246
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 7 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
**/.env
1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ ADD requirements.txt /srv
RUN pip install --no-cache-dir -r /srv/requirements.txt

ADD src /srv
RUN rm -f /srv/.env
WORKDIR /srv


Expand Down
30 changes: 29 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,29 @@
# django_template
# django_template


## install

```bash
# in your virtual environment
pip install -U pip pip-tools

make deps
```

## run

```bash
# up database
docker-compose up -d

# run migrations
cd src && ./manage.py migrate

# run server
make start

```

## extra

See `Makefile` for more commands, or how to run any command if you don't have `make` installed.
4 changes: 1 addition & 3 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@
asttokens==2.4.1
# via stack-data
coverage[toml]==7.4.1
# via
# coverage
# pytest-cov
# via pytest-cov
decorator==5.1.1
# via ipython
executing==2.0.1
Expand Down
1 change: 1 addition & 0 deletions src/.env.dist
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
DATABASE_URL=postgres://postgres@localhost:5439/postgres
DEBUG=1
4 changes: 2 additions & 2 deletions src/app/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
DEBUG=(bool, False),
)

environ.Env.read_env(BASE_DIR / ".env.dist")
environ.Env.read_env(BASE_DIR / ".env")
environ.Env.read_env(BASE_DIR / ".env.dist")

# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/5.0/howto/deployment/checklist/
Expand All @@ -21,7 +21,7 @@

ALLOWED_HOSTS = ["*"]

if DEBUG or env("CORS_ALLOW_ALL_ORIGINS"):
if DEBUG or env("CORS_ALLOW_ALL_ORIGINS", default=False):
CORS_ALLOW_ALL_ORIGINS = True


Expand Down

0 comments on commit 622e246

Please sign in to comment.