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

encode domain into env var #390

Open
btbonval opened this issue Jan 13, 2015 · 0 comments
Open

encode domain into env var #390

btbonval opened this issue Jan 13, 2015 · 0 comments

Comments

@btbonval
Copy link
Member

domain is encoded into URLs in cases where it cannot be extracted by HTTP_REFERER like so:
https://github.com/FinalsClub/karmaworld/blob/master/karmaworld/apps/notes/tasks.py#L55-L56

ALLOWED_HOSTS could be used for this purpose, but we use a single code base across multiple servers (specifically staging and production), which makes file-based configuration bad for this.
https://github.com/FinalsClub/karmaworld/blob/master/karmaworld/settings/common.py#L22-L24

An easy solution might be to encode the domain as an environment variable, which can be configured on a per-instance basis (using foreman .env or Heroku config variables). This could be written into ALLOWED_HOSTS dynamically and could replace hard coded references to karmanotes.org as far above.

@btbonval btbonval self-assigned this Feb 26, 2015
@btbonval btbonval removed their assignment Apr 21, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant