From 1abe75e849ffadd10e07f085e5ca21793dac98ef Mon Sep 17 00:00:00 2001 From: Jens Timmerman Date: Wed, 19 Aug 2020 19:29:24 +0200 Subject: [PATCH 1/5] Update README.md --- README.md | 141 +++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 125 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 54d2c57..61114ca 100644 --- a/README.md +++ b/README.md @@ -16,28 +16,137 @@ The object of this django app is to keep track of which goods you own, when they - Locations are recursive so things can be in the kitchen pantry closet on the 3rd shelf on the right and still be in the kitchen -# Getting started -`pip3 install django` +# Getting started (development/testing) +``` +dnf install -y python3-pip +pip3 install django +git clone git@github.com:JensTimmerman/im.git +cd im +python3 manage.py migrate +python3 manage.py runserver +```` -1. Add "inventory" to your INSTALLED_APPS setting like this:: - INSTALLED_APPS = [ - ... - 'inventory', - ] - -2. Include the inventory URLconf in your project urls.py like this:: - - path('inventory/', include('inventory.urls')), - -3. Run `python manage.py migrate` to create the polls models. - -4. Start the development server and visit http://127.0.0.1:8000/admin/ - to create a pantry inventory (you'll need the Admin app enabled). +Now you are running the development server, Visit http://127.0.0.1:8000/admin/ + to create a pantry inventory 5. Visit http://127.0.0.1:8000/inventory/ to view your inventory website. + +# installation +``` +pip install django psycopg2 gunicorn +git clone git@github.com:JensTimmerman/im.git +cd im +vim im/settings.py +``` +change key,: ''.join(random.SystemRandom().choice(string.printable) for i in range(50)) +set DEBUG=False +set allowed_hosts to the hosts you want to allow (e.g. [localhost, 127.0.0.1, 192.168.1.108, im.yourdomain] + +configure DATABASES to point to your database server +``` +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.postgresql_psycopg2', + 'NAME': 'inventorryapp', + 'USER': 'inventorryapp', + 'PASSWORD': '', + 'HOST': ':/home/im/inventorryapp/static/ + +``` +in /etc/nginx/nginx.conf +DNS: to do manually set up a cname for im to point to yourdomain +``` + server { + listen 80; + server_name im.yourdomain ; + location /static { + root /home/im/inventorryapp/static ; + } + location / { + proxy_pass http://192.168.122.6:8000; + proxy_redirect off ; + proxy_set_header Host $host ; + proxy_set_header X-Real-IP $remote_addr ; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for ; + proxy_max_temp_file_size 0 ; + client_max_body_size 10m ; + client_body_buffer_size 128k ; + proxy_connect_timeout 90 ; + proxy_send_timeout 90 ; + proxy_read_timeout 90 ; + proxy_buffer_size 4k ; + proxy_buffers 4 32k ; + proxy_busy_buffers_size 64k ; + proxy_temp_file_write_size 64k ; + } +``` +``` +pip3 install certbot-nginx +certbot -n --nginx -d im.yourodmain --hsts +``` + +browse to https://im.yourdomain + + # feature requests ## High - make expirations a calendar view, generate ics file to import From dc785181e40d69f109a7406c10a2aab0b8ce7511 Mon Sep 17 00:00:00 2001 From: Jens Timmerman Date: Wed, 19 Aug 2020 19:29:48 +0200 Subject: [PATCH 2/5] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 61114ca..151d6f5 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ git clone git@github.com:JensTimmerman/im.git cd im vim im/settings.py ``` -change key,: ''.join(random.SystemRandom().choice(string.printable) for i in range(50)) +change key,: `''.join(random.SystemRandom().choice(string.printable) for i in range(50))` set DEBUG=False set allowed_hosts to the hosts you want to allow (e.g. [localhost, 127.0.0.1, 192.168.1.108, im.yourdomain] From ff43a530394109eff9de87ed0b4a2e7efbf277b1 Mon Sep 17 00:00:00 2001 From: Jens Timmerman Date: Wed, 19 Aug 2020 19:32:15 +0200 Subject: [PATCH 3/5] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 151d6f5..19a9401 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ The object of this django app is to keep track of which goods you own, when they # Getting started (development/testing) ``` -dnf install -y python3-pip +dnf install -y python3-pip git pip3 install django git clone git@github.com:JensTimmerman/im.git cd im From 4dcc82402c524ba94314cbab99a5c7872811e993 Mon Sep 17 00:00:00 2001 From: Jens Timmerman Date: Wed, 19 Aug 2020 19:32:43 +0200 Subject: [PATCH 4/5] Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 19a9401..28e93d5 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,8 @@ Now you are running the development server, Visit http://127.0.0.1:8000/admin/ # installation ``` -pip install django psycopg2 gunicorn +dnf install python3-pip git +pip3 install django psycopg2 gunicorn git clone git@github.com:JensTimmerman/im.git cd im vim im/settings.py From 5b70fac504c87a308820de3febaf7b98a2bd3464 Mon Sep 17 00:00:00 2001 From: Jens Timmerman Date: Wed, 19 Aug 2020 19:50:45 +0200 Subject: [PATCH 5/5] Update README.md --- README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 28e93d5..b74ef30 100644 --- a/README.md +++ b/README.md @@ -22,9 +22,14 @@ dnf install -y python3-pip git pip3 install django git clone git@github.com:JensTimmerman/im.git cd im + python3 manage.py migrate +python3 manage.py createsuperuser +``` +add username and password for your admin login and start the development server +``` python3 manage.py runserver -```` +```