my static files settings are improperly configured according to heroku when I attempt to deploy. I am without doubt this is false as I still lack understanding of the proper way to set up static files.
I have ran collect static on my machine and it did work. I will provide the information my ask is to help me clear this up. I am going to continue to research and hope to come with a solution.
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
#angular distro root
ANGULAR_APP_DIR = os.path.join(BASE_DIR, 'frontend/dist')
STATICFILES_DIRS = [
os.path.join(ANGULAR_APP_DIR),
]
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.11/howto/static-files/
STATICFILES_STORAGE = 'whitenoise.django.GzipManifestStaticFilesStorage'
STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
STATIC_URL = '/static/'
these are my current root urls:
urlpatterns = [
url(r'^$', serve, kwargs={'path': 'index.html'}),
url(r'^(?!/?static/)(?!/?media/)(?P<path>.*\..*)$',RedirectView.as_view(url='/static/%(path)s', permanent=False)),
url(r'api/',include(rootapi)),
]
Add STATIC_URL
to your urlpatterns
.
from django.conf import settings
from django.conf.urls.static import static
urlpatterns = [
# your url patterns
]
urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)