Skip to content

Many to many links and categories using Flask and Postgresql

Notifications You must be signed in to change notification settings

rebeccapeltz/links-and-cats

Repository files navigation

final-project

"Link Cat": Categorized Links

Link Cat homepage

This app provides a way for the user to create an account and then save and categorize links that they find on the web.

At this stage of dvelopment that user can

  • create an account
  • create public and private links
  • view all public links (and toggle between) viewing "just public", "just private" or both public and private links
  • create, delete, and update categories

An instance of this app has been deployed to Heroku and can be seen here:

Deployed to Heroku

Link Cat

Backlog features

provide categorical filtering provide an API so that front end frameworks and Vanilla JavaScript can take advantage of this data.

Data

There is a many to many relationship between links and categories. To bootstrap the data you can run these scripts in this order.

  1. create.py Create the database This script will drop all tables before creating
  2. data/populate_user.py Create a user
  3. data/import_categories.py Import categories from categories.csv
  4. data/populate_links.py Add links their categories

If you want to manually delete data from tables, open a SQL window (pgAdmin 4) delete from delete from link_category delete from categories delete from links delete from users

Instructions for Deployment to Heroku

Steps to depoly to heroku

  1. virtualenv env
  2. pip3 install flask
  3. pip3 install gunicorn
  4. git init
  5. add .gitignore with env
  6. add Procfile with web: gunicorn app:app
  7. run pip3 freeze > requirements.txt
  8. git commit -m"...
  9. heroku login
  10. heroku create
  11. git push heroku master
  12. heroku open

Create Database

  1. Navigate to https://www.heroku.com/, and create an account if you don’t already have one.
  2. On Heroku’s Dashboard, click “New” and choose “Create new app.” Give your app a name, and click “Create app.”
  3. On your app’s “Overview” page, click the “Configure Add-ons” button.
  4. In the “Add-ons” section of the page, type in and select “Heroku Postgres.”
  5. Choose the “Hobby Dev - Free” plan, which will give you access to a free PostgreSQL database that will support up to 10,000 rows of data. Click “Provision.”
  6. Now, click the “Heroku Postgres :: Database” link.
  7. You should now be on your database’s overview page. Click on “Settings”, and then “View Credentials.” This is the information you’ll need to log into your database.

About

Many to many links and categories using Flask and Postgresql

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published