Unable to run the project built in django 3 on django 2.2

Hi ,

I was using django 3 for development and wanted to migrate it to production. But :frowning: when I started configuring my project with the production db (oracle) then the admin page stopped working (ambiguous column error). Upon searching I found that there was no support of oracle from django 3 and had to downgrade to django2.2

Now my project is built in django3 and I uninstalled django3 from my venv and installed django2.2 on my venv. But when I try to open my site (apache<->mod_wsgi) I get the following error on opening the page:

ImportError at /admin/

cannot import name 'RemovedInDjango30Warning' from 'django.utils.deprecation' (/scratch/python3env/lib/python3.7/site-packages/django/utils/deprecation.py)

and in the browser it shows
Django Version: 3.0.8
Python Version: 3.7.8

while from pip I have installed django2.2 and ./manage.py --version shows 2.2.

So I have 2 questions:

  1. How can I resolve the error: RemovedInDjango30Warning
  2. Is it okay if browser shows different version of django? How can I completely remove the 3.0.8 django reference.

I think the easiest way to try and clean this up would be to create a new venv for Django 2.2, and make sure that your Apache / mod_wsgi configuration is pointing to it, rather than your current venv.

It’s true that as of Django 3.0, official support for Oracle databases was removed from the core Django codebase due to a lack of resources to maintain it. However, there are still ways to use Oracle databases with Django by using third-party packages such as django-oraclepool, django-cx-oracle, or django-pyodbc-azure.

It’s also possible that the issue you encountered with the admin page could be related to the database schema or data migrations. It’s a good practice to run Django’s database migration commands before deploying to production to ensure that your database schema is up-to-date and matches your Django models.

That is not an accurate statement.

See the Oracle Notes in the Django 4.2 docs.