Giter Site home page Giter Site logo

book-shelf's Introduction

Django Book Shelf Project

This is a django project that shelfs books

This shelf can allow admin users perform the following operationns

  • Adding new books
  • Archiving stolen or lost books
  • Delete books

This project was done using Python Programming Language and the Django Web FrameWork


Here are the steps in Running the project.

  1. Start your code editor preferably visual studio code
  2. Open the folder that contains the bookshelf project after ypu have cloned it
  3. Intalll the crispy forms library
  4. Next run python manage.py migrate to migrate all models to the database schema
  5. Next run python manage.py makemigrations, this will automatically make migrations for all the app present in the project folder
  6. Next run python manage.py migrate again to finally move all migrations
  7. Finally you can run the python server using python manage.py runserver you can decide to add your desired port number e.g python manage.py runserver 5000. This is how we run teh server if we wanted to use port 50000
  8. Our server should be up and running

Creating our SuperUser

  1. Quit the server by using the keyboard interrupt CTRL + C
  2. Run the create superuser command using python manage.py createsuperuser
  3. This will prompt us for our details such as username, email address, password and password agai which is to validate our password
  • Enter Username(hit enter to use the default omputer name)
  • Email Address hit enter to leave blank
  • Enter password and
  • Enter password (again)
  • With this few steps our superuser has been created
  1. Re-run the server again

Operating the Book Shelf Project

After we run our Python server running on port 8000 The default page takes us to the index page which is the book_list.html page

  • The booklist page is like this Endpoint http://127.0.0.1/ - Represents the book list view homepage-no-book

  • Next we login our superuser Endpoint http://127.0.0.1:8000/users/login - Representing the users login page login-admin

  • After logging in as super user we'll be redirected to the homepage which contains no book, let us add new books, Endpoint http://127.0.0.1:8000/users/login Use username=admin and password=admin admin-no-book

  • Our add a new book page looks like this Endpoint http://127.0.0.1:8000/new back to the list but now we have been authenticated as a superuser amin-add-new

After adding some images we'll have these view Endpoint http://127.0.0.1:8000/- for the first page showing only three books admin-added-image1

Endpoint http://127.0.0.1:8000/?page=2 - For the second page admin-added-image2

Endpoint http://127.0.0.1:8000/?page=3 admin-added-image3

Note: It can contain as many endpoints we want as long as we continue to add images

  • Checking the details of what we have built looks like this Endpoint http://127.0.0.1:8000/book/detail/9 - Gives the detail of the 9th book admin-detail-page-1 admin-detail-page-2

  • Editing the the books have the following look Endpoint http://127.0.0.1:8000/book/edit/9 - This is the endpoint for editing item 9 admin-edit-page-1 admin-edit-page-2

  • Archiving the book looks like Endpoint http://127.0.0.1:8000/book/archive/9 for archiving the 9th object admin-archived-images

  • Deleting a book looks like Endpoint http://127.0.0.1:8000/book/delete/3 for deleting teh 3rd Item admin-confirm-delete-page

  • Logging Out looks like Endpoint http://127.0.0.1:8000/users/logout to log the user out login-admin

  • Registering another user whi is not a superuser and viewing the details of each book. Meanwhile for every other view operations is not functional because he/she is not admin

  • Active user sign up i.e means a user that is not a superuser new-user-signin active-user-login incorrect-login-details active-user-login-homepage active-user-detail-page-1 active-user-detail-page-2

book-shelf's People

Contributors

nwokporochukwuebuka avatar

Stargazers

 avatar

Watchers

 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.