i found solution
just i need to change media/ to /media/ :)
Le lun. 24 août 2020 à 15:40, Ogunsanya Opeyemi <ogunsanyaopeyemi4@gmail.com> a écrit :
Hi, do you have pillow installed in your library. and look for the image in that path in your local directory.--On Mon, Aug 24, 2020 at 12:59 PM AMINE AZIZ <a.aminedcp@gmail.com> wrote:Problem to see file or image uploaded in admin djangosee image belowmy setting.py----------------------------------------------------import osfrom django.utils.translation import gettext_lazy as _# Build paths inside the project like this: os.path.join(BASE_DIR, ...)BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))LOCALE_PATHS = [os.path.join(BASE_DIR, 'locale')]# Quick-start development settings - unsuitable for production# SECURITY WARNING: keep the secret key used in production secret!SECRET_KEY = '##############'AUTH_PROFILE_MODULE= 'system.UserProfile'# SECURITY WARNING: don't run with debug turned on in production!DEBUG = TrueJQUERY_URL = FalseUSE_DJANGO_JQUERY = TrueALLOWED_HOSTS = []MEDIA_ROOT = os.path.join(BASE_DIR, 'media')MEDIA_URL = 'media/'LANGUAGES = [('en', _('English')),('ar', _('Arabe')),]INSTALLED_APPS = ['django.contrib.admin','django.contrib.auth','django.contrib.contenttypes','django.contrib.sessions','django.contrib.messages','django.contrib.staticfiles','smart_selects','fieldsets_with_inlines','easy_thumbnails','image_cropping','file_resubmit','admin_reorder','system',]from easy_thumbnails.conf import Settings as thumbnail_settingsTHUMBNAIL_PROCESSORS = ('image_cropping.thumbnail_processors.crop_corners',) + thumbnail_settings.THUMBNAIL_PROCESSORSCACHES = {'default': {'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',},"file_resubmit": {'BACKEND': 'django.core.cache.backends.filebased.FileBasedCache',"LOCATION": '/tmp/file_resubmit/'},}MIDDLEWARE = ['django.middleware.security.SecurityMiddleware','django.contrib.sessions.middleware.SessionMiddleware','django.middleware.common.CommonMiddleware',#'admin_reorder.middleware.ModelAdminReorder','django.middleware.csrf.CsrfViewMiddleware','django.middleware.locale.LocaleMiddleware','django.contrib.auth.middleware.AuthenticationMiddleware','django.contrib.messages.middleware.MessageMiddleware','django.middleware.clickjacking.XFrameOptionsMiddleware',]ROOT_URLCONF = 'portail.urls'TEMPLATES = [{'BACKEND': 'django.template.backends.django.DjangoTemplates','DIRS': [os.path.join(BASE_DIR, "templates"),],'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',],},},]# Password validationAUTH_PASSWORD_VALIDATORS = [{'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',},{'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',},{'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',},{'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',},]# InternationalizationLANGUAGE_CODE = 'en-us'TIME_ZONE = 'UTC'USE_I18N = TrueUSE_L10N = TrueUSE_TZ = True# Static files (CSS, JavaScript, Images)# InternationalizationLANGUAGE_CODE = 'en'TIME_ZONE = 'UTC'USE_I18N = TrueUSE_L10N = TrueUSE_TZ = True# Static files (CSS, JavaScript, Images)STATIC_URL = '/static/'STATIC_ROOT = os.path.join(BASE_DIR, 'static')------------------------------------------------------
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/782e3c34-27d2-4b27-b258-1fe40aeac128n%40googlegroups.com.
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CABJxPrHtgjtj67VLjMT6zjz_4bpdSFvUv4CQFe1BbO4uoipQWg%40mail.gmail.com.
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAFg6i0Jf-a5dz8nM2KwZZrHMN-KccgwrXmrvFQ1oi809G7nUZw%40mail.gmail.com.
No comments:
Post a Comment