SHARE
TWEET

Untitled

a guest Jun 24th, 2019 40 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Using the URLconf defined in mysite.urls, Django tried these URL
  2.  
  3. patterns, in this order:  
  4.  
  5. ^admin/  
  6. ^employees/  
  7.  
  8. The empty path didn't match any of these.
  9.      
  10. from django.conf.urls import url
  11. from django.contrib import admin
  12. from webapp import views
  13. from django.urls import path
  14. from rest_framework.urlpatterns import format_suffix_patterns
  15.  
  16.  
  17. urlpatterns = [
  18.  
  19. url(r'^admin/', admin.site.urls),
  20. url(r'^employees/', views.employeeList.as_view()),
  21. ]
  22.      
  23. class employeeList(APIView):
  24.  
  25. def get(self, request):
  26.     employees1 = employees.objects.all()
  27.     serializer = employeesSerializer(employees1, many=True)
  28.  
  29.     return Response(serializer.data)
  30.  
  31. def post(self):
  32.     pass
  33.      
  34. INSTALLED_APPS = [
  35. 'django.contrib.admin',
  36. 'django.contrib.auth',
  37. 'django.contrib.contenttypes',
  38. 'django.contrib.sessions',
  39. 'django.contrib.messages',
  40. 'django.contrib.staticfiles',
  41. 'rest_framework',
  42. 'webapp'
  43.  ]
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top