Skip to content
George Schizas edited this page Dec 4, 2019 · 2 revisions

This page details the process to deploy this application to heroku

This assumes that:

  1. You have already made a heroku account
  2. 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)
  3. You have created a new reddit application.

  1. Click on the deploy button.
  2. Click on "Log in"
  3. 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/
  4. Choose where you want the datacenter to be (US or Europe)
  5. Fill in the configuration variables:
    1. 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
    2. 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())'.
    3. 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
    4. REDDIT_OAUTH_CLIENT_ID: You get that from the app page you have created.
    5. REDDIT_OAUTH_CLIENT_SECRET: You get that from the app page you have created.
    6. REDDIT_OAUTH_REDIRECT_URL: Use the website url and add "authorize_callback", e.g. https://reddit-yoursubreddit-survey-2020.herokuapp.com/authorize_callback
Clone this wiki locally