Skip to content

imamdigmi/django-elephantsql-demo

Repository files navigation

Django + ElephantSQL

DaaS (Data as a Service) using Django and ElephantSQL demo

ElephantSQL Portal

Setup

Activate virtual envirounment

pipenv shell

Install dependencies

pipenv install

Migrate Schema

python manage.py makemigrations && python manage.py migrate

Create Superuser for accessing Django Admin

python manage.py createsuperuser

Sample configuration

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql_psycopg2',
        'NAME': 'database_name',
        'USER': 'database_username',
        'PASSWORD': 'database_password',
        'HOST': 'databast_host',
        'PORT': 'database_port',
    }
}

Run!

python manage.py runserver

Navigate to localhost:8000


Deploy to Heroku

If you wanna deploy this simple app to Heroku, follow this step

Create Heroku instance

heroku create

Deploy to heroku

git push heroku master

Open app on heroku

heroku open

Or, if you wanna run locally

If you’re on Microsoft Windows system, run this:

heroku local web -f Procfile.windows

If you’re on a Unix system, just use the default Procfile by running:

heroku local web

Open 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

About

DaaS using Django and ElephantSQL demo

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published