from django.conf.urls import patterns, url

urlpatterns = patterns('mailqueue.views',
                       url(r'^clear$', 'clear_sent_messages', name='clear_sent_messages'),
                       url(r'^$', 'run_mail_job', name='run_mail_job'),
                       )

from django.conf.urls import url
from . import views

urlpatterns = [
    url(r'^clear$', views.clear_sent_messages, name='clear_sent_messages'),
    url(r'^$', views.run_mail_job, name='run_mail_job'),
]

Remove warning "deprecated" in url.py
Remove warning "deprecated" in url.py

version django=1.9.6
RemovedInDjango110Warning: django.conf.urls.patterns() is deprecated and will be removed in Django 1.10. Update your urlpatterns to be a list of django.conf.urls.url() instances instead.

- from django.conf.urls import patterns, url
+ from django.conf.urls import url
+ from . import views
  
- urlpatterns = patterns('mailqueue.views',
+ urlpatterns = [
-                        url(r'^clear$', 'clear_sent_messages', name='clear_sent_messages'),
+     url(r'^clear$', views.clear_sent_messages, name='clear_sent_messages'),
-                        url(r'^$', 'run_mail_job', name='run_mail_job'),
+     url(r'^$', views.run_mail_job, name='run_mail_job'),
-                        )
+ ]
  
Remove warning "deprecated" in url.py
## Code Before:
from django.conf.urls import patterns, url

urlpatterns = patterns('mailqueue.views',
                       url(r'^clear$', 'clear_sent_messages', name='clear_sent_messages'),
                       url(r'^$', 'run_mail_job', name='run_mail_job'),
                       )

## Instruction:
Remove warning "deprecated" in url.py
## Code After:
from django.conf.urls import url
from . import views

urlpatterns = [
    url(r'^clear$', views.clear_sent_messages, name='clear_sent_messages'),
    url(r'^$', views.run_mail_job, name='run_mail_job'),
]
