1
You have to set STATIC_ROOT, STATIC_URL and STATICFILES_DIRS in settings.py as below:
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'static')
STATICFILES_DIRS = (
os.path.join(BASE_DIR, 'static'),
)
and then try to run:
python manage.py collectstatic
0
If you are using django-rest-framework see this.
You need to add it as,
INSTALLED_APPS = (
...
'rest_framework',
)
and in urls.py:
urlpatterns = [
...
url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework'))
]
It will automatically search and catch all the static files.
- Looping through a list of items to get their foreignkey value
- Pythonanywhere Database Configurations
- User created in migration does not exist
- Django: Superuser username doesn't show up in Users table
Source:stackexchange.com