Hi, I got 2 python apps with the same git code base and 1 of them keeps giving a 500 Server error if you try and do anything that accesses the database. My settings.py file contains this database.
DATABASES = {
241 'default': {
242 'ENGINE': 'django.db.backends.mysql',
243 'NAME': 'conceptpyrota$customerservice_20220628',
244 'USER': 'conceptpyrota',
245 'PASSWORD': xxxxxxx',
246 'HOST': 'conceptpyrota.mysql.pythonanywhere-services.com',
247 'OPTIONS': {
248 "init_command": "SET sql_mode='STRICT_TRANS_TABLES'",
249 }
250 }
251 }
I can verify this 100% as I do a print and when i do a python manage.py command, it displays the database as above. However, in the server error log, it seems to be trying to access a different, older database, which has been deleted.
django.db.utils.OperationalError: (1049, "Unknown database 'conceptpyrota$callcenter_20220616'")
This is the previous database I was using, now deleted. What is going on here? Is there some kind of caching issue? I tried deleting the settings.pyc file and it didn''t do anything. So at the moment I have an app that fails to work, except show me the landing page.
Any suggestions?
Edit: Just to add to my own post, it seems the html being served is not the same as in the folder. I even looked with vi and it's different. So it seems the web app is using some type of cache or something is really wrong. But I can't tell.