Saadoun
Saadoun

Reputation: 21

STATICFILES DJANGO

I have a problem with Django, managing static files.. I know there are already similar questions here and I have gone through them all and tried them, but an error still pops up. here is my code

STATICFILES_DIRS = [ 
BASE_DIR / "static", 
 ]

and the following message pops up

BASE_DIR/'static', TypeError: unsupported operand type(s) for /: 'str' and 'str'

Upvotes: 1

Views: 184

Answers (1)

Zulfugar Ismayilzadeh
Zulfugar Ismayilzadeh

Reputation: 2763

Django is supporting pathlib starting from verson 3.1.

Make sure you are using supported Django version and your settings file has:

from pathlib import Path

BASE_DIR = Path(__file__).resolve(strict=True).parent.parent

Upvotes: 1

Related Questions