Skip to content

Web app to test case Managers for models in Django. The App consists in listing on html page (http://localhost:8000/author-list/) all the Authors with the sum of copies sold of all their books.

Notifications You must be signed in to change notification settings

Fantaso/django-model-managers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Django Model Managers App

Web app to test case Managers for models in Django. The App consists in listing on html page (http://localhost:8000/author-list/) all the Authors with the sum of copies sold of all their books.

Test case allows the user to visit website to view a list of all authors and their amount of books sold per author.

It is partly tested as only and was developed as showcase only.

How Django Models Managers Works:



Index:

  • Installation

    1. Installing Django Models Managers App
    2. Instructions to test with django-debug-toolbar
  • Usage:

    1. Available Endpoints
    2. Tests INFO
  • Information:

  • Maintainer



Installation:

1.Installing Django Models Managers App

  1. Clone repository and go inside the repository folder "django-model-managers"
git clone https://github.com/Fantaso/django-model-managers.git
  1. Create your virtualenv and install the packages
pip install -r requirements.txt
  1. Migrate the database.
python manage.py makemigrations && python manage.py migrate
  1. Run the application.
python manage.py runserver

2.Instructions to test with django-debug-toolbar

  1. Create a superuser in order to access the Django Admin app and follow the instructions
python manage.py createsuperuser
  1. Go to http://localhost:8000/admin and login with your username and password created in the previous step

  2. Once in the Admin app, add as many Authors and Books to your database.

  3. Once you have added all authors and books go to the endpoints available and you should see a webpage with a list of all Authors and Book information rendered with the django Debug Toolbar on the side. Just click the logo "DjDT" on the right side of the website and check it.


USAGE

1. Endpoint List

URI Example: http://localhost:8000/author-list

URI Example: http://localhost:8000/author-list-complex


2. Tests INFO

A small TestCase was done to check the manager annotate_with_copies_sold query method since, to tested over the webapp template at eh endpoint of 'author-list/' or 'author-list-complex/' will need extra requirements like migrating, creating a superuser and adding on the admin panel new Authors and Books to the local database

  1. Run the Django Models Managers app tests locally with:
python manage.py test

Information:

Technology Stack
Python back-end Back-End
Django django Web Framework
Django Debug toolbar django-debug-toolbar Browser Debug Tool



Maintainer

Get in touch -–> Github

About

Web app to test case Managers for models in Django. The App consists in listing on html page (http://localhost:8000/author-list/) all the Authors with the sum of copies sold of all their books.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published