Giter Club home page Giter Club logo

book-browse's Introduction

Book Browse

A Django app which uses the Google Books API to allow a to user search for and see information about books.

This has been quite the challenge for me - I have little more than beginner Python, and have never used it for the web. I've also never written a Django app before, so this has been a huge learning curve!

Running locally

To install:

  • clone this repo
  • in your terminal, run:
> brew install python3 #if you don't already have python3
> python3 -m pip install -r requirements.txt

To run locally:

> python3 manage.py runserver

To test:

> python3 manage.py test

I've provided a .env.example file in the bookbrowse folder - to use the app you will need to rename this to .env and add your own environment variables.

My thought process

Why I chose Django

I do not know much Python, and as I had a short timescale in which to build this project I did not feel comfortable building a server in 'vanilla' Python. I don't understand the language well enough to know when I would be making fundamental mistakes that would leave the site vulnerable or just broken.

I soon came across Django as an option - having little idea of how I would get a Python site deployed on Heroku, I looked into their docs and found an example deployment which used Python with Django. Researching Django, I found that it was popular and well documented, and decided that as I was on unfamiliar ground, it made sense to follow a route that had been clearly documented with plenty of examples.

Although I feel like a spent a large amount of my time on DevOps and getting the framework deployed, Django takes care of a lot of the lower level processes that I did not feel comfortable writing myself, and allowed me to write the part I did understand: making an API call and templating the result on the page.

In retrospective, I wish I had spent more time researching other framework options. Django is well-documented, but it contained features I didn't need like a database and as a fairly opinionated framework, I found that I had to jump through a lot of hoops to get the app deployed.

Testing

I've written a few tests with the inbuilt Django testing library. There seem to be many different options for testing and I would like to learn more about them, but for now I've had to settle for some simple test cases (literally, I used the SimpleTestCase subclass...). These tests check my util function works, my url paths work and my html templates render correctly.

BEM

I've used the BEM class naming convention to style my CSS.

Features I'd like to add

  • Search by author
  • Search by genre
  • Filter / sort functionality
  • 'Favourite' books
  • Autocomplete on search

book-browse's People

Contributors

starsuit avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.