-
Notifications
You must be signed in to change notification settings - Fork 1
Setup
George Schizas edited this page Dec 4, 2019
·
2 revisions
This page details the process to deploy this application to heroku
This assumes that:
- You have already made a heroku account
- You have already provisioned a database. You can use the free database, but if you are expecting more than 10k rows, you must use a paid tier. Be aware that the number of rows depends on the number of questions and the number of users you are expecting. The expected number of rows is users⨯questions+2⨯users. So, if you have 100 users and 50 questions, you should be expecting about 5200 rows (100⨯50=5000 rows for the questions and another 100+100=200 rows for the votes and receipts)
- You have created a new reddit application.
- Click on the deploy button.
- Click on "Log in"
- Choose an unique app name, for example reddit-YOUR_SUBREDDIT-survey-CURRENT_YEAR. This is going to be the url of your site, e.g. https://reddit-yoursubreddit-survey-2020.herokuapp.com/
- Choose where you want the datacenter to be (US or Europe)
- Fill in the configuration variables:
- DATABASE_URL: The URI of the database you have provisioned (created), e.g. postgres+pg8000://USERNAME:A_VERY_LONG_PASSWORD@SERVER_NAME.SOMETHING.compute.amazonaws.com:5432/DATABASE_NAME. Be sure to add the "pg8000" bit
-
FLASK_SECRET_KEY: You can leave this empty (it will be automatically generated) or use any sufficiently random string. Try
python -c 'import base64,os;print(base64.b64encode(os.urandom(48)).decode())'
. -
QUESTIONNAIRE_URL: Use the URL of the questionnaire you have uploaded to your subreddit's wiki (but add a
.json
after it). For example, https://www.reddit.com/r/YOUR_SUBREDDIT/wiki/QUESTIONNAIRE.json - REDDIT_OAUTH_CLIENT_ID: You get that from the app page you have created.
- REDDIT_OAUTH_CLIENT_SECRET: You get that from the app page you have created.
- REDDIT_OAUTH_REDIRECT_URL: Use the website url and add "authorize_callback", e.g. https://reddit-yoursubreddit-survey-2020.herokuapp.com/authorize_callback