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

LOCAL_HOST is not optional #96

Open
ObliviousParadigm opened this issue Jun 14, 2020 · 1 comment
Open

LOCAL_HOST is not optional #96

ObliviousParadigm opened this issue Jun 14, 2020 · 1 comment

Comments

@ObliviousParadigm
Copy link
Contributor

Is your feature request related to a problem? Please describe.
The README.md file specifies that adding LOCAL_HOST is optional but I am facing an issue on my desktop. I can't run the code without adding localhost.

Describe the solution you'd like
I have fixed this issue. I have already sent a PR. #95

@kalumewakitsao
Copy link

This could be fixed by using os.getenv i.e.

import os

ALLOWED_HOSTS = [
    '127.0.0.1',
    'tutorialdb.pythonanywhere.com',
    'tutorialdb-app.herokuapp.com'
    'tutorialdb-app.herokuapp.com',
]

LOCAL_HOST = os.getenv('LOCAL_HOST')

if LOCAL_HOST:
    ALLOWED_HOSTS.append(LOCAL_HOST)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants