DaaS (Data as a Service) using Django and ElephantSQL demo
Activate virtual envirounment
pipenv shellInstall dependencies
pipenv installMigrate Schema
python manage.py makemigrations && python manage.py migrateCreate Superuser for accessing Django Admin
python manage.py createsuperuserSample configuration
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'database_name',
'USER': 'database_username',
'PASSWORD': 'database_password',
'HOST': 'databast_host',
'PORT': 'database_port',
}
}python manage.py runserverNavigate to localhost:8000
If you wanna deploy this simple app to Heroku, follow this step
Create Heroku instance
heroku createDeploy to heroku
git push heroku masterOpen app on heroku
heroku openOr, if you wanna run locally
If you’re on Microsoft Windows system, run this:
heroku local web -f Procfile.windowsIf you’re on a Unix system, just use the default Procfile by running:
heroku local webOpen http://localhost:8000 with your web browser. You should see your app running locally.
Login to admin page, navigate to http://localhost:8000/admin insert username and password as follow :
Username : ayam Password : ayambakar
