Learn Django

Checkpoint

In this chapter you continued to build the subscriber form functionality. You created the subscriber model and updated several resources including the view, form, and templates. In this lesson you'll go through the steps to verify you built everything correctly.

Verify on Local Computer

To verify the work on your local computer you are going to first fill out the new subscriber form, then check the Django admin tool to ensure the records were created.

First, start the development 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

Then open the Signup form. Fill out all of the fields on this form and click submit. If successful you should be redirected to a URL that doesn't exist (http://127.0.0.1:8000/success/).

Next, open the Admin tool. Login if necessary. Check both the Users and Subscribers pages to see if the record you created in the previous step show up.

Verify on Heroku

If everything is working on your local computer you can deploy your changes to Heroku. This requires deploying the code and running the database migration.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# push changes to Heroku
(venv)$ git push -f heroku subscriber_form_part_2:master

# create the migration
(venv)$ heroku run python manage.py makemigrations subscribers

# apply the migration
(venv)$ heroku run python manage.py migrate subscribers

# open the Heroku app
(venv)$ heroku open

Then go to your Heroku app's signup page and fill it out to create a user. After that, go to your Heroku app's admin tool to verify the records were created.

Track your progress with a free account