Django AWS ElasticBeanstalk Deploy- error deterministic=True requires SQLite 3.8.3 or higher

Im trying to deploy my application my EB status it returned green, so it's working

So, i deployed my application in my local venv i did python make migrations python migrate eb deploy and eb status

the helth returned green so its working, but when i enter the web site it returns deterministic=True requires SQLite 3.8.3 or higher

Note: Locally it works just fine

django.config:

option_settings:
    aws:elasticbeanstalk:container:python:
        WSGIPath: store.wsgi:application

commands that i ran to make my project:

python manage.py mamemigrations
python manage.py migrate 
python manage.py createsuperuser
eb init python-3.8 Naameofmyproject
eb create Nameofmyproject

Requirments.txt:

asgiref==3.5.0
autopep8==1.6.0
certifi==2021.10.8
charset-normalizer==2.0.12
dj-database-url==0.5.0
Django==4.0.3
django-anymail==8.5
django-autoslug==1.9.8
django-crispy-forms==1.14.0
django-environ==0.8.1
django-model-utils==4.2.0
idna==3.3
Pillow==9.1.0
psycopg2-binary==2.9.3
pycodestyle==2.8.0
python-dateutil==1.5
requests==2.27.1
six==1.16.0
sqlparse==0.4.2
stripe==2.70.0
toml==0.10.2
tzdata==2022.1
urllib3==1.26.9

settings.py:

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': BASE_DIR / 'db.sqlite3',
    }
}


STATIC_URL = '/static/'
STATIC_ROOT = BASE_DIR / 'static'
STATICFILES_DIRS = [BASE_DIR / 'templates/static']

MEDIA_URL = '/media/'
MEDIA_ROOT = BASE_DIR / 'media'

CART_SESSION_ID = 'cart'
AUTH_USER_MODEL = 'account.UserBase'
LOGIN_REDIRECT_URL = '/account/dashboard'
LOGIN_URL = '/account/login/'

EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'

DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'

Step zero: The obvious - make sure your project works, and that the database has the updated migrations.

Then follow these steps:

  1. Log into the cloud of where you're trying to deploy your application. Click "resources", attach a postgres database if you haven't already.

  2. Click on the database resource, view the credentials.

You'll be provided with credentials such as Host, Database, User, Port, Password, URI.

enter image description here

This is what I got from Heroku. I'm hiding my credentials for security reasons.

  1. Uncomment the database format for SQLite in your settings.py file and use the Oracle/postgres database format like so: enter image description here

I'm copying and pasting a sample from the django manual (that you can copy and paste into the settings.py file):

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.oracle',
        'NAME': 'xe',
        'USER': 'a_user',
        'PASSWORD': 'a_password',
        'HOST': 'dbprod01ned.mycompany.com',
        'PORT': '1540',
    }
}

Set the ENGINE field to:

'ENGINE': 'django.db.backends.postgresql',

Source: https://docs.djangoproject.com/en/4.0/ref/databases/

Populate the fields with the correct values that have been provided by the postgres resource on the cloud.

  1. Ensure you have "gunicorn" installed and create a "procfile" in the same directory level as the requirements.txt file.

You need one line of text in the procfile:

web: gunicorn [PROJECT NAME].wsgi

Your project name will be found in wsgi.py as [PROJECT NAME].settings enter image description here

IMPORTANT: After changing the database in the settings.py script, delete your old migrations (they belong to SQLite). Right click the migrations folder, reveal contents, delete everything except for the __ init __.py file.

Then create the new migrations which will now be for the postgres database:

python manage.py makemigrations

Now deploy again.

Back to Top