Skip to content
This repository has been archived by the owner on Jan 10, 2021. It is now read-only.

Commit

Permalink
Remove usage of .env file for local dev
Browse files Browse the repository at this point in the history
  • Loading branch information
poblouin committed Dec 19, 2018
1 parent daddd1c commit 0a1549b
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 7 deletions.
67 changes: 67 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
// {
// "name": "Python: Current File (Integrated Terminal)",
// "type": "python",
// "request": "launch",
// "program": "${file}",
// "console": "integratedTerminal"
// },
{
"name": "Python: Attach",
"type": "python",
"request": "attach",
"port": 8000,
"host": "localhost"
},
// {
// "name": "Python: Module",
// "type": "python",
// "request": "launch",
// "module": "enter-your-module-name-here",
// "console": "integratedTerminal"
// },
{
"name": "Python: Django",
"type": "python",
"request": "launch",
"program": "${workspaceFolder}/manage.py",
"console": "integratedTerminal",
"args": [
"runserver",
"--noreload",
"--nothreading"
],
"django": true,
"env": {
"DJANGO_SETTINGS_MODULE": "config.settings.local"
}
},
// {
// "name": "Python: Flask",
// "type": "python",
// "request": "launch",
// "module": "flask",
// "env": {
// "FLASK_APP": "app.py"
// },
// "args": [
// "run",
// "--no-debugger",
// "--no-reload"
// ],
// "jinja": true
// },
// {
// "name": "Python: Current File (External Terminal)",
// "type": "python",
// "request": "launch",
// "program": "${file}",
// "console": "externalTerminal"
// }
]
}
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"python.pythonPath": "env/bin/python"
}
6 changes: 1 addition & 5 deletions config/settings/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,7 @@
# MANAGER CONFIGURATION
# ------------------------------------------------------------------------------
# See: https://docs.djangoproject.com/en/dev/ref/settings/#admins
ADMINS = (
("""Pierre-Olivier Blouin""", '[email protected]'),
)
ADMINS = ()

# See: https://docs.djangoproject.com/en/dev/ref/settings/#managers
MANAGERS = ADMINS
Expand Down Expand Up @@ -182,8 +180,6 @@
# Django REST Framework Simple JWT config
# ------------------------------------------------------------------------------
SIMPLE_JWT = {
'SIGNING_KEY': env('DJANGO_SECRET_KEY'),

'AUTH_HEADER_TYPES': ('Token',),
'USER_ID_FIELD': 'id',
'USER_ID_CLAIM': 'user_id',
Expand Down
5 changes: 3 additions & 2 deletions config/settings/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'budgetme',
'USER': env.str('POSTGRES_USER_DEBUG'),
'PASSWORD': env.str('POSTGRES_PASSWORD_DEBUG'),
'USER': 'budgetme',
'PASSWORD': 'budgetme',
'HOST': 'localhost',
'PORT': '5432',
}
Expand Down Expand Up @@ -39,3 +39,4 @@

SIMPLE_JWT['ACCESS_TOKEN_LIFETIME'] = datetime.timedelta(days=7)
SIMPLE_JWT['REFRESH_TOKEN_LIFETIME'] = datetime.timedelta(days=7)
SIMPLE_JWT['SIGNING_KEY'] = SECRET_KEY
1 change: 1 addition & 0 deletions config/settings/production.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,3 +126,4 @@

SIMPLE_JWT['ACCESS_TOKEN_LIFETIME'] = datetime.timedelta(minutes=30)
SIMPLE_JWT['REFRESH_TOKEN_LIFETIME'] = datetime.timedelta(days=1)
SIMPLE_JWT['SIGNING_KEY'] = env('DJANGO_SECRET_KEY')

0 comments on commit 0a1549b

Please sign in to comment.