title: Django For Beginers - Joinpath error when running manage.py runserver
body: <p>I am learning Djnago and I am facing  an issue I have looked around but can't maange to solve it.
  So basically on page 45 of Django For Beginners the author says :</p>
  <p>&quot; Next we need to update config/settings.py to tell Django the location of our new templates
  directory. This is a one-line change to the setting 'DIRS' under TEMPLATES.&quot;
  Code</p>
  <h1>config/settings.py</h1>
  <pre><code>TEMPLATES = [
  {
  ...
  'DIRS': [str (BASE_DIR. joinpath('templates '))], # new
  ...
  },
  ]
  </code></pre>
  <p>So in my settings.py file  I have this :</p>
  <pre><code>TEMPLATES = [
      {
          'BACKEND': 'django.template.backends.django.DjangoTemplates',
          'DIRS': [str(BASE_DIR.joinpath('templates'))],  # new
          'APP_DIRS': True,
          'OPTIONS': {
              'context_processors': [
                  'django.template.context_processors.debug',
                  'django.template.context_processors.request',
                  'django.contrib.auth.context_processors.auth',
                  'django.contrib.messages.context_processors.messages',
              ],
          },
      },
  ]
  </code></pre>
  <p>Unfortunatelly, when I run the manage.py runserver I then get this message :</p>
  <pre><code>  File &quot;C:\Users\User\Desktop\pages\manage.py&quot;, line 22, in &lt;module&gt;
      main()
    File &quot;C:\Users\User\Desktop\pages\manage.py&quot;, line 18, in main
      execute_from_command_line(sys.argv)
    File &quot;C:\Users\User\.virtualenvs\pages-8ZErAoFj\lib\site-packages\django\core\management\__init__.py&quot;, line 419, in execute_from_command_line
      utility.execute()
    File &quot;C:\Users\User\.virtualenvs\pages-8ZErAoFj\lib\site-packages\django\core\management\__init__.py&quot;, line 363, in execute
      settings.INSTALLED_APPS
    File &quot;C:\Users\User\.virtualenvs\pages-8ZErAoFj\lib\site-packages\django\conf\__init__.py&quot;, line 82, in __getattr__
      self._setup(name)
    File &quot;C:\Users\User\.virtualenvs\pages-8ZErAoFj\lib\site-packages\django\conf\__init__.py&quot;, line 69, in _setup
      self._wrapped = Settings(settings_module)
    File &quot;C:\Users\User\.virtualenvs\pages-8ZErAoFj\lib\site-packages\django\conf\__init__.py&quot;, line 170, in __init__
      mod = importlib.import_module(self.SETTINGS_MODULE)
    File &quot;c:\users\user\appdata\local\programs\python\python39\lib\importlib\__init__.py&quot;, line 127, in import_module
      return _bootstrap._gcd_import(name[level:], package, level)
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 1030, in _gcd_import
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 1007, in _find_and_load
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 986, in _find_and_load_unlocked
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 680, in _load_unlocked
    File &quot;&lt;frozen importlib._bootstrap_external&gt;&quot;, line 790, in exec_module
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 228, in _call_with_frames_removed
    File &quot;C:\Users\User\Desktop\pages\config\settings.py&quot;, line 58, in &lt;module&gt;
      'DIRS': [str(BASE_DIR.joinpath('templates'))],  # new
  AttributeError: 'str' object has no attribute 'joinpath'
  </code></pre>
  <p>I bet the error is very basic and I am not looking in the right  direction but it's been nearly a day since I have started searching for an answer so if someone could help me I would be really gratefull.</p>
  <p>Thanks all and have a great day.</p>