These are steps to follow for setting up a test website for user testing. Create a heroku app from your server side rendered website.
This is useful for when you have a part of a website that is going through a large overhaul.
- Create a heroku account
- Install the heroku cli
- Login to heroku with the cli
- now you can create your heroku app
- heroku commands to review
heroku create- This will set up heroku to accept code
- You can create a specific name instead of using the auto generated names
- ex:
heroku create app-name-thing
- ex:
get push heroku main- this will put the code into the project
heroku ps:scale web=1- this will check that something's live
heroku open- open up the running app
heroku logs- check all logs
- add
--tailfor just the last few logs
Procfile- the procfile is kind of like the scripts in package.json in a npm project
- After installing the app's dependencies locally, you can the app by running the Procfile
- install python dependencies with
pip install -r requirements.txt - check installed files with
pip list
- install python dependencies with
- Do any other setup that you need to do to run your python app
- ie django you might need to run
python manage.py collectstaticto use local assets
- ie django you might need to run
- then run the local environment with
heroku local web- or on windows run
heroku local web -f Procfile.windows - this will set up a local heroku web server on localhost:5000
- Local changes need to be pushed to heroku
- this can be things like installing new packages
- Add your packages and made edits
then run
heroku localto test that they work
- add and commit with git
- then run
git push heroku main - verify that the site is live with
heroku open
You can store encryption keys and other external resource addresses in config vars
- set config vars with the following syntax
- example:
heroku config:set TIMES=1
- example:
- then view the config vars with
heroku config