title: TypeError: 'str' object is not callable -- on request to API
body: <p>I am trying to run a minimal Django server but I get this error when I send a get request to the /api/v1/ endpoint.</p>
  
  <p>I realize similar questions have been asked before, and I believe this is occurring because of an invalid import reference, but I am unable to see where the mistake I made is.</p>
  
  <p>The filesystem (minus cache + migrations folders): </p>
  
  <pre><code>.
  ├── api
  │   ├── admin.py
  │   ├── apps.py
  │   ├── __init__.py
  │   ├── models.py
  │   ├── serializers.py
  │   ├── tests.py
  │   ├── urls.py
  │   └── views.py
  ├── blog_project
  │   ├── __init__.py
  │   ├── settings.py
  │   ├── urls.py
  │   └── wsgi.py
  ├── db.sqlite3
  ├── manage.py
  ├── Pipfile
  ├── Pipfile.lock
  └── posts
      ├── admin.py
      ├── apps.py
      ├── __init__.py
      ├── models.py
      ├── tests.py
      └── views.py
  </code></pre>
  
  <p><strong>api/views.py</strong></p>
  
  <pre><code>from django.shortcuts import render
  
  # Create your views here.
  from rest_framework import generics
  
  from posts import models
  from .serializers import PostSerializer
  
  class PostList(generics.ListCreateAPIView):
          queryset = models.Post.objects.all()
          serializer_class = PostSerializer
  
  class PostDetail(generics.RetrieveUpdateDestroyAPIView):
          queryset = models.Post.objects.all()
          serializer_class = PostSerializer
  </code></pre>
  
  <p><strong>api/serializers.py</strong></p>
  
  <pre><code>from rest_framework import serializers
  from posts import models
  
  
  class PostSerializer(serializers.ModelSerializer):
  
          class Meta:
                  fields = ('id', 'author', 'title', 'body', 'created_at',)
                  model = models.Post
  </code></pre>
  
  <p><strong>api/urls.py</strong></p>
  
  <pre><code>from django.urls import path
  
  from .views import PostList, PostDetail
  
  urlpatterns = [
          path('&lt;int:pk&gt;/', PostDetail.as_view()),
          path('', PostList.as_view()),
  ]
  </code></pre>
  
  <p><strong>posts/models.py</strong></p>
  
  <pre class="lang-py prettyprint-override"><code>from django.db import models
  
  # Create your models here.
  from django.db import models
  from django.contrib.auth.models import User
  
  class Post(models.Model):
          author = models.ForeignKey(User, on_delete = models.CASCADE)
          title = models.CharField(max_length = 50)
          body = models.TextField()
          created_at = models.DateTimeField(auto_now_add = True)
          updated_at = models.DateTimeField(auto_now = True)
  
          def __str__(self):
                  return self.title
  </code></pre>
  
  <p><strong>Full traceback:</strong></p>
  
  <pre><code>Traceback (most recent call last):
    File "/home/dario/anaconda3/lib/python3.7/site-packages/django/core/handlers/exception.py", line 34, in inner
      response = get_response(request)
    File "/home/dario/anaconda3/lib/python3.7/site-packages/django/core/handlers/base.py", line 115, in _get_response
      response = self.process_exception_by_middleware(e, request)
    File "/home/dario/anaconda3/lib/python3.7/site-packages/django/core/handlers/base.py", line 113, in _get_response
      response = wrapped_callback(request, *callback_args, **callback_kwargs)
    File "/home/dario/anaconda3/lib/python3.7/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
      return view_func(*args, **kwargs)
    File "/home/dario/anaconda3/lib/python3.7/site-packages/django/views/generic/base.py", line 71, in view
      return self.dispatch(request, *args, **kwargs)
    File "/home/dario/anaconda3/lib/python3.7/site-packages/rest_framework/views.py", line 505, in dispatch
      response = self.handle_exception(exc)
    File "/home/dario/anaconda3/lib/python3.7/site-packages/rest_framework/views.py", line 465, in handle_exception
      self.raise_uncaught_exception(exc)
    File "/home/dario/anaconda3/lib/python3.7/site-packages/rest_framework/views.py", line 476, in raise_uncaught_exception
      raise exc
    File "/home/dario/anaconda3/lib/python3.7/site-packages/rest_framework/views.py", line 493, in dispatch
      self.initial(request, *args, **kwargs)
    File "/home/dario/anaconda3/lib/python3.7/site-packages/rest_framework/views.py", line 411, in initial
      self.check_permissions(request)
    File "/home/dario/anaconda3/lib/python3.7/site-packages/rest_framework/views.py", line 331, in check_permissions
      for permission in self.get_permissions():
    File "/home/dario/anaconda3/lib/python3.7/site-packages/rest_framework/views.py", line 278, in get_permissions
      return [permission() for permission in self.permission_classes]
    File "/home/dario/anaconda3/lib/python3.7/site-packages/rest_framework/views.py", line 278, in &lt;listcomp&gt;
      return [permission() for permission in self.permission_classes]
  TypeError: 'str' object is not callable
  </code></pre>