[Answered ]-AttributeError: 'WindowsPath' object has no attribute 'rpartition' when setting directory

1👍

Simply you can try following way:

STATIC_URL = '/static/'

STATICFILES_DIRS = [os.path.join(BASE_DIR, 'static')]

And in your template, load the static using following tag:

{% load static %}

0👍

STATIC_ROOT (and all other path-related options) must be a string, not a Path.

Cast it in the assignment:

STATIC_ROOT = str(BASE_DIR / "staticfiles")
👤AKX

Leave a comment