Skip to content
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 PostgreSQL #9

Merged
merged 2 commits into from
Jan 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,6 @@ venv.bak/

# mypy
.mypy_cache/

# vscode configs
.vscode
3 changes: 3 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@ url = "https://pypi.org/simple"
verify_ssl = true

[dev-packages]
pylint = "*"
autopep8 = "*"

[packages]
django = "==2.2.6"
psycopg2 = "*"

[requires]
python_version = "3.8"
Expand Down
106 changes: 104 additions & 2 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 7 additions & 2 deletions projectsplatform/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@


# SECURITY WARNING: don't run with debug turned on in production!
SECRET_KEY = 'dulwepf_b#@eh19w)==v+pxvw$u$2gbxpwoevmzg)h-pl1mded'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kellim was right, it doesn't run without the secret key.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmhm, ok. We should still not have have the secret_key on Github, but ideally in an env variable. Same for the database details below.

Would you be comfortable setting that up, @nurmerey, or would you prefer I do that?
Considering this is only for local development at this point, I'm fine keeping it for now such that you are able to move on. I'd create a story to switch the project over to use environment variables though, before we deploy it.

Let me know what you prefer, @nurmerey? 😃

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@natsteinmetz Would python-dotenv be acceptable for using in development? https://preslav.me/2019/01/09/dotenv-files-python/

Copy link
Contributor Author

@nurmerey nurmerey Jan 13, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@natsteinmetz I have created a separate story for the secret key and db details - #14

DEBUG = True

ALLOWED_HOSTS = []
Expand Down Expand Up @@ -73,8 +74,12 @@

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'scprojects',
'USER': 'scadmin',
'PASSWORD': '',
'HOST': 'localhost',
'PORT': '5432',
}
}

Expand Down