Overview
In this assignment, you will gain experience using the Dash framework
to create a dashboard that interacts with the database. The dashboard
should prompt the user to input their name and password. This will
ensure that you have complied with your client’s security requirements
for database access. You will facilitate the authentication of dashboard
users by developing code that uses appropriate framework components.
These components should retrieve the username and password from the
dashboard user to provide authentication for MongoDB. This assignment is
intended to expose you to the Dash framework and give you practice with
the callbacks. You will
not
be required to integrate the username and password interface into your final dashboard for Project Two.
Note: This assignment requires you to use the “aacuser” account and
password that you set up back in the Module Three milestone. If you did
not successfully complete the milestone, follow the steps in Part II of
the milestone to set up the “aacuser” account before beginning this
assignment.
Prompt
You will be given starter code that implements a preliminary
dashboard and prompts the user for their username and password. You will
have to modify the code to add the appropriate calls to MongoDB, using
the
CRUD Python Module
that you completed as a part of Project One.
Important Note:
To avoid any possible confusion, the
authentication that you are building in this assignment will be passing
the username and password through to the MongoDB database. You will
not
be using the authentication component from the Dash framework itself.
- Open the
ModuleFiveAssignment.ipynbfile,
which contains the starter code for the dashboard and the
authentication interface. Upload this file into Apporto and open it
using the Jupyter Notebook application. Be sure to review all of the
starter code that you have been given. Pay special attention to the
import commands and the comments describing what each section of code
does.
- The code that you have been given provides you with a very basic dashboard. Add an
HTML component, such as a header, to create a unique identifier
for your dashboard. This unique identifier could be your name or a specific handle or image that is unique to you.
Customize the starter code that you have been given by developing
connections between the dashboard username/password interface and your
CRUD Python module. The dashboard should prompt the user for their
username and password, and return the output of the test query. Be sure
to complete each of the following:
Import the CRUD Python module
that you created for Project One.
Add the functionality in the callback routine for instantiation of your CRUD object. Remember to apply the user authentication when creating your CRUD object.
- Finally,
add functionality to test your dashboard connection to MongoDB. To do this, write code that returns the following read query: {"animal_type" : "Dog","name" : "Lucy"}.
IMPORTANT: Use the “aacuser” account and the password that you set up in the Module Three milestone.
Take a
screenshotof your dashboard as proof of
this execution. Your screenshot should show the prompt for the username
and password, and then the result of your test query. Your unique
identifier should also be visible in the screenshot.
A sample screenshot has been included below. Yours will differ slightly.
Guidelines for Submission
Submit a Word document containing the screenshot from your
executions. Use a screenshot tool, such as the Snipping Tool, for your
screenshot and be sure to enlarge the images in the Word document before
submitting. This will help make sure that your screenshot is an
appropriate size for your instructor to be able to read. Refer to the
Use Snipping Tool to Capture Screenshots
guide for help with taking screenshots.