Learn Django

New Account - Create URL Conf

With the form created you can now create the URL conf. This configuration will specify a URL path, and a pointer to a view that you'll create in the next lesson. We will also name the URL so that it can be accessed in template files.

Step 1: Create the URL Configuration

Open /.../crmeasy/crmapp/urls.py file in your IDE. Locate the #Account related URLs section and update it as follows.

1
2
3
4
5
6
7
8
# Account related URLs
url(r'^account/new/$',
    'crmapp.accounts.views.account_cru', name='account_new'
),
url(r'^account/list/$',
    AccountList.as_view(), name='account_list'
),
url(r'^account/(?P<uuid>[\w-]+)/', include(account_urls)),

Step 2: 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 "added new account URL"

Track your progress with a free account