Skip to content

Conversation

@danialkeimasi
Copy link

@danialkeimasi danialkeimasi commented Mar 4, 2021

After Django 3.0, BASE_DIR in settings.py is generated by pathlib (also in this template):
quote from Django docs:

The settings.py generated by the startproject command now uses pathlib.Path instead of os.path for building filesystem paths.

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

The proper way to join path with pathlib is like this:

Build paths inside the project like this: BASE_DIR / 'subdir'.

But it was used the old os.path.join
Also, The pathlib library is included in all versions of python >= 3.4. and django supported this, so there is no compatibility issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant