Earlier I was facing problem when I refresh the page. With this Solution I manage to solve the problem. But after applying this to url pattern, image is not loading properly. If I try to open the source of image in new tab , it redirects me to index page.
When url pattern is url(r'^.*$', IndexView.as_view(), name='index'), image is not displayed but page is refreshed properly .
When url pattern is url(r'^$', IndexView.as_view(), name='index'), image is displayed but page is not refreshed properly (Page not found) error
How to solve this.
Update: urls.py
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^api/v1/', include(router.urls)),
url(r'^api/v1/auth/login/$', LoginView.as_view(), name='login'),
url(r'^api/v1/auth/logout/$', LogoutView.as_view(), name='logout'),
url(r'^api/v1/', include(accounts_router.urls)),
url(r'^api/v1/', include(profiles_router.urls)),
url(r'^blogs/',include('blogs.urls')),
url(r'^account_data/',include('customauth.urls')),
url(r'^.*$', IndexView.as_view(), name='index'),
#url(r'^customauth/',include('customauth.urls')),
]
if settings.DEBUG:
urlpatterns+=static(settings.STATIC_URL,document_root=settings.STATIC_ROOT)
urlpatterns+=static(settings.MEDIA_URL,document_root=settings.MEDIA_ROOT)
urls.pyfor checking details