How to correctly display static files in Django when debug = False?
what should I do if I used a command python manage.py collectstatic and don’t understand what needs to be done in order for static files to be located and displayed, i get only 404 when i try to load server and my css also dont working my settings.py:
DEBUG = False
ALLOWED_HOSTS = ['127.0.0.1']
PATH_TO_YOUR_STATIC_FOLDER= 'man/static/'
STATICFILES_DIRS = [
BASE_DIR / "man/static",
PATH_TO_YOUR_STATIC_FOLDER,
]
STATIC_ROOT = BASE_DIR / "staticfiles"
# Internationalization
# https://docs.djangoproject.com/en/5.0/topics/i18n/
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'UTC'
USE_I18N = True
USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/5.0/howto/static-files/
STATIC_URL = '/static/'
# Default primary key field type
# https://docs.djangoproject.com/en/5.0/ref/settings/#default-auto-field
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
maybe i need to edit STATICFILES_DIRS?
i was trying to change STATICFILES_DIRS in settings, but nothing