title: Django Rest Framework Post method not allowed for a Route
body: <p>I'm writing a rest API using Django rest framework, I have setup viewsets, serializers and routes in their corresponding files.But when I send a post request to a route it returns POST method not allowed.</p>
  
  <p>Here's what i have done:</p>
  
  <p><strong>viewsets.py</strong></p>
  
  <pre><code>class DocRestViewSet(viewsets.ModelViewSet):
      serializer_class = serializers.DocRestSerializer
  </code></pre>
  
  <p><strong>routes.py</strong></p>
  
  <pre><code>router = routers.DefaultRouter()
  router.register(r'deployments', viewsets.DeploymentViewSet, base_name='rest_deployments')
  router.register(r'rest_deployments', viewsets.DocRestViewSet, base_name='docrest_deployments')
  </code></pre>
  
  <p><strong>serializers.py</strong></p>
  
  <pre><code>class DocRestSerializer(serializers.HyperlinkedModelSerializer):
    class Meta:
      model = models.DocRestModel
      fields = ('name', 'user', 'serviceName', 'dockerImageURL', 'routing')
  </code></pre>
  
  <p><strong>urls.py</strong></p>
  
  <pre><code>urlpatterns = [
      url(r'^create/new$', views.DeploymentView.as_view(), name='new-rest-dep'),
      url(r'^rest/$', views.DeploymentView.as_view(), name='doc-rest-dep'),
  ]
  </code></pre>
  
  <p><strong>views.py</strong></p>
  
  <pre><code>class DocRestView(LoginRequiredMixin, CreateView):
  
      def post(self, request, *args, **kwargs):
          return 'Post req received for docrest'
  </code></pre>
  
  <blockquote>
    <p>Update: Here's I have added users <strong>urls.py</strong> also:</p>
  </blockquote>
  
  <pre><code>urlpatterns = [
      url(r'^dashboard/', include('gui.urls')),
      url(r'^instance/', include('instances.urls')),
      url(r'^images/', include(image_urls)),
      url(r'^restDeployment/', include('rest.urls')),
      url(r'^dashboard/$', views.Dashboard, name='dashboard'),
      url(r'^logout/$', views.LogoutView.as_view(), name='logout'),
      url(r'^signup/$', views.SignUpView.as_view(), name='signup'),
      url(r'^profile/$', views.ProfileView.as_view(), name='profile'),
      url(r'^login/', auth_views.login, name='login'),
      url(r'^deploy/docker/', include(auth_urls), name='authGoogle'),
      url(r'^deploy/', include(auth_urls), name='awd'),
      url('^', include('django.contrib.auth.urls')),
  
  ]
  </code></pre>
  
  <p>and here's the <strong>restDeployment</strong> URL refers to the rest app urls.</p>
  
  <p>When I submit a POST request to <strong><code>http://127.0.0.1:8000/api/users/rest_deployments/</code></strong> it returns:</p>
  
  <blockquote>
    <p>{"detail":"Method \"POST\" not allowed."}</p>
  </blockquote>
  
  <p>what can be a problem?</p>