My Settings.py looks like this
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',
]
STATIC_URL = '/static/'
STATICFILES_DIRS = [BASE_DIR / 'static']
STATIC_ROOT = BASE_DIR / "staticfiles"
STATICFILES_STORAGE = "whitenoise.storage.CompressedManifestStaticFilesStorage"
Whitenoise ran fine and copied all the files into staticfiles; however admin page still wont use the styling correctly like it canât see the admin folder in staticfiles and its contents.
(venv) root@ubuntu-s-1vcpu-512mb-10gb-sfo3-01:~/cquence# ls -la
total 288
drwxr-xr-x 13 root root 4096 Sep 9 23:58 .
drwx------ 10 root root 4096 Sep 9 23:56 ..
drwxr-xr-x 4 root root 4096 Jul 31 00:27 account
drwxr-xr-x 3 root root 4096 Sep 9 23:56 config
-rw-r--r-- 1 root root 233472 Sep 9 23:58 db.sqlite3
drwxr-xr-x 5 root root 4096 Sep 9 23:12 djangopaypal
-rwxr-xr-x 1 root root 662 Mar 14 16:49 manage.py
drwxr-xr-x 4 root root 4096 Jul 31 00:28 polls
drwxr-xr-x 7 root root 4096 Jul 25 22:33 productionfiles
drwxr-xr-x 7 root root 4096 Sep 5 11:50 registration
drwxr-xr-x 2 root root 4096 Sep 9 23:32 static
drwxr-xr-x 7 root root 4096 Sep 9 23:48 staticfiles
drwxr-xr-x 5 root root 4096 Sep 9 17:41 stripe_demo
drwxr-xr-x 5 root root 4096 Mar 14 16:46 venv
drwxr-xr-x 5 root root 4096 Jul 31 00:27 web
(venv) root@ubuntu-s-1vcpu-512mb-10gb-sfo3-01:~/cquence# find staticfiles/ -type f | wc -l
594
(venv) root@ubuntu-s-1vcpu-512mb-10gb-sfo3-01:~/cquence# ls -la staticfiles/
total 48
drwxr-xr-x 7 root root 4096 Sep 9 23:48 .
drwxr-xr-x 13 root root 4096 Sep 9 23:58 ..
drwxr-xr-x 5 root root 4096 Sep 9 23:32 admin
-rw-r--r-- 1 root root 64 Sep 9 23:48 cquence.045af5b26e4a.css
-rw-r--r-- 1 root root 64 Sep 9 23:32 cquence.css
drwxr-xr-x 2 root root 4096 Sep 9 23:34 css
drwxr-xr-x 2 root root 4096 Sep 9 23:32 fonts
drwxr-xr-x 2 root root 4096 Sep 9 23:32 images
drwxr-xr-x 2 root root 4096 Sep 9 23:32 js
-rw-r--r-- 1 root root 10322 Sep 9 23:48 staticfiles.json
(venv) root@ubuntu-s-1vcpu-512mb-10gb-sfo3-01:~/cquence# ./manage.py collectstatic
You have requested to collect static files at the destination
location as specified in your settings:
/root/cquence/staticfiles
This will overwrite existing files!
Are you sure you want to do this?
Type 'yes' to continue, or 'no' to cancel: yes
0 static files copied to '/root/cquence/staticfiles', 127 unmodified, 352 post-processed.
(venv) root@ubuntu-s-1vcpu-512mb-10gb-sfo3-01:~/cquence#
I tried collecting staticfiles but the admin page is still broken
(venv) root@ubuntu-s-1vcpu-512mb-10gb-sfo3-01:/etc/nginx/sites-enabled# cat cquence
server {
listen 80;
server_name ;
location = /favicon.ico { access_log off; log_not_found off; }
location /static/ {
root /root/cquence;
}
location / {
include proxy_params;
proxy_pass http://unix:/run/gunicorn.sock;
}
}
(venv) root@ubuntu-s-1vcpu-512mb-10gb-sfo3-01:/etc/nginx/sites-enabled#```
I keep getting no CSS loading in my admin page.
![Screenshot 2024-09-09 170059|690x449](upload://5X7P2YgwkUZZwxnIHU6tjRUFQdI.png)
![Screenshot 2024-09-09 170059|690x449](upload://5X7P2YgwkUZZwxnIHU6tjRUFQdI.png)