Skip to content

LeoSnek/libraryapp-hackathon-python-starthere

 
 

Repository files navigation

Setup

To set up this project on your own machine, perform these steps.

  1. Fork this repository, then clone it. Fork it via the Github website, then clone it with either Github desktop or the command line (if you've got the ssh keys set up)
$ git clone git@github.com:GirlsCodeMK/libraryapp-hackathon-python-starthere.git
  1. Once you have a copy of the repository, open a terminal in that directory
$ cd /path/to/libraryapp-hackathon-python-starthere/
  1. Once there, create and activate a virtual environment for the project
$ python3 -m venv gcmk
$ source gcmk/bin/activate
  1. Install the required libraries, such as Django
(gcmk) $ pip install -r requirements.txt
  1. Check you have the correct version
(gcmk) $ python -m django --version
2.1.4
  1. Run a migration to create the database
(gcmk) $ python manage.py migrate

This migration creates the Librarian and Library user groups and assigns the correct permissions to them.

Create users and records

There are two options here: either use the pre-populated sample data, or create users and data yourseelf.

Using sample data (recommended)

After running migrate, pick one of the datasets to include in the database.

  1. Sample users
(gcmk) $ python manage.py loaddata library-user.json
  1. Sample users, and sample books & loans
(gcmk) $ python manage.py loaddata library-user-library.json

Then run the server:

(gcmk) $ python manage.py runserver

and visit the library site (127.0.0.1:8000/library) in a web browser. The admin site is at 127.0.0.1:8000/admin should you need it.

Creating users and data by hand

  1. Create a superuser
(gcmk) $ python manage.py createsuperuser
  1. Run the server, and open the admin site (127.0.0.1:8000/admin) in a web browser
(gcmk) $ python manage.py runserver
  1. In the admin site, create some users, books, copies, and loans. Create at least one librarian and one library-user.

Links

The Django documentation is essential reading, including the Django "getting started" tutorial.

This application is based on the DjangoGirls tutorial systemm and the Mozilla Development tutorial.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 69.9%
  • HTML 29.9%
  • CSS 0.2%