Skip to content

WIP: Django 2#1

Open
feanor12 wants to merge 10 commits intoapollo13:masterfrom
feanor12:django2
Open

WIP: Django 2#1
feanor12 wants to merge 10 commits intoapollo13:masterfrom
feanor12:django2

Conversation

@feanor12
Copy link
Copy Markdown

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.

@@ -0,0 +1,17 @@
[[source]]
Copy link
Copy Markdown
Owner

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.

Copy link
Copy Markdown
Author

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.
Copy link
Copy Markdown
Owner

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
Copy link
Copy Markdown
Owner

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
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wie oben

@@ -1,4 +1,4 @@
from django.conf.global_settings import TEMPLATE_CONTEXT_PROCESSORS
#from django.conf.global_settings import TEMPLATE_CONTEXT_PROCESSORS
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

weg damit

import threading
import Queue
from SimpleXMLRPCServer import SimpleXMLRPCServer
from multiprocessing import Queue
Copy link
Copy Markdown
Owner

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

Copy link
Copy Markdown
Author

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.

Copy link
Copy Markdown
Owner

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)

url(r'^admin/', admin.site.urls),
url(r'^$', RedirectView.as_view(pattern_name='oversight_index')),
)
]+ static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
Copy link
Copy Markdown
Owner

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?

Copy link
Copy Markdown
Author

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?

Copy link
Copy Markdown
Owner

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
Copy link
Copy Markdown
Owner

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

Copy link
Copy Markdown
Author

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.

Copy link
Copy Markdown
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants