Autosave: 20260209-082129
This commit is contained in:
parent
45bc0c273e
commit
db1a6f5278
Binary file not shown.
Binary file not shown.
@ -8,6 +8,15 @@ https://docs.djangoproject.com/en/5.2/howto/deployment/asgi/
|
||||
"""
|
||||
|
||||
import os
|
||||
from pathlib import Path
|
||||
|
||||
try:
|
||||
from dotenv import load_dotenv
|
||||
env_path = Path(__file__).resolve().parent.parent.parent / '.env'
|
||||
if env_path.exists():
|
||||
load_dotenv(env_path)
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
from django.core.asgi import get_asgi_application
|
||||
|
||||
|
||||
@ -38,13 +38,12 @@ INSTALLED_APPS = [
|
||||
|
||||
MIDDLEWARE = [
|
||||
'django.middleware.security.SecurityMiddleware',
|
||||
'whitenoise.middleware.WhiteNoiseMiddleware',
|
||||
'django.contrib.sessions.middleware.SessionMiddleware',
|
||||
'django.middleware.common.CommonMiddleware',
|
||||
'django.middleware.csrf.CsrfViewMiddleware',
|
||||
'django.contrib.auth.middleware.AuthenticationMiddleware',
|
||||
'django.contrib.messages.middleware.MessageMiddleware',
|
||||
'django.middleware.clickjacking.XFrameOptionsMiddleware',
|
||||
# 'django.middleware.clickjacking.XFrameOptionsMiddleware',
|
||||
]
|
||||
|
||||
ROOT_URLCONF = 'config.urls'
|
||||
@ -60,7 +59,8 @@ TEMPLATES = [
|
||||
'django.template.context_processors.request',
|
||||
'django.contrib.auth.context_processors.auth',
|
||||
'django.contrib.messages.context_processors.messages',
|
||||
'core.context_processors.deployment_timestamp', # Custom CP
|
||||
'core.context_processors.project_context',
|
||||
'core.context_processors.global_settings',
|
||||
],
|
||||
},
|
||||
},
|
||||
@ -141,6 +141,7 @@ SESSION_COOKIE_SECURE = True
|
||||
CSRF_COOKIE_SECURE = True
|
||||
SESSION_COOKIE_SAMESITE = "None"
|
||||
CSRF_COOKIE_SAMESITE = "None"
|
||||
# X_FRAME_OPTIONS = 'SAMEORIGIN'
|
||||
|
||||
# Email Settings
|
||||
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
|
||||
|
||||
@ -4,10 +4,19 @@ WSGI config for config project.
|
||||
It exposes the WSGI callable as a module-level variable named ``application``.
|
||||
|
||||
For more information on this file, see
|
||||
https://docs.djangoproject.com/en/5.2/howto/deployment/wsgi/
|
||||
https://docs.djangoproject.com/en/5.0/howto/deployment/wsgi/
|
||||
"""
|
||||
|
||||
import os
|
||||
from pathlib import Path
|
||||
|
||||
try:
|
||||
from dotenv import load_dotenv
|
||||
env_path = Path(__file__).resolve().parent.parent.parent / '.env'
|
||||
if env_path.exists():
|
||||
load_dotenv(env_path)
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
from django.core.wsgi import get_wsgi_application
|
||||
|
||||
|
||||
Binary file not shown.
12
core/apps.py
12
core/apps.py
@ -1,16 +1,6 @@
|
||||
from django.apps import AppConfig
|
||||
import sys
|
||||
|
||||
|
||||
class CoreConfig(AppConfig):
|
||||
default_auto_field = 'django.db.models.BigAutoField'
|
||||
name = 'core'
|
||||
|
||||
def ready(self):
|
||||
if 'runserver' in sys.argv:
|
||||
try:
|
||||
from django.core.management import call_command
|
||||
print("Gemini: Auto-running migrations...")
|
||||
call_command('migrate', interactive=False)
|
||||
print("Gemini: Migrations success.")
|
||||
except Exception as e:
|
||||
print(f"Gemini: Migration error: {e}")
|
||||
@ -10,10 +10,16 @@ class Migration(migrations.Migration):
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RunSQL(
|
||||
sql="ALTER TABLE core_systemsetting DROP COLUMN IF EXISTS logo_url;",
|
||||
reverse_sql="ALTER TABLE core_systemsetting ADD COLUMN IF NOT EXISTS logo_url varchar(200);",
|
||||
state_operations=[
|
||||
migrations.RemoveField(
|
||||
model_name='systemsetting',
|
||||
name='logo_url',
|
||||
),
|
||||
]
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='systemsetting',
|
||||
name='logo',
|
||||
|
||||
Binary file not shown.
26
manage.py
26
manage.py
@ -2,36 +2,28 @@
|
||||
"""Django's command-line utility for administrative tasks."""
|
||||
import os
|
||||
import sys
|
||||
import traceback
|
||||
from pathlib import Path
|
||||
|
||||
def main():
|
||||
"""Run administrative tasks."""
|
||||
try:
|
||||
from dotenv import load_dotenv
|
||||
env_path = Path(__file__).resolve().parent.parent / '.env'
|
||||
if env_path.exists():
|
||||
load_dotenv(env_path)
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'config.settings')
|
||||
try:
|
||||
from django.core.management import execute_from_command_line
|
||||
except ImportError as exc:
|
||||
try:
|
||||
with open('startup_error.log', 'w') as f:
|
||||
f.write("ImportError:\n")
|
||||
f.write(traceback.format_exc())
|
||||
except:
|
||||
pass
|
||||
raise ImportError(
|
||||
"Couldn't import Django. Are you sure it's installed and "
|
||||
"available on your PYTHONPATH environment variable? Did you "
|
||||
"forget to activate a virtual environment?"
|
||||
) from exc
|
||||
|
||||
try:
|
||||
execute_from_command_line(sys.argv)
|
||||
except Exception:
|
||||
try:
|
||||
with open('startup_error.log', 'w') as f:
|
||||
f.write("RuntimeError:\n")
|
||||
f.write(traceback.format_exc())
|
||||
except:
|
||||
pass
|
||||
raise
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
1
manage_trace.txt
Normal file
1
manage_trace.txt
Normal file
@ -0,0 +1 @@
|
||||
Manage.py started
|
||||
@ -1,8 +1,6 @@
|
||||
Django==5.2.7
|
||||
Django>=5.0,<6.0
|
||||
mysqlclient==2.2.7
|
||||
python-dotenv==1.1.1
|
||||
pyzk==0.9
|
||||
gunicorn==21.2.0
|
||||
whitenoise==6.6.0
|
||||
requests
|
||||
openpyxl
|
||||
1
settings_trace.txt
Normal file
1
settings_trace.txt
Normal file
@ -0,0 +1 @@
|
||||
Settings loaded
|
||||
18
startup_status.txt
Normal file
18
startup_status.txt
Normal file
@ -0,0 +1,18 @@
|
||||
[2026-02-09T07:28:37.599243] Starting manage.py...
|
||||
[2026-02-09T07:28:37.599461] Args: ['manage.py', 'runserver', '0.0.0.0:8000']
|
||||
[2026-02-09T07:28:37.653416] Loaded .env
|
||||
[2026-02-09T07:28:38.658262] Django setup complete.
|
||||
[2026-02-09T07:28:38.658403] Executing command line...
|
||||
[2026-02-09T07:28:46.088684] SystemExit caught: 3
|
||||
[2026-02-09T07:28:46.362448] Starting manage.py...
|
||||
[2026-02-09T07:28:46.362618] Args: ['manage.py', 'runserver', '0.0.0.0:8000']
|
||||
[2026-02-09T07:28:46.390956] Loaded .env
|
||||
[2026-02-09T07:28:46.717591] Django setup complete.
|
||||
[2026-02-09T07:28:46.717749] Executing command line...
|
||||
[2026-02-09T07:42:35.563432] SystemExit caught: 3
|
||||
[2026-02-09T07:42:36.571344] Starting manage.py...
|
||||
[2026-02-09T07:42:36.571557] Args: ['manage.py', 'runserver', '0.0.0.0:8000']
|
||||
[2026-02-09T07:42:36.626917] Loaded .env
|
||||
[2026-02-09T07:42:37.207600] Django setup complete.
|
||||
[2026-02-09T07:42:37.207759] Executing command line...
|
||||
[2026-02-09T07:42:38.535239] SystemExit caught: 3
|
||||
30
wsgi_crash.txt
Normal file
30
wsgi_crash.txt
Normal file
@ -0,0 +1,30 @@
|
||||
WSGI Crash: No module named 'whitenoise'
|
||||
Traceback (most recent call last):
|
||||
File "/home/ubuntu/executor/workspace/config/wsgi.py", line 19, in <module>
|
||||
application = get_wsgi_application()
|
||||
^^^^^^^^^^^^^^^^^^^^^^
|
||||
File "/home/ubuntu/.local/lib/python3.11/site-packages/django/core/wsgi.py", line 13, in get_wsgi_application
|
||||
return WSGIHandler()
|
||||
^^^^^^^^^^^^^
|
||||
File "/home/ubuntu/.local/lib/python3.11/site-packages/django/core/handlers/wsgi.py", line 118, in __init__
|
||||
self.load_middleware()
|
||||
File "/home/ubuntu/.local/lib/python3.11/site-packages/django/core/handlers/base.py", line 40, in load_middleware
|
||||
middleware = import_string(middleware_path)
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
File "/home/ubuntu/.local/lib/python3.11/site-packages/django/utils/module_loading.py", line 30, in import_string
|
||||
return cached_import(module_path, class_name)
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
File "/home/ubuntu/.local/lib/python3.11/site-packages/django/utils/module_loading.py", line 15, in cached_import
|
||||
module = import_module(module_path)
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
File "/usr/lib/python3.11/importlib/__init__.py", line 126, in import_module
|
||||
return _bootstrap._gcd_import(name[level:], package, level)
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
File "<frozen importlib._bootstrap>", line 1206, in _gcd_import
|
||||
File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
|
||||
File "<frozen importlib._bootstrap>", line 1128, in _find_and_load_unlocked
|
||||
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
|
||||
File "<frozen importlib._bootstrap>", line 1206, in _gcd_import
|
||||
File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
|
||||
File "<frozen importlib._bootstrap>", line 1142, in _find_and_load_unlocked
|
||||
ModuleNotFoundError: No module named 'whitenoise'
|
||||
9
wsgi_status.txt
Normal file
9
wsgi_status.txt
Normal file
@ -0,0 +1,9 @@
|
||||
[2026-02-09T07:28:46.937704] WSGI module loading...
|
||||
[2026-02-09T07:28:46.948377] WSGI loaded .env
|
||||
[2026-02-09T07:28:46.952251] WSGI application created successfully.
|
||||
[2026-02-09T07:42:37.533157] WSGI module loading...
|
||||
[2026-02-09T07:42:37.541628] WSGI loaded .env
|
||||
[2026-02-09T07:42:37.544967] WSGI application created successfully.
|
||||
[2026-02-09T07:42:39.272623] WSGI module loading...
|
||||
[2026-02-09T07:42:39.280940] WSGI loaded .env
|
||||
[2026-02-09T07:42:39.283449] WSGI application created successfully.
|
||||
1
wsgi_trace.txt
Normal file
1
wsgi_trace.txt
Normal file
@ -0,0 +1 @@
|
||||
WSGI loaded
|
||||
Loading…
x
Reference in New Issue
Block a user