kevinbowen777 / library

A lending library built using the Django web framework

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

library

Status GitHub Issues License

  • A lending library built using the Django 4.2.x web framework
Table of Contents

Features

  • Application

    • Add, update, and delete authors and books
    • Borrow, renew, and return books
    • image carousel
    • User registration with email verification & social(GitHub) login using django-allauth
    • Bootstrap4 & crispy-forms decorations
    • Customizable user profile pages with bio, profile pic, & country flags
    • For additional links to package resources used in this repository, see the Package Index
  • Dev/testing

  • run command menu

    (adapted from Nick Janetakis' helpful docker-django-example)

    You can run ./run to get a list of commands and each command has documentation in the run file itself. This comes in handy to run various Docker commands because sometimes these commands can be a bit long to type.

    If you get tired of typing ./run you can always create a shell alias with alias run=./run in your ~/.bash_aliases or equivalent file. Then you'll be able to run run instead of ./run.


Installation

  • git clone https://github.com/kevinbowen777/library.git
  • cd library
  • Local installation:
    • poetry shell
    • poetry install
    • Comment out the following lines in accounts/models.py: library_members, created = Group.objects.get_or_create(name="Library Members") librarians, created = Group.objects.get_or_create(name="Librarians")
    • python manage.py migrate
    • python manage.py shell_plus
      • Create the following groups in the shell:
        • Group.objects.get_or_create(name="Library Members")
        • Group.objects.get_or_create(name="Librarians")
    • Uncomment the lines previously indicated in accounts/models.py
    • python manage.py createsuperuser
    • python manage.py runserver
  • Docker installation:
    • docker compose up --build
    • docker compose exec web python manage.py migrate
    • docker compose exec web python manage.py createsuperuser Additional commands:
      • docker compose exec web python manage.py shell_plus (loads Django shell autoloading project models & classes)
      • docker run -it django-start-web bash (CLI access to container)
  • Browse to http://127.0.0.1:8000 or http://127.0.0.1:8000/resources/
  • Pre-commit:
    • To add the hook, run the following command in the poetry shell:
      • pre-commit install

Testing

  • docker compose exec web python manage.py test
  • coverage run -m pytest
  • Nox (includes sessions for black, lint, safety, tests)
    • testing supported for Python 3.9, 3.10, 3.11
    • e.g. nox, nox -rs lint-3.11, nox -s tests
      • nox
      • nox -s black-3.12
      • nox -s docs-3.11
      • nox -rs lint-3.9 (Use the 'r' flag to reuse existing session)
      • nox -s safety (will run tests against all Python versions)
      • nox -s tests

Application Demo

A live application demonstration:

TBD


Screenshots

Home page Home Page

Catalog Index Catalog index

Author list author_list

Book list Book List


Reporting Bugs

Visit the Issues page to view currently open bug reports or open a new issue.

About

A lending library built using the Django web framework

License:MIT License


Languages

Language:JavaScript 46.3%Language:CSS 31.5%Language:Python 13.7%Language:HTML 6.2%Language:Shell 1.8%Language:Dockerfile 0.3%Language:Procfile 0.0%