Django admin: strange view

Couldnt understand what wrong with my admin part. It looks like that: enter image description here

I understood that this effect may depend on 'static' resources.. HTML preview shows:

<head>
<title>Log in | Django site admin</title>
<link rel="stylesheet" href="/staticfiles/admin/css/base.css">

  <link rel="stylesheet" href="/staticfiles/admin/css/dark_mode.css">
  <script src="/staticfiles/admin/js/theme.js"></script>


  <link rel="stylesheet" href="/staticfiles/admin/css/nav_sidebar.css">
  <script src="/staticfiles/admin/js/nav_sidebar.js" defer></script>

<link rel="stylesheet" href="/staticfiles/admin/css/login.css">

and I checked - all files exist inbb staticfiles directory. But when i click file in chrome - such page appears

Page not found (404)
Request Method: GET
Request URL:    http://amodule.su/staticfiles/admin/css/nav_sidebar.css
Using the URLconf defined in amodule.urls, Django tried these URL patterns, in this order:

[name='home']
news/
admin/
The current path, staticfiles/admin/css/nav_sidebar.css, didn’t match any of these.

my settings.py contains such definitions of static:

STATIC_URL = 'staticfiles/'

DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'

MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
MEDIA_URL = '/media/'

STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')

where am I wrong?

Found solution:

trouble was with rights on my directory for django project. Here the set up for rights:

/home/www - my directory for projects

www - my user for working with data in server session

sudo chown -R www-data:www-data /home/www
sudo chown -R www-data:www-data /home/www
sudo usermod -aG www-data www 
sudo chmod go-rwx /home/www
sudo chmod go+x /home/www
sudo chgrp -R www-data /home/www
sudo chmod -R go-rwx /home/www
sudo chmod -R g+rwx /home/www
Вернуться на верх