0

Hello i built my first Django app and i tried to make it live using heroku. My app works fine locally. When i deployed it on heroku i get this error: "Application error An error occurred in the application and your page could not be served. If you are the application owner, check your logs for details."

I am really new to this. I dont know where to look for logs. I tried this tutorial to deploy the app. My code on github.

Any ideas?

# Database
# https://docs.djangoproject.com/en/2.0/ref/settings/#databases

db_from_env = dj_database_url.config(conn_max_age=500)
DATABASES['default'].update(db_from_env)
DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
    }

}

1 Answer 1

1

I had a look at your code on Github. These are the mistakes you have made

  1. You should rename Procfile.txt to Procfile
  2. You also have to change your DATABASES settings in your settings.py. You can have a look at this answer.

Hope that helps!

Sign up to request clarification or add additional context in comments.

2 Comments

Thank you very much for your answer. I followed the instructions but i am making something wrong with the databases settings and i get some errors. I edited the post. Please check the databases settings.
DATABASES['default'].update(db_from_env) should come after the DATABASES settings. You are actually updating the key of default with a new value.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.