from django.conf.urls.defaults import *
from django.contrib.auth.decorators import login_required
from profiles.views import (ProfilesList,
                            ProfileEdit,
)

urlpatterns = patterns("",
    url(r'^list/$', ProfilesList.as_view(), name='list'),
    url(r'^edit/$', ProfileEdit.as_view(), name='edit'),
)

from django.conf.urls.defaults import *
from django.contrib.auth.decorators import login_required
from .views import ProfilesList, ProfileEdit

urlpatterns = patterns("",
    url(r'^list/$', ProfilesList.as_view(), name='list'),
    url(r'^edit/$', login_required(ProfileEdit).as_view(), name='edit'),
)

Add login required for profile edit
Add login required for profile edit

  from django.conf.urls.defaults import *
  from django.contrib.auth.decorators import login_required
- from profiles.views import (ProfilesList,
+ from .views import ProfilesList, ProfileEdit
-                             ProfileEdit,
- )
  
  urlpatterns = patterns("",
      url(r'^list/$', ProfilesList.as_view(), name='list'),
-     url(r'^edit/$', ProfileEdit.as_view(), name='edit'),
+     url(r'^edit/$', login_required(ProfileEdit).as_view(), name='edit'),
  )
  
Add login required for profile edit
## Code Before:
from django.conf.urls.defaults import *
from django.contrib.auth.decorators import login_required
from profiles.views import (ProfilesList,
                            ProfileEdit,
)

urlpatterns = patterns("",
    url(r'^list/$', ProfilesList.as_view(), name='list'),
    url(r'^edit/$', ProfileEdit.as_view(), name='edit'),
)

## Instruction:
Add login required for profile edit
## Code After:
from django.conf.urls.defaults import *
from django.contrib.auth.decorators import login_required
from .views import ProfilesList, ProfileEdit

urlpatterns = patterns("",
    url(r'^list/$', ProfilesList.as_view(), name='list'),
    url(r'^edit/$', login_required(ProfileEdit).as_view(), name='edit'),
)
