Forums

STATIC_ROOT = Path(BASE_DIR / 'static') TypeError: unsupported operand type(s) for /: 'str' and 'str'

I'm working with a student to try to help her deploy her first Django assignment. She is getting an error that I cannot recreate, and I can't seem to find any reason why it is happening.

When the application deploys in MY PythonAnywhere account, the 'settings.py' file is updated during the deployment process to include the following at the end - which does not generate an error: STATIC_ROOT = os.path.join(BASE_DIR, 'static')MEDIA_ROOT = os.path.join(BASE_DIR, 'media')

When SHE deploys from the exact same repository, her settings.py file is updated with: STATIC_ROOT = Path(BASE_DIR / 'static')

which generates a syntax error: TypeError: unsupported operand type(s) for /: 'str' and 'str'

She is using python3.8 and Django 4.0.2. I also verified our PythonAnywhere system image is the same - it is. We both have glastonbury and 3.8 selected for all 3 python settings.

The first time the account was accessed - this command was executed: pip3.8 install --user pythonanywhere

Then for deployment, we use: pa_autoconfigure_django.py --python=3.8 GitHubRepoCloneAddress --nuke

Could you contact us at support@pythonanywhere.com with the github repo url, so we could take a look at it?