from django.conf.urls import url
from django.views.decorators.cache import cache_page
from django.views.generic import TemplateView
from ligand.views import *

urlpatterns = [
    url(r'^$', cache_page(3600*24*7)(LigandBrowser.as_view()), name='ligand_browser'),
    url(r'^target/all/(?P<slug>[-\w]+)/$',TargetDetails, name='ligand_target_detail'),
    url(r'^target/compact/(?P<slug>[-\w]+)/$',TargetDetailsCompact, name='ligand_target_detail_compact'),
    url(r'^targets$',TargetDetails, name='ligand_target_detail'),
    url(r'^targets_compact',TargetDetailsCompact, name='ligand_target_detail_compact'),
    url(r'^targets_purchasable',TargetPurchasabilityDetails, name='ligand_target_detail_purchasable'),
    url(r'^(?P<ligand_id>[-\w]+)/$',LigandDetails, name='ligand_detail'),
    url(r'^statistics', LigandStatistics.as_view(), name='ligand_statistics')
]

from django.conf.urls import url
from django.views.decorators.cache import cache_page
from django.views.generic import TemplateView
from ligand.views import *

urlpatterns = [
    url(r'^$', cache_page(3600*24*7)(LigandBrowser.as_view()), name='ligand_browser'),
    url(r'^target/all/(?P<slug>[-\w]+)/$',TargetDetails, name='ligand_target_detail'),
    url(r'^target/compact/(?P<slug>[-\w]+)/$',TargetDetailsCompact, name='ligand_target_detail_compact'),
    url(r'^targets$',TargetDetails, name='ligand_target_detail'),
    url(r'^targets_compact',TargetDetailsCompact, name='ligand_target_detail_compact'),
    url(r'^targets_purchasable',TargetPurchasabilityDetails, name='ligand_target_detail_purchasable'),
    url(r'^(?P<ligand_id>[-\w]+)/$',LigandDetails, name='ligand_detail'),
    url(r'^statistics', cache_page(3600*24*7)(LigandStatistics.as_view()), name='ligand_statistics')
]

Add caching to ligand statistics
Add caching to ligand statistics

  from django.conf.urls import url
  from django.views.decorators.cache import cache_page
  from django.views.generic import TemplateView
  from ligand.views import *
  
  urlpatterns = [
      url(r'^$', cache_page(3600*24*7)(LigandBrowser.as_view()), name='ligand_browser'),
      url(r'^target/all/(?P<slug>[-\w]+)/$',TargetDetails, name='ligand_target_detail'),
      url(r'^target/compact/(?P<slug>[-\w]+)/$',TargetDetailsCompact, name='ligand_target_detail_compact'),
      url(r'^targets$',TargetDetails, name='ligand_target_detail'),
      url(r'^targets_compact',TargetDetailsCompact, name='ligand_target_detail_compact'),
      url(r'^targets_purchasable',TargetPurchasabilityDetails, name='ligand_target_detail_purchasable'),
      url(r'^(?P<ligand_id>[-\w]+)/$',LigandDetails, name='ligand_detail'),
-     url(r'^statistics', LigandStatistics.as_view(), name='ligand_statistics')
+     url(r'^statistics', cache_page(3600*24*7)(LigandStatistics.as_view()), name='ligand_statistics')
  ]
  
Add caching to ligand statistics
## Code Before:
from django.conf.urls import url
from django.views.decorators.cache import cache_page
from django.views.generic import TemplateView
from ligand.views import *

urlpatterns = [
    url(r'^$', cache_page(3600*24*7)(LigandBrowser.as_view()), name='ligand_browser'),
    url(r'^target/all/(?P<slug>[-\w]+)/$',TargetDetails, name='ligand_target_detail'),
    url(r'^target/compact/(?P<slug>[-\w]+)/$',TargetDetailsCompact, name='ligand_target_detail_compact'),
    url(r'^targets$',TargetDetails, name='ligand_target_detail'),
    url(r'^targets_compact',TargetDetailsCompact, name='ligand_target_detail_compact'),
    url(r'^targets_purchasable',TargetPurchasabilityDetails, name='ligand_target_detail_purchasable'),
    url(r'^(?P<ligand_id>[-\w]+)/$',LigandDetails, name='ligand_detail'),
    url(r'^statistics', LigandStatistics.as_view(), name='ligand_statistics')
]

## Instruction:
Add caching to ligand statistics
## Code After:
from django.conf.urls import url
from django.views.decorators.cache import cache_page
from django.views.generic import TemplateView
from ligand.views import *

urlpatterns = [
    url(r'^$', cache_page(3600*24*7)(LigandBrowser.as_view()), name='ligand_browser'),
    url(r'^target/all/(?P<slug>[-\w]+)/$',TargetDetails, name='ligand_target_detail'),
    url(r'^target/compact/(?P<slug>[-\w]+)/$',TargetDetailsCompact, name='ligand_target_detail_compact'),
    url(r'^targets$',TargetDetails, name='ligand_target_detail'),
    url(r'^targets_compact',TargetDetailsCompact, name='ligand_target_detail_compact'),
    url(r'^targets_purchasable',TargetPurchasabilityDetails, name='ligand_target_detail_purchasable'),
    url(r'^(?P<ligand_id>[-\w]+)/$',LigandDetails, name='ligand_detail'),
    url(r'^statistics', cache_page(3600*24*7)(LigandStatistics.as_view()), name='ligand_statistics')
]
