You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
5 years ago | |
|---|---|---|
| contacts_api | 5 years ago | |
| django_rest_api | 5 years ago | |
| .README.md.swp | 5 years ago | |
| .gitignore | 5 years ago | |
| Procfile | 5 years ago | |
| README.md | 5 years ago | |
| manage.py | 5 years ago | |
| requirements.txt | 5 years ago | |
README.md
Deployment Instructions
Local Installation
Create Local Repo
- Fork this repo and then clone the fork to your local computer
- Make sure you are using a
venvpython environment- e.g.
source ~/ga-env/bin/active - create a new environment and use that
- e.g.
- Install dependencies with
python -m pip install -r requirements.txt
Postgres
- Open app Postgres App
- From menu icon, next to "New Server", choose "Start" and then "Open Postgres"
- Double click on a sub-database and, in the terminal window that opens, run
CREATE DATABASE django_contactsto create the sub database
In Terminal
- Run
python manage.py migrateto set up the tables in the DB - Run
python manage.py runserverto start the server
Deploy to Heroku
- Run
heroku createto create heroku app - Copy url of heroku app created (e.g.
blooming-fjord-06511.herokuapp.com) and add it toALLOWED_HOSTSindjango_rest_api/settings.pye.g.ALLOWED_HOSTS = ['localhost', 'desolate-thicket-29906.herokuapp.com'] - add/commit to git. Then run
git push heroku master - run
heroku run bashto enter bash and then runpython manage.py migrateandpython manage.py createsuperuser(follow prompts) and thenexit