Get a random record!
Try it out at https://spinyorecord.herokuapp.com/
This goes into Discogs, which is a pretty good music website, and just picks out a random album for you.
Not much else to say here...
ResourcesLocal app
- Make a Flask app
https://runestone.academy/runestone/books/published/thinkcspy/WebApps/07-InputForAFlaskWebApplication.html
Deployment
-
Overview to deploy with Heroku
which sounds cuter and easier than Amazon or Google
https://pythonhow.com/deploying-your-web-application-to-the-cloud/ -
Generating a requirements file
https://stackoverflow.com/questions/40192651/django-pip-freeze-results-in-empty-file -
The official Windows help
Notice the special Windows procfile...
https://devcenter.heroku.com/articles/getting-started-with-python#deploy-the-app -
Make a Procfile with Waitress
https://books.google.com/books?id=cVlPDwAAQBAJ&pg=PT282&lpg=PT282&dq=%22waitress%22+procfile&source=bl&ots=xNJYeoYq9_&sig=ACfU3U1aUYxH6Zjxy5pi-jXDJdf4CZF_2w&hl=en&sa=X&ved=2ahUKEwioxOPcitzoAhWCl3IEHSGsAwoQ6AEwBnoECAkQKQ#v=onepage&q=%22waitress%22%20procfile&f=false
If you're on Windows, you can't use gunicorn, which is what the tutorial wants you to use. (The tutorial does have an example Windows procfile, but that's only applicable for local use.)
Connect to Discogs
-
Overview of steps to use Discogs API
https://www.discogs.com/developers#page:home,header:home-quickstart -
Get a developer token
https://auth.discogs.com/login?service=https%3A//www.discogs.com/login%3Freturn_to%3D%252Fsettings%252Fdevelopers%253F&nologin=1 -
Understanding what's possible with client object, search object
https://github.com/discogs/discogs_client -
More on search object
https://www.discogs.com/developers#page:database,header:database-search -
More on release object
https://www.discogs.com/developers#page:database,header:database-artist-releases -
More on master object
https://www.discogs.com/developers#page:database,header:database-master-release -
Tip from radum on discogs forums on randomizing albums
https://www.discogs.com/forum/thread/815327?page=1#8095702
Stupid HTML stuff
Only read if you want to reduce your brain cells.
-
Tip from furas on stackoverflow on creating buttons
https://stackoverflow.com/questions/61178220/html-form-python-flask-have-a-button-submit-a-unique-parameter-to-method/61179186#61179186 -
Tip from Elisabeth Strunk on stackoverflow on render_html as part of the flask package
https://stackoverflow.com/questions/61192187/refactor-rendering-flask-form-with-multiple-similar-inputs -
A more guided introduction to render_html
https://code-maven.com/using-templates-in-flask -
COLORS; in html
https://www.includehelp.com/code-snippets/change-button-color-in-html.aspx
Contributions
FRONT END HELP WANTED
No Youtube playlist?: Some of these albums don't have a readily accessibly Youtube playlist in the sidebar. Personally, I then Google the albums and find at least one song by the same artist to play. So, I think these albums are still valid, and that the current method kind of negates the one click "spin the record" experience. Possibly? link to their SoundCloud, YT, or BandCamp presence.
Other small fixes
Requirements: The requirements file is bloated because I didn't use a different
virtual env.