I'm a noob in Django framework, sorry for misunderstanding in some concepts.
Currently, I'm trying to set up a Django app with django-filer
. Django filer was installed commonly and migrations were done according to documentation. The installed apps list was updated with filer, mptt, and easy_thumbnails. The allowed host was updated with the IP of the host, debug
flag was set to true and timezones and language code were also updated, as shown below. According to documentation, that's all for a basic setup of Django filer.
from pathlib import Path
BASE_DIR = Path(__file__).resolve().parent.parent
DEBUG = True
ALLOWED_HOSTS = ["192.168.230.98"]
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'filer',
'mptt',
'easy_thumbnails'
]
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'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',
]
ROOT_URLCONF = 'filerTest.urls'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]
WSGI_APPLICATION = 'filerTest.wsgi.application'
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': BASE_DIR / 'db.sqlite3',
}
}
USE_I18N = True
USE_TZ = True
STATIC_URL = 'static/'
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
Two images were uploaded through the Django admin interface. After images are upload, the Django admin interface can't retrieve they. Chrome development console showed a 404 error, like if images were not stored. When I check if images were stored, They are in a random names subfolder in the filer_public and file_public_thumbnails directories, according to other forums, this is the expectable behavior.
I try to set static_url parameter in settings.py. However, it's only possible to set one path. Then, I should choose between filer_public or filer_public_thumbnails or static directories to serve static files. This is not a good approach.
Some idea about what step or error I done during Django filer setup?