Skip to content

Commit

Permalink
Configure Windy stations (#20)
Browse files Browse the repository at this point in the history
Configure Windy stations

- add Windy Django app
- upgrade dependencies
- improved README.md
  • Loading branch information
ysavary committed Aug 7, 2022
1 parent f6d706c commit b186724
Show file tree
Hide file tree
Showing 14 changed files with 194 additions and 122 deletions.
3 changes: 3 additions & 0 deletions .env.localhost.template
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ ALLOWED_HOSTS=localhost

STATIC_URL=/django-static/

DB_URL=postgres://postgres:postgres@localhost:8016/winds
REDIS_URL=redis://localhost:8017/0

GOOGLE_CLIENT_SECRET=google-configs/google_client_secret.json

FACEBOOK_REDIRECT_URI=http://localhost:8000/user/facebook/oauth2callback
Expand Down
2 changes: 1 addition & 1 deletion .env.template
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ALLOWED_HOSTS=localhost
STATIC_URL=/django-static/

DB_URL=postgres://postgres:postgres@postgres:5432/winds
MONGODB_URL=mongodb://mongodb:27017/winds
REDIS_URL=redis://redis-auth:6379/0

GOOGLE_CLIENT_SECRET=google-configs/google_client_secret.json

Expand Down
52 changes: 36 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
winds.mobi - real-time weather observations
===========================================

[![DockerHub](https://img.shields.io/docker/cloud/automated/windsmobi/winds-mobi-admin)](https://cloud.docker.com/u/windsmobi/repository/docker/windsmobi/winds-mobi-admin)
[![Follow us on https://www.facebook.com/WindsMobi/](https://img.shields.io/badge/facebook-follow_us-blue)](https://www.facebook.com/WindsMobi/)

[winds.mobi](http://winds.mobi): Paraglider pilot, kitesurfer, check real-time weather conditions of your favorite spots
Expand All @@ -10,36 +9,57 @@ on your smartphone, your tablet or your computer.
winds-mobi-admin
--------------------

Django application to manage winds.mobi users and profiles
Django application to administrate winds.mobi:

### Requirements
- manage users and profiles
- configure Zermatt stations
- configure Windy stations

- python >= 3.6
- a database supported by [django](https://docs.djangoproject.com/en/2.2/ref/databases/)
- mongodb >= 3.0
### Dependencies

See [settings.py](https://github.com/winds-mobi/winds-mobi-admin/blob/master/winds_mobi_admin/settings.py)
- python 3.9 and poetry
- postgres
- redis

#### macOS
See [settings.py](https://github.com/winds-mobi/winds-mobi-admin/blob/main/winds_mobi_admin/settings.py)

### Run the project with docker compose (simple way)

Create a `.env` file from `.env.template` and, optionally, fill the missing secrets for Facebook and Google social
authentications.

- `docker compose --profile=application up --build`

### Run the project locally on macOS

#### Install dependencies

- `brew install libpq`
- `export PATH=/usr/local/opt/libpq/bin:$PATH`
- `export LDFLAGS="-I/usr/local/opt/openssl/include -L/usr/local/opt/openssl/lib"`

### Python environment
#### Python environment

- `poetry install`
- `poetry shell`

Create a `.env.localhost` file from `.env.localhost.template` and fill the missing secrets.

#### Create db schema

- `dotenv -f .env.localhost run python manage.py migrate`

- `pipenv install`
- `pipenv shell`
#### Start external services with docker compose

### Create db schema
Create a `.env` file from `.env.template`.

- `python manage.py migrate`
- `docker compose up`

### Run the server
#### Run the server

- `python manage.py runserver`
- `dotenv -f .env.localhost run python manage.py runserver 8006`

Licensing
---------

Please see the file called [LICENSE.txt](https://github.com/winds-mobi/winds-mobi-admin/blob/master/LICENSE.txt)
Please see the file called [LICENSE.txt](https://github.com/winds-mobi/winds-mobi-admin/blob/main/LICENSE.txt)
8 changes: 2 additions & 6 deletions docker-compose.yml → docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ services:
volumes:
- ./volumes/postgres:/var/lib/postgresql/data

redis:
image: redis:7.0.2
redis-auth:
image: redis:7.0.4
ports:
- "8017:6379"

Expand All @@ -33,17 +33,13 @@ services:
STATIC_URL: ${STATIC_URL}
DB_URL: ${DB_URL}
REDIS_URL: ${REDIS_URL}
MONGODB_URL: ${MONGODB_URL}
GOOGLE_CLIENT_SECRET: ${GOOGLE_CLIENT_SECRET}
FACEBOOK_REDIRECT_URI: ${FACEBOOK_REDIRECT_URI}
FACEBOOK_CLIENT_ID: ${FACEBOOK_CLIENT_ID}
FACEBOOK_CLIENT_SECRET: ${FACEBOOK_CLIENT_SECRET}
networks:
- default
- winds-mobi-providers

networks:
default:
name: winds-mobi-admin
winds-mobi-providers:
external: true
Loading

0 comments on commit b186724

Please sign in to comment.