-
Notifications
You must be signed in to change notification settings - Fork 7
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
Setup update and API Token Authentication #137
Changes from all commits
f1f03a8
7026c1f
0405c32
9968e4f
80f347f
704117a
b2215cd
4e286f6
b43c815
bed0379
0a1d3e9
fb951e4
1c73c2f
4162777
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
SENSORSAFRICA_CELERY_SLACK_WEBHOOK="" | ||
SENSORSAFRICA_CELERY_SLACK_WEBHOOK_FAILURES_ONLY="" | ||
SENSORSAFRICA_DATABASE_URL="" | ||
SENSORSAFRICA_DEBUG="" | ||
SENSORSAFRICA_FLOWER_ADMIN_PASSWORD="" | ||
SENSORSAFRICA_FLOWER_ADMIN_USERNAME="" | ||
SENSORSAFRICA_RABBITMQ_URL="" | ||
SENSORSAFRICA_SENTRY_DSN="" |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,8 +26,12 @@ CREATE DATABASE sensorsafrica; | |
CREATE USER sensorsafrica WITH ENCRYPTED PASSWORD 'sensorsafrica'; | ||
GRANT ALL PRIVILEGES ON DATABASE sensorsafrica TO sensorsafrica; | ||
``` | ||
|
||
- Migrate the database; `python manage.py migrate` | ||
- Create super user for admin login; `python manage.py createsuperuser` | ||
username: `sensorsafrica` | ||
email: blank | ||
password: `sensorsafrica` | ||
Comment on lines
+31
to
+33
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Must username/password be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not really. Let's say it a convention. Any thoughts? |
||
|
||
- Run the server; `python manage.py runserver` | ||
|
||
### Docker | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,15 +2,20 @@ version: '3.3' | |
|
||
services: | ||
rabbitmq: | ||
image: rabbitmq:3.5.1 | ||
image: rabbitmq:3.12.7-management | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is 3.12 the version used in PROD as well? |
||
ports: | ||
- 4369:4369 | ||
- 5672:5672 | ||
- 25672:25672 | ||
- 15672:15672 | ||
- "5672:5672" | ||
# GUI port | ||
- "15672:15672" | ||
environment: | ||
- RABBITMQ_USERNAME=sensorsafrica | ||
- RABBITMQ_PASSWORD=sensorsafrica | ||
- RABBITMQ_DEFAULT_USER=sensorsafrica | ||
- RABBITMQ_DEFAULT_PASS=sensorsafrica | ||
healthcheck: | ||
test: [ "CMD-SHELL", "rabbitmq-diagnostics -q ping" ] | ||
interval: 10s | ||
timeout: 5s | ||
retries: 2 | ||
|
||
postgres: | ||
image: postgres:13.7 | ||
ports: | ||
|
@@ -21,15 +26,15 @@ services: | |
- POSTGRES_DB=sensorsafrica | ||
volumes: | ||
- postgres_data:/var/lib/postgresql/data/ | ||
|
||
api: | ||
build: | ||
context: . | ||
environment: | ||
SENSORSAFRICA_DATABASE_URL: postgres://sensorsafrica:sensorsafrica@postgres:5432/sensorsafrica | ||
SENSORSAFRICA_READ_DATABASE_URLS: postgres://sensorsafrica:sensorsafrica@postgres:5432/sensorsafrica | ||
SENSORSAFRICA_RABBITMQ_URL: amqp://sensorsafrica:sensorsafrica@rabbitmq// | ||
SENSORSAFRICA_FLOWER_ADMIN_USERNAME: admin | ||
SENSORSAFRICA_FLOWER_ADMIN_PASSWORD: password | ||
SENSORSAFRICA_DATABASE_URL: ${SENSORSAFRICA_DATABASE_URL} | ||
SENSORSAFRICA_RABBITMQ_URL: ${SENSORSAFRICA_RABBITMQ_URL} | ||
SENSORSAFRICA_FLOWER_ADMIN_USERNAME: ${SENSORSAFRICA_FLOWER_ADMIN_USERNAME} | ||
SENSORSAFRICA_FLOWER_ADMIN_PASSWORD: ${SENSORSAFRICA_FLOWER_ADMIN_PASSWORD} | ||
Comment on lines
+34
to
+37
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there a default for any of these? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Was previously.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This will be updated in the README for local setup. |
||
DOKKU_APP_NAME: sensorsafrica | ||
depends_on: | ||
- postgres | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -113,13 +113,6 @@ | |
|
||
DATABASES = {"default": dj_database_url.parse(DATABASE_URL), } | ||
|
||
READ_DATABASE_URLS = os.getenv("SENSORSAFRICA_READ_DATABASE_URLS", DATABASE_URL).split(",") | ||
|
||
for index, read_database_url in enumerate(READ_DATABASE_URLS,start=1): | ||
DATABASES[f"read_replica_{index}"] = dj_database_url.parse(read_database_url) | ||
|
||
DATABASE_ROUTERS = ["sensorsafrica.router.ReplicaRouter", ] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍🏽 |
||
|
||
# Password validation | ||
# https://docs.djangoproject.com/en/1.10/ref/settings/#auth-password-validators | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why 2 ways of upgrading
pip
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏽 the upgrade flag will be removed to just install the setup tools