mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2026-01-22 07:22:07 +01:00
Update upgrade.py
This commit is contained in:
@@ -1359,6 +1359,12 @@ class Upgrade:
|
||||
if items.find('SESSION_COOKIE_SECURE') > -1:
|
||||
SESSION_COOKIE_SECURE = 0
|
||||
|
||||
DATABASE_ROUTERS = 1
|
||||
|
||||
for items in data:
|
||||
if items.find('DATABASE_ROUTERS') > -1:
|
||||
DATABASE_ROUTERS = 0
|
||||
|
||||
Upgrade.stdOut('Restoring settings file!')
|
||||
|
||||
writeToFile = open("/usr/local/CyberCP/CyberCP/settings.py", 'w')
|
||||
@@ -1369,6 +1375,7 @@ class Upgrade:
|
||||
writeToFile.writelines(" 'django.middleware.csrf.CsrfViewMiddleware',\n")
|
||||
|
||||
if items.find('DATABASE_ROUTERS') > -1:
|
||||
writeToFile.writelines(items)
|
||||
if SESSION_COOKIE_SECURE == 1:
|
||||
con = """SESSION_COOKIE_SECURE = True
|
||||
CSRF_COOKIE_SECURE = True
|
||||
@@ -1416,6 +1423,9 @@ CSRF_COOKIE_SECURE = True
|
||||
writeToFile.writelines("MEDIA_URL = '/home/cyberpanel/media/'\n")
|
||||
writeToFile.writelines('MEDIA_ROOT = MEDIA_URL\n')
|
||||
|
||||
if DATABASE_ROUTERS == 1:
|
||||
writeToFile.writelines("DATABASE_ROUTERS = ['backup.backupRouter.backupRouter']\n")
|
||||
|
||||
writeToFile.close()
|
||||
|
||||
Upgrade.stdOut('Settings file restored!')
|
||||
|
||||
Reference in New Issue
Block a user