Django apps :
1) ftl - simle api endpoint to fetch user
2) auth - override basic auth of django rest
> git clone https://github.com/NishantGhanate/webdev
> cd webdev
> virtualenv venv
> venv\Scripts\activate
> pip install -r requirements.txt
from django.core.management.utils import get_random_secret_key
get_random_secret_key()
'[GENERATED SECRET KEY]'
Simply create a .env text file on your repository’s root directory where manage.py exists , then paste GENERATED SECRET KEY :
DEBUG=True
ALLOWED_HOSTS=127.0.0.1,localhost
SECRET_KEY=+jfvhj1(r@................
DB_HOST = 127.0.0.1
DB_NAME = test
DB_USER = root
DB_PASSWORD = root
DB_PORT = 3306
> python manage.py runserver
> Create app in Heroku
> Connect via Github add git repo & branch
> Deploy Brach
Platform | URL |
---|---|
Heroku | https://webdevdjango.herokuapp.com/ |
Check project has ( runtime.txt , procfile ) and correct content runtime.txt procfile
> heroku login
> heroku apps
- <your_heroku_apps>
- webdevdjango
> heroku config:set DISABLE_COLLECTSTATIC=1 --app webdevdjango