[Fixed]-How to manage static files from Django 1.8 to Django 1.10

1👍

Can you added the Update the urls.py(mainproject/urls.py), once you made the chnages run the python manage.py collectstatic command.

from django.conf.urls import url, include
from django.contrib import admin
from django.conf import settings
from django.conf.urls.static import static
urlpatterns = [
    url(r'^admin/', admin.site.urls),
]
urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)

settings.py
===================
import os

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
def root(folder):
    return os.path.join(os.path.abspath(os.path.dirname(__file__)), '..',folder)

STATIC_ROOT = root('staticstorage')
STATIC_URL = '/static/'
# Additional locations of static files
STATICFILES_DIRS = (
    root('static'),
)
👤Cadmus

Leave a comment