In this project:
- An instructor of a class where projects are due can log in and submit to a form
- A word representing the theme of the student's project (e.g.
moviesorfood) - The name of the student's project
- The student's name
- A word representing the theme of the student's project (e.g.
- On the submission, the word representing the theme of the student project is searched on Flickr for 10 photos
- Three random photos from that search are saved to the database and associated with that project
- The application saves: each entered student, each entered project, and photos
- Allows each logged-in user (an instructor) to see all of the students they've entered, and the associated projects and photos (see navigation in the application)
- One logged in instructor cannot see another logged in instructor's students or the students' projects
flasklibrary and allflask-related modules we have used in SI364- The module
flickrapimust be pip installed
- You must have a file called
flickr_api_data.pyin the same directory as theSI364final.pyfile, of the same format as the one included, but with API key filled in. You can get an API key at . - NOTE: A sample file with API keys is included in a file on Canvas for SI 364, so as not to include it on GitHub. (Of course, this repository is private, but just in case I decide to change that, I am not committing any API keys to GitHub!)
cdto the directory in which the app files live- run, in Python
python SI364final.py runserver - You should see a home page prompting you to log in or register
- Log in (register if you don't have an account, and then log in)
- You should see a form prompting you for a student name and a word representing the theme of their project
- For example, type
Jackie Coheninto the first box andphotosinto the second box. - You should be redirected to a page that renders photos, and can use the navigation to see other pages!
- For example, type
/index->index.html/all_photos->all_photos.html(login restricted)/all_searches->searches.html(login restricted)/your_students->students.html(login restricted)/projects->projects.html(login restricted)/student/<name>->specific_student.html(login restricted)/project/<ident>->specific_project.html(login restricted)
My midterm allowed an instructor to enter a student name and name of the student's project, but this application has a brand new set of API requests, thus saving information that the midterm didn't save about Flickr photos, and this app saves more information about each student project. There is also a new relationship between projects and photos, and between photos and search terms, neither of which existed in my midterm, so I have built up all of the midterm components to make them different and/or more complicated.
Note that I've bolded AND checked off all of the requirements I DID complete, and left alone the requirements that I did not, in a clear, readable way TODO TODO TODO
-
Create a
README.mdfile for your app that includes the full list of requirements from this page. The ones you have completed should be bolded or checked off. -
The
README.mdfile should use markdown formatting and be clear / easy to read. -
The
README.mdfile should include a 1-paragraph (brief OK) description of what your application does -
The
README.mdfile should include a detailed explanation of how a user can user the running application (e.g. log in and see what, be able to save what, enter what, search for what... Give us examples of data to enter if it's not obviously stated in the app UI!) -
The
README.mdfile should include a list of every module that must be installed withpipif it's something you installed that we didn't use in a class session. If there are none, you should note that there are no additional modules to install. -
The
README.mdfile should include a list of all of the routes that exist in the app and the names of the templates each one should render OR, if a route does not render a template, what it returns (e.g./form->form.html, like the list we provided in the instructions for HW2 and like you had to on the midterm, or/delete -> deletes a song and redirects to index page, etc).
-
Ensure that your
SI364final.pyfile has all the setup (app.configvalues, import statements, code to run the app if that file is run, etc) necessary to run the Flask application, and the application runs correctly onhttp://localhost:5000(and the other routes you set up). -
A user should be able to load
http://localhost:5000and see the first page they ought to see on the application. -
Include navigation in
base.htmlwith links (usinga hreftags) that lead to every other page in the application that a user should be able to click on. (e.g. in the lecture examples from the Feb 9 lecture, like this ) -
Ensure that all templates in the application inherit (using template inheritance, with
extends) frombase.htmland include at least one additionalblock. -
Must use user authentication (which should be based on the code you were provided to do this e.g. in HW4).
-
Must have data associated with a user and at least 2 routes besides
logoutthat can only be seen by logged-in users. -
At least 3 model classes besides the
Userclass. -
At least one one:many relationship that works properly built between 2 models.
-
At least one many:many relationship that works properly built between 2 models.
-
Successfully save data to each table.
-
Successfully query data from each of your models (so query at least one column, or all data, from every database table you have a model for) and use it to effect in the application (e.g. won't count if you make a query that has no effect on what you see, what is saved, or anything that happens in the app).
-
At least one query of data using an
.all()method and send the results of that query to a template. -
At least one query of data using a
.filter_by(...and show the results of that query directly (e.g. by sending the results to a template) or indirectly (e.g. using the results of the query to make a request to an API or save other data to a table). -
At least one helper function that is not a
get_or_createfunction should be defined and invoked in the application. -
At least two
get_or_createfunctions should be defined and invoked in the application (such that information can be saved without being duplicated / encountering errors). -
At least one error handler for a 404 error and a corresponding template.
-
At least one error handler for any other error (pick one -- 500? 403?) and a corresponding template. -- Oops, I forgot these and didn't do them. So I haven't bolded them :(
-
Include at least 4 template
.htmlfiles in addition to the error handling template files. -
At least one Jinja template for loop and at least two Jinja template conditionals should occur amongst the templates.
-
At least one request to a REST API that is based on data submitted in a WTForm OR data accessed in another way online (e.g. scraping with BeautifulSoup that does accord with other involved sites' Terms of Service, etc).
-
Your application should use data from a REST API or other source such that the application processes the data in some way and saves some information that came from the source to the database (in some way).
-
At least one WTForm that sends data with a
GETrequest to a new page. -
At least one WTForm that sends data with a
POSTrequest to the same page. (NOT counting the login or registration forms provided for you in class.) -
At least one WTForm that sends data with a
POSTrequest to a new page. (NOT counting the login or registration forms provided for you in class.) -
At least two custom validators for a field in a WTForm, NOT counting the custom validators included in the log in/auth code.
-
Include at least one way to update items saved in the database in the application (like in HW5).
-
Include at least one way to delete items saved in the database in the application (also like in HW5).
-
Include at least one use of
redirect. -
Include at least two uses of
url_for. (HINT: Likely you'll need to use this several times, really.) -
Have at least 5 view functions that are not included with the code we have provided. (But you may have more! Make sure you include ALL view functions in the app in the documentation and navigation as instructed above.)
Note: Maximum possible % is 102%.
- [x] (100 points) Include a use of an AJAX request in your application that accesses and displays useful (for use of your application) data.
- (100 points) Create, run, and commit at least one migration.
- (100 points) Include file upload in your application and save/use the results of the file. (We did not explicitly learn this in class, but there is information available about it both online and in the Grinberg book.)
- (100 points) Deploy the application to the internet (Heroku) — only counts if it is up when we grade / you can show proof it is up at a URL and tell us what the URL is in the README. (Heroku deployment as we taught you is 100% free so this will not cost anything.)
- [x] (100 points) Implement user sign-in with OAuth (from any other service), and include that you need a specific-service account in the README, in the same section as the list of modules that must be installed.
All set!