2👍
Try this order:
urlpatterns = [
url(r'^$', views.mineral_list, name='list'),
url(r'^search/$', views.search, name='search'),
url(r'^(?P<letter>[a-zA-Z])/$', views.mineral_letter, name='letter'),
url(r'^(?P<category>[a-zA-Z\s]+)/$', views.search_category, name='category'),
url(r'^(?P<pk>\d+)/$', views.mineral_detail, name='detail'),
]
Source:stackexchange.com