Configuring django filebrowser
Configuring django filebrowser
In order to upload images or other media files through admin I installed filebrowser. Moreover I need filebrowser for the Tinymce. But I am having the following problem. By the way I installed filebrowser without grapelli.
settings.py:
STATIC_URL = '/static/'
MEDIA_URL = '/media/'
STATIC_ROOT = os.path.join(os.path.dirname(BASE_DIR), "static_cdn")
SITE_ROOT = os.path.realpath(os.path.dirname(__file__))
MEDIA_ROOT = os.path.join(SITE_ROOT, "media_cdn")
STATICFILES_DIRS =[
os.path.join(BASE_DIR, "static"),
]
and the url.py is the following:
from django.conf import settings
from django.conf.urls.static import static
from filebrowser.sites import site
urlpatterns = [
path('admin/', admin.site.urls),
path('admin/filebrowser/', site.urls),
path('tinymce/', include('tinymce.urls')),
path('', views.home, name='home'),
path('products/', include('insuranceProducts.urls', namespace='insurance')),
path('about_us/', include('aboutUs.urls', namespace='about_us')),
path('paparazzi/', include('paparazzi.urls', namespace='paparazzi')),
]
if settings.DEBUG:
urlpatterns += static(settings.STATIC_URL, document_root = settings.STATIC_ROOT)
urlpatterns += static(settings.MEDIA_URL, document_root = settings.MEDIA_ROOT)
Besides I am using Django 2.0 and django-tinymce4-lite
0
Thanks for contributing an answer to Stack Overflow!
But avoid …
To learn more, see our tips on writing great answers.
Required, but never shown
Required, but never shown
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.