-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP: Django 2 #1
base: master
Are you sure you want to change the base?
Conversation
@@ -0,0 +1,17 @@ | |||
[[source]] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ich verwende inzwischen poetry; bei pipenv wird für mich zu wenig wert auf backward-compat und so gelegt.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dann leg ich noch ein poetry file an.
README.md
Outdated
@@ -0,0 +1,14 @@ | |||
# oversight | |||
|
|||
Django based web application for Datalogging. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'data logging' eher klein und auseinander, englischer eigenname ist es wahrscheinlich keiner.
README.md
Outdated
* Overview of the lastest sensor values | ||
* Detailed view with the lastest values and a diagram showing the history | ||
* Compare multiple sensors using a diagram | ||
* Add Sensor with the django admin web interface |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sensor klein, Django groß ;=
README.md
Outdated
* Api to set and get sensor data | ||
* Logging daemon and web application are run in parallel | ||
* ansible scripts for easier setup on raspberry pi | ||
* Easy to include new Sensors |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wie oben
example/settings.py
Outdated
@@ -1,4 +1,4 @@ | |||
from django.conf.global_settings import TEMPLATE_CONTEXT_PROCESSORS | |||
#from django.conf.global_settings import TEMPLATE_CONTEXT_PROCESSORS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
weg damit
@@ -1,10 +1,10 @@ | |||
import logging | |||
import threading | |||
import Queue | |||
from SimpleXMLRPCServer import SimpleXMLRPCServer | |||
from multiprocessing import Queue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
das direkte äquivalent zu Queue.Queue
in python2 wäre queue.Queue
: https://docs.python.org/3.8/library/queue.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wird in dem Fall queue.task_done() überhaupt benötigt? Ich sehe kein queue.join, oder ähnliches.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stimmt wahrscheinlich; ich würde es allerdings lassen fallst den code mal umbaust (sauberer ist es auf jeden fall einen task zu quittieren)
oversight/root_urls.py
Outdated
url(r'^$', RedirectView.as_view(pattern_name='oversight_index')), | ||
) | ||
]+ static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wovon sind die staticfiles davor ausgeliefert worden?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Das Setup am Raspberry verwendet für static files nginx. Die Zeile oben war zum Testen/Entwickeln.
Wie würde man das richtig machen?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bei testen & entwicklen liefert Django die Sachen automatisch aus solange du:
- ./manage.py runserver verwendest
- staticfiles in INSTALLED_APPS ist
@@ -0,0 +1,18 @@ | |||
import os, sys |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Der sinn dieser datei erschliest sich mir nicht, das gleiche resultat sollte im Prinzip manage.py runserver
liefern
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ist runserver auch für den Produktiveinsatz geeignet? Momentan wird das server.py File aus dem ansible Ordner verwendet. Dieses baut darauf auf, da die imports umgeschrieben werden mussten.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nein runserver ist nicht für den Produktiveinsatz geeignet. Die Idee ist für die Entwicklung manage.py runserver
zu verwenden und produktiv das aus ansible; bzw gerne auch das von ansible hieher verschieben
Ich hab ein paar Änderungen gemacht um das ganze unter django 2 zum Laufen zu bekommen.
Außerdem habe ich ein README hinzugefügt.
Das README könnte man vermutlich auch noch erweitern mit einer Quelle (Masterarbeit etc)
Das ganze ist noch nicht sehr sauber gemacht, aber ich kenne mich mit django auch nicht so gut aus.