So, I'm receiving the following error:
TypeError: join() argument must be str or bytes, not 'PosixPath'
It happens while checking my Django installation on Ubuntu 16.04. The full error would be:
STATIC_ROOT = os.path.join(BASE_DIR, 'static')
File "/usr/lib/python3.5/posixpath.py", line 89, in join
genericpath._check_arg_types('join', a, *p)
File "/usr/lib/python3.5/genericpath.py", line 143, in _check_arg_types
(funcname, s.__class__.__name__)) from None
TypeError: join() argument must be str or bytes, not 'PosixPath'
This is from the settings.py file.
In the file I have:
from pathlib import Path
import os
# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent
...
STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'static')
MEDIA_URL = '/media/'
MEDIA_ROOT = os.path.join(BASE_DIR, 'media/')
On my development environment it is working and running through it, yet here I receive the error. The version of Python on production is 3.5.1-3. Normally the packages should be installed the same as well (pip freeze/install -r).
Anyone have an idea to push me in the correct direction?
Thanks in advance,