{"action":"created","issue":{"url":"https://api.github.com/repos/hack4impact/flask-base/issues/112","repository_url":"https://api.github.com/repos/hack4impact/flask-base","labels_url":"https://api.github.com/repos/hack4impact/flask-base/issues/112/labels{/name}","comments_url":"https://api.github.com/repos/hack4impact/flask-base/issues/112/comments","events_url":"https://api.github.com/repos/hack4impact/flask-base/issues/112/events","html_url":"https://github.com/hack4impact/flask-base/issues/112","id":207831592,"number":112,"title":"account.register gets wrong url_for server address","user":{"login":"Mattpwinchester","id":20302042,"avatar_url":"https://avatars0.githubusercontent.com/u/20302042?v=3","gravatar_id":"","url":"https://api.github.com/users/Mattpwinchester","html_url":"https://github.com/Mattpwinchester","followers_url":"https://api.github.com/users/Mattpwinchester/followers","following_url":"https://api.github.com/users/Mattpwinchester/following{/other_user}","gists_url":"https://api.github.com/users/Mattpwinchester/gists{/gist_id}","starred_url":"https://api.github.com/users/Mattpwinchester/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mattpwinchester/subscriptions","organizations_url":"https://api.github.com/users/Mattpwinchester/orgs","repos_url":"https://api.github.com/users/Mattpwinchester/repos","events_url":"https://api.github.com/users/Mattpwinchester/events{/privacy}","received_events_url":"https://api.github.com/users/Mattpwinchester/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2017-02-15T15:13:29Z","updated_at":"2017-03-23T21:36:19Z","closed_at":null,"body":"After deploying the code base to an EC2 instance I have an email generation problem where the confirm_link = url_for('account.confirm', token=token, _external=True) is creating a url of: \r\n\r\n127.0.0.1:8000/account/confirm-account/<token>\r\n\r\nI tried setting the app.config['SERVER_NAME'] to the name of my server as seen here:\r\n\r\nhttp://stackoverflow.com/questions/12162634/where-do-i-define-the-domain-to-be-used-by-url-for-in-flask\r\n\r\nHowever, that didn't work. I did manage to get it to work though by turning off the _external=True flag and manually setting the name of the server as a variable. Just wondering if there was a better way to go about this (maybe defining the server name in Local?) or if I'm missing something to how this whole flask stack works. "},"comment":{"url":"https://api.github.com/repos/hack4impact/flask-base/issues/comments/288867798","html_url":"https://github.com/hack4impact/flask-base/issues/112#issuecomment-288867798","issue_url":"https://api.github.com/repos/hack4impact/flask-base/issues/112","id":288867798,"user":{"login":"abhisuri97","id":4992430,"avatar_url":"https://avatars3.githubusercontent.com/u/4992430?v=3","gravatar_id":"","url":"https://api.github.com/users/abhisuri97","html_url":"https://github.com/abhisuri97","followers_url":"https://api.github.com/users/abhisuri97/followers","following_url":"https://api.github.com/users/abhisuri97/following{/other_user}","gists_url":"https://api.github.com/users/abhisuri97/gists{/gist_id}","starred_url":"https://api.github.com/users/abhisuri97/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abhisuri97/subscriptions","organizations_url":"https://api.github.com/users/abhisuri97/orgs","repos_url":"https://api.github.com/users/abhisuri97/repos","events_url":"https://api.github.com/users/abhisuri97/events{/privacy}","received_events_url":"https://api.github.com/users/abhisuri97/received_events","type":"User","site_admin":false},"created_at":"2017-03-23T21:36:19Z","updated_at":"2017-03-23T21:36:19Z","body":"sorry change the line to\r\n\r\n`SERVER_NAME = os.environ.get('SERVER_NAME') or 'localhost:5000'`\r\n\r\nOR for a slightly more managable configuration\r\n\r\non line 59:\r\n\r\n`SERVER_NAME = 'localhost:5000'`\r\n\r\nsomewhere under `ProductionConfig` add\r\n\r\n`SERVER_NAME = os.environ.get('SERVER_NAME')`\r\n\r\ni think that should work. I don't recall whether `SERVER_NAME` will need `http://` in front of it...most likely not now that i think about it. "}}
{"actor":{"display_login":"abhisuri97"}}