I'm using a django resting framework for my backend and react for my front end. I've set the front end so when logging in the client receives a JSON token after being fully authenticated. However, my backend - specifically the APIs are not receiving this JSON token.
Here is what my url conf looks like:
router = SimpleRouter()
router.register(r'accounts', accountsviews.UserViewSet, 'list')
router.register(r'groups', accountsviews.GroupViewSet)
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^message/', homeviews.message, name="message"),
url(r'^stocks_api/', stocksviews.StockList.as_view()),
url(r'^passwordreset/', homeviews.passwordreset.as_view(), name='passwordreset'),
url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework')),
url(r'^api-token-auth/', obtain_jwt_token),
url(r'^api-token-refresh/', refresh_jwt_token),
url(r'^api-token-verify/', verify_jwt_token),
url(r'^reset/done/$', passwordviews.reset_done, name='password_reset_done'),
url(r'^reset/(?P<token>[\w:-]+)/$', passwordviews.reset,
name='password_reset_reset'),
url(r'^', include(router.urls)),
url(r'^', homeviews.home, name='home'),
]
urlpatterns = format_suffix_patterns(urlpatterns)
I feel like the issues might be because my apis (stocks_api, accounts_api, and groups_api) are not nested inside r'^', homeviews.home. If so, how would I go about making JWT global and not just specific for a url?