Learn Django

Edit Contact - Create URL

Now that the new contact functionality has been built we can create the edit contact functionality. This will build off of the existing resources already created. Start by creating the edit URL. Open /.../crmeasy/crmapp/contacts/urls.py and add the URL conf below.

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

contact_urls = patterns('',

    url(r'^$','crmapp.contacts.views.contact_detail', name="contact_detail"),
    url(r'^edit/$',
        'crmapp.contacts.views.contact_cru', name='contact_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 edit contact url"

Track your progress with a free account