“Medien django” Code-Antworten

Managin Media Django

#in base url
from django.conf import settings
from django.conf.urls.static import static

urlpatterns = [
    # ... the rest of your URLconf goes here ...
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
#in setting
MEDIA_ROOT = BASE_DIR / 'media'
MEDIA_URL = '/media/'
Clever Constrictor

Medien django

from django.conf import settings
from django.conf.urls.static import static

urlpatterns = [
    # ... the rest of your URLconf goes here ...
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

# ----------------or----------------

# urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

Condemned Chamois

Medien in Django verwalten

from django.conf import settings
from django.conf.urls.static import static

urlpatterns = [
    # ... the rest of your URLconf goes here ...
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
Clever Constrictor

Ähnliche Antworten wie “Medien django”

Fragen ähnlich wie “Medien django”

Weitere verwandte Antworten zu “Medien django” auf Python

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen