S
S
Sergey Nizhny Novgorod2016-02-11 03:55:37
Django
Sergey Nizhny Novgorod, 2016-02-11 03:55:37

How to fix 500 error when starting Django?

Hello.
According to this guide , I installed postgreSQL on cent OS. As a result the situation turns out:
1) python manage.py makemigrations - works.
2) python manage.py migration - works.
3) python manage.py runsever 0.0.0.0:8080 - works.
But when I open the IP-VPS:8080 site, I get a server error 500 error in my face

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql',
        'NAME': 'sitedb',
        'USER': 'user',
        'PASSWORD': 'password',
        'HOST': 'localhost',
        'PORT': '',
    }
}

DEBUG = False

ALLOWED_HOSTS = [
    '*',   
    ]

________________________________________________
If you return SQ3lite db, then everything works correctly:
DEBUG = False

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
    }
}

DEBUG = False

ALLOWED_HOSTS = [
    '*',   
    ]

update.
Turned Debug = TRUE. The main page requested data that had not yet been created in the new database. Those. the database works, but you need to add the necessary materials through the admin panel.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question