Skip to content

Commit

Permalink
Merge pull request #274 from maltaesousa/upgrade
Browse files Browse the repository at this point in the history
update django
  • Loading branch information
maltaesousa authored Oct 26, 2021
2 parents 21da13a + 9d1de79 commit 6dd2c94
Show file tree
Hide file tree
Showing 11 changed files with 507 additions and 596 deletions.
36 changes: 35 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,41 @@ CREATE EXTENSION postgis;
CREATE SCHEMA geoshop AUTHORIZATION geoshop;
```

### Backend
### Backend with docker

Create an .env.local based on .env.sample, then build:

```powershell
cd back
docker build -t geoshop_api --build-arg ENV_FILE=.env.local .
```

Now you can run it with:

```powershell
docker run -d --rm --name geoshop --env-file=.env.local -p 8000:8000 -v ${PWD}:/app/geoshop_back geoshop_api gunicorn --reload wsgi -b :8000
```

Run tests:

```powershell
docker run --rm --env-file=.env.local -v ${PWD}:/app/geoshop_back geoshop_api python manage.py test api
```

Make messages for translation:

```powershell
docker run --rm --env-file=.env.local -v ${PWD}:/app/geoshop_back:rw geoshop_api python manage.py makemessages -l fr
```

Stop the server:
```powershell
docker stop geoshop
```

### Backend without docker on windows

> :warning: **No longer maintained**: Installing GDAL in windows is really painfull, use docker for backend.
Install the app. If you want your `venv` to be inside your project directory, you need to set `PIPENV_VENV_IN_PROJECT` environment variable, otherwise it'll go to your profile, if you want `DEBUG` to be enabled, change it in `settings.py` file but never commit it with debug enabled:

Expand Down
1 change: 0 additions & 1 deletion back/.env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ FRONT_URL=localhost:4200
FRONT_HREF=/geoshop
FRONT_PROTOCOL=http
CSRF_COOKIE_DOMAIN=subdomain.example.com
GDAL_WHL=
LOGGING_LEVEL=DEBUG
SECRET_KEY=GenerateOneSecretKey
ADMIN_PASSWORD=Test1234
Expand Down
1 change: 1 addition & 0 deletions back/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ __pycache__/
local_settings.py

.env
.env.local
.env.dev
.env.prod
.env.prepub
Expand Down
8 changes: 4 additions & 4 deletions back/Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ autopep8 = "*"
pylint-django = "*"

[packages]
django = {version = "<3.0.9"}
djangorestframework = {version = "==3.11.0"}
django = "==3.2.8"
djangorestframework = "==3.12.4"
markdown = "*"
django-filter = "*"
djangorestframework-gis = "*"
psycopg2 = "*"
psycopg2 = "==2.8.6"
django-money = "*"
djangorestframework-simplejwt = "*"
djangorestframework-simplejwt = "==5.0.0"
django-allauth = "*"
django-cors-headers = "*"
python-dotenv = "*"
Expand Down
511 changes: 265 additions & 246 deletions back/Pipfile.lock

Large diffs are not rendered by default.

Loading

0 comments on commit 6dd2c94

Please sign in to comment.