Learn Django

Edit Comm - Create URL

At this point the application should be able to create new communications. We can now focus on creating the resources required to give users the ability to edit existing communication records. Users can perform this action by going to the /comm/<uuid>/edit/ URL. This lesson will show you how to create that config.

Open /.../crmeasy/crmapp/communications/urls.py in your IDE. Add the following URL conf to the file.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
from django.conf.urls import patterns, url

comm_urls = patterns('',

    url(r'^$',
        'crmapp.communications.views.comm_detail', name="comm_detail"
    ),
    url(r'^edit/$',
        'crmapp.communications.views.comm_cru', name='comm_update'
    ),

)

Commit Changes

Execute these commands to commit your changes in Git.

1
2
3
4
5
# add files
(venv)$ git add .

# commit files
(venv)$ git commit -m "created the edit communication URL"

Track your progress with a free account