Learn Django

Checkpoint - Edit Contact

In this chapter you learned how to build the create, edit, and delete contact functionality. Mid-way through the chapter you verified that the create contact functionality was working. In this lesson you'll check to see if the edit and delete functionality works. If it does you'll push the changes to Heroku.

Verify on Local Computer

To verify the work on your local computer you need to start the dev web server.

1
2
3
4
5
6
# make sure you're at an activated terminal/cmd in the crmeasy dir
(venv)$ pwd
/<your_path>/crmeasy

# start the development server
(venv)$ python manage.py runserver

Edit a Contact

Follow these steps to see if the Edit Contact feature works:

  1. Open the Account List page
  2. Click on an account to open its detail page
  3. Locate the contacts section. If a contact is listed there, click on the pen icon to edit it. If no contact is showing, click on the 'New Contact' link to add a contact; then click on the pen icon to edit it

Delete a Contact

Follow these steps to verify if the Delete Contact feature works:

  1. With the account detail page still open, click on the x icon
  2. When the confirmation page loads, click Confirm to delete the contact. You should get directed back to the account detail page

Verify on Heroku

If everything is working on your local computer you can deploy your changes to Heroku.

1
2
3
4
5
# push changes to Heroku
(venv)$ git push -f heroku contacts_part_2:master

# open the Heroku app
(venv)$ heroku open

Once the Heroku app opens, login if necessary, and follow the steps above to test if the edit and delete contact capability is working correctly.

Track your progress with a free account