= PyInventory

Web based management to catalog things including state and location etc. using Python/Django.

Current status: Just start the project. Nothing is done, nothing is useable, yet ;)

Pull requests welcome!

| {{https://github.com/jedie/PyInventory/workflows/test/badge.svg?branch=master|Build Status on github}} | [[https://github.com/jedie/PyInventory/actions|github.com/jedie/PyInventory/actions]] |
| {{https://travis-ci.org/jedie/PyInventory.svg|Build Status on travis-ci.org}} | [[https://travis-ci.org/jedie/PyInventory/|travis-ci.org/jedie/PyInventory]] |
| {{https://codecov.io/gh/jedie/PyInventory/branch/master/graph/badge.svg|Coverage Status on codecov.io}} | [[https://codecov.io/gh/jedie/PyInventory|codecov.io/gh/jedie/PyInventory]] |
| {{https://coveralls.io/repos/jedie/PyInventory/badge.svg|Coverage Status on coveralls.io}} | [[https://coveralls.io/r/jedie/PyInventory|coveralls.io/r/jedie/PyInventory]] |
| {{https://landscape.io/github/jedie/PyInventory/master/landscape.svg|Status on landscape.io}} | [[https://landscape.io/github/jedie/PyInventory/master|landscape.io/github/jedie/PyInventory/master]] |


== about

The focus of this project is on the management of retro computing hardware.

Plan:

* Web-based
* Multiuser ready
* Chaotic warehousing
** Grouped "Storage": Graphics card is in computer XY
* Data structure kept as general as possible
* You should be able to add the following to the items:
** Storage location
** State
** Pictures
** URLs
** receiving and delivering (when, from whom, at what price, etc.)
** Information: Publicly visible yes/no
* A public list of existing items (think about it, you can set in your profile if you want to)
* administration a wish & exchange list

any many more... ;)


== install

There exists two kind of installation/usage:

* local virtualenv (without docker)
* production use with docker-compose

see below

=== prepare

{{{
~$ git clone https://github.com/jedie/PyInventory.git
~$ cd PyInventory
~/PyInventory$ make
help                 List all commands
install-poetry       install or update poetry
install              install PyInventory via poetry
manage-update        Collectstatic + makemigration + migrate
update               update the sources and installation
lint                 Run code formatters and linter
fix-code-style       Fix code formatting
tox-listenvs         List all tox test environments
tox                  Run pytest via tox with all environments
tox-py36             Run pytest via tox with *python v3.6*
tox-py37             Run pytest via tox with *python v3.7*
tox-py38             Run pytest via tox with *python v3.8*
pytest               Run pytest
update-rst-readme    update README.rst from README.creole
publish              Release new version to PyPi
run-dev-server       Run the django dev server in endless loop.
messages             Make and compile locales message files
run-server           Run the gunicorn server in endless loop.
backup               Backup everything
create-starter       Create starter file.
install-compose      Install "docker-compose", too
up                   Start containers via docker-compose
down                 Stop all containers
prune                Cleanup docker
build                Update docker container build
logs                 Display docker logs from all containers
dbbackup             Backup database
dbrestore            Restore a database backup
restart              Restart all containers
}}}


=== local install without docker

{{{
# install or update poetry:
~/PyInventory$ make install-poetry

# install PyInventory via poetry:
~/PyInventory$ make install
...

# Collectstatic + makemigration + migrate:
~/PyInventory$ make manage-update

# Create a django super user:
~/PyInventory$ ./manage.sh createsuperuser

# start local dev. web server:
~/PyInventory$ make run-dev-server
}}}

The web page is available via: {{{http://127.0.0.1:8000/}}}


=== docker-compose usage

Install docker, e.g.: https://docs.docker.com/engine/install/ubuntu/

{{{
# Install "docker-compose" via poetry extras:
~/PyInventory$ make install-compose
}}}

Create a {{{.env}}} file with these content, e.g.:
{{{
# Public domain or "localhost" for local testing:
HOSTNAME=localhost

# eMail address for Let's encrypt (Use "internal" for self signed https certificates):
LETSENCRYPT_EMAIL=internal
}}}
e.g. in production:
{{{
HOSTNAME=domain.tld
LETSENCRYPT_EMAIL=webmaster@domain.tld
}}}

Start containers via docker-compose:
{{{
~/PyInventory$ make up
}}}

Notes: At the first start it takes a little while until the database is created

Create first super user:
{{{
~/PyInventory$ make docker_createsuperuser
}}}


== Screenshots

{{https://raw.githubusercontent.com/jedie/jedie.github.io/master/screenshots/PyInventory/PyInventory v0.2.0 screenshot 1.png|PyInventory v0.2.0 screenshot 1.png}}

----

{{https://raw.githubusercontent.com/jedie/jedie.github.io/master/screenshots/PyInventory/PyInventory v0.1.0 screenshot 2.png|PyInventory v0.1.0 screenshot 2.png}}

----

{{https://raw.githubusercontent.com/jedie/jedie.github.io/master/screenshots/PyInventory/PyInventory v0.1.0 screenshot 3.png|PyInventory v0.1.0 screenshot 3.png}}

----


== Multi user usage

PyInventory supports multiple users. The idea:

* Every normal user sees only his own created database entries
* All users used the Django admin

Note: All created Tags are shared for all existing users!


So setup a normal user:

* Set "Staff status"
* Unset "Superuser status"
* Add user to "normal_user" group
* Don't add any additional permissions

e.g.:

{{https://raw.githubusercontent.com/jedie/jedie.github.io/master/screenshots/PyInventory/PyInventory normal user example.png|normal user example}}


== Backwards-incompatible changes

Nothing, yet ;)


== history

* [[https://github.com/jedie/PyInventory/compare/v0.2.0...master|compare v0.2.0...master]] **dev**
** tbc
* [[https://github.com/jedie/PyInventory/compare/v0.3.0...v0.3.1|v0.3.1 - 26.10.2020]]
** Bugfix missing translations
* [[https://github.com/jedie/PyInventory/compare/v0.2.0...v0.3.0|v0.3.0 - 26.10.2020]]
** setup production usage:
*** Use [[https://caddyserver.com/|caddy server]] as reverse proxy
*** Use uWSGI as application server
*** autogenerate {{{secret.txt}}} file for {{{settings.SECRET_KEY}}}
*** Fix settings
** split settings for local development and production use
** Bugfix init: move "setup user group" from checks into "post migrate" signal handler
** Bugfix for using manage commands {{{dumpdata}}} and {{{loaddata}}}
* [[https://github.com/jedie/PyInventory/compare/v0.1.0...v0.2.0|v0.2.0 - 24.10.2020]]
** Simplify item change list by nested item
** Activate Django-Import/Export
** Implement multi user usage
** Add Django-dbbackup
** Add docker-compose usage
* [[https://github.com/jedie/PyInventory/compare/v0.0.1...v0.1.0|v0.1.0 - 17.10.2020]]
** Enhance models, admin and finish project setup
* v0.0.1 - 14.10.2020
** Just create a pre-alpha release to save the PyPi package name ;)


== links ==

| Homepage   | http://github.com/jedie/PyInventory
| PyPi       | https://pypi.org/project/PyInventory/

Discuss here:

* [[https://www.vogons.org/viewtopic.php?f=5&t=77285|vogons.org Forum Thread (en)]]
* [[https://forum.classic-computing.de/forum/index.php?thread/21738-opensource-projekt-pyinventory-web-basierte-verwaltung-um-seine-dinge-zu-katalog/|VzEkC e. V. Forum Thread (de)]]
* [[https://dosreloaded.de/forum/index.php?thread/3702-pyinventory-retro-sammlung-katalogisieren/|dosreloaded.de Forum Thread (de)]]

== donation ==

* [[https://www.paypal.me/JensDiemer|paypal.me/JensDiemer]]
* [[https://flattr.com/submit/auto?uid=jedie&url=https%3A%2F%2Fgithub.com%2Fjedie%2FPyInventory%2F|Flattr This!]]
* Send [[http://www.bitcoin.org/|Bitcoins]] to [[https://blockexplorer.com/address/1823RZ5Md1Q2X5aSXRC5LRPcYdveCiVX6F|1823RZ5Md1Q2X5aSXRC5LRPcYdveCiVX6F]]
