サーバーはUbuntu 16.04.2 x64で起動され、ローカルサーバー上ではすべてここで開始されたものと同じ設定で動作します。ローカルサーバーのすべてのDjangoの静的ファイル404をデジタルオーシャンに展開
設定
STATIC_URL = '/static/'
STATICFILES_DIRS = [
os.path.join(BASE_DIR, "static"),
#'/var/www/static/',
]
STATIC_ROOT = os.path.join(BASE_DIR, "static_cdn")
MEDIA_URL = "/media/"
MEDIA_ROOT = os.path.join(BASE_DIR, "media_cdn")
のURL
from django.conf.urls import include, url
from django.contrib import admin
from django.conf import settings
from django.conf.urls.static import static
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^chart/', include("charts.urls", namespace='charts')),
url(r'^comments/', include("comments.urls", namespace='comments')),
url(r'^im/', include("messenger.urls", namespace='im')),
url(r'^accounts/', include("accounts.urls", namespace='accounts')),
url(r'^series/', include("serials.urls", namespace='series')),
url(r'^', include("serials.urls", namespace='homeview')),
]+ static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
素晴らしい作品が、私はライブstaticfilesでそれを起動したときに
> [29/Jul/2017 07:54:38] "GET /static/css/bootstrap.min.css HTTP/1.1"
> 404 102 [29/Jul/2017 07:54:38] "GET /static/js/bootstrap.min.js
> HTTP/1.1" 404 100 [29/Jul/2017 07:54:38] "GET
> /static/min_css/base.min.css HTTP/1.1" 404 101 [29/Jul/2017 07:54:38]
> "GET /static/js/Chart.min.js HTTP/1.1" 404 96 [29/Jul/2017 07:54:38]
> "GET /static/js/smooth-scroll.js HTTP/1.1" 404 100 [29/Jul/2017
> 07:54:38] "GET /static/js/script.js HTTP/1.1" 404 93 [29/Jul/2017
> 07:54:39] "GET /static/js/bootstrap.min.js HTTP/1.1" 404 100
> [29/Jul/2017 07:54:39] "GET /static/js/Chart.min.js HTTP/1.1" 404 96
> [29/Jul/2017 07:54:39] "GET /static/js/smooth-scroll.js HTTP/1.1" 404
> 100 [29/Jul/2017 07:54:39] "GET /static/js/script.js HTTP/1.1" 404 93
どのようにサーバー構成を噛んで? – InvictusManeoBart
どのWebサーバーを使用していますか? NginxまたはApache? –
私はNginxサーバを使用しています – InvictusManeoBart