mirror of
https://github.com/KevinMidboe/Node-Com-Handler.git
synced 2026-01-28 20:25:41 +00:00
Folder that holds database for future plans of all contentes of Plex
Library and system info.
This commit is contained in:
0
apolloActivity/plex/__init__.py
Normal file
0
apolloActivity/plex/__init__.py
Normal file
BIN
apolloActivity/plex/__pycache__/__init__.cpython-34.pyc
Normal file
BIN
apolloActivity/plex/__pycache__/__init__.cpython-34.pyc
Normal file
Binary file not shown.
BIN
apolloActivity/plex/__pycache__/admin.cpython-34.pyc
Normal file
BIN
apolloActivity/plex/__pycache__/admin.cpython-34.pyc
Normal file
Binary file not shown.
BIN
apolloActivity/plex/__pycache__/apps.cpython-34.pyc
Normal file
BIN
apolloActivity/plex/__pycache__/apps.cpython-34.pyc
Normal file
Binary file not shown.
BIN
apolloActivity/plex/__pycache__/models.cpython-34.pyc
Normal file
BIN
apolloActivity/plex/__pycache__/models.cpython-34.pyc
Normal file
Binary file not shown.
BIN
apolloActivity/plex/__pycache__/urls.cpython-34.pyc
Normal file
BIN
apolloActivity/plex/__pycache__/urls.cpython-34.pyc
Normal file
Binary file not shown.
BIN
apolloActivity/plex/__pycache__/views.cpython-34.pyc
Normal file
BIN
apolloActivity/plex/__pycache__/views.cpython-34.pyc
Normal file
Binary file not shown.
6
apolloActivity/plex/admin.py
Normal file
6
apolloActivity/plex/admin.py
Normal file
@@ -0,0 +1,6 @@
|
||||
from django.contrib import admin
|
||||
|
||||
# Register your models here.
|
||||
from .models import Address
|
||||
|
||||
admin.site.register(Address)
|
||||
5
apolloActivity/plex/apps.py
Normal file
5
apolloActivity/plex/apps.py
Normal file
@@ -0,0 +1,5 @@
|
||||
from django.apps import AppConfig
|
||||
|
||||
|
||||
class PlexConfig(AppConfig):
|
||||
name = 'plex'
|
||||
37
apolloActivity/plex/migrations/0001_initial.py
Normal file
37
apolloActivity/plex/migrations/0001_initial.py
Normal file
@@ -0,0 +1,37 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Generated by Django 1.10.3 on 2016-11-23 20:16
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = [
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='Address',
|
||||
fields=[
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('ip_address', models.CharField(max_length=200)),
|
||||
('first_connect', models.DateTimeField(verbose_name='date first accessed on address')),
|
||||
],
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='Location',
|
||||
fields=[
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('ip_version', models.CharField(max_length=1)),
|
||||
('country', models.CharField(max_length=100)),
|
||||
('city', models.CharField(max_length=100)),
|
||||
('region', models.CharField(max_length=100)),
|
||||
('postal_code', models.IntegerField(max_length=6)),
|
||||
('address', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='plex.Address')),
|
||||
],
|
||||
),
|
||||
]
|
||||
0
apolloActivity/plex/migrations/__init__.py
Normal file
0
apolloActivity/plex/migrations/__init__.py
Normal file
Binary file not shown.
Binary file not shown.
25
apolloActivity/plex/models.py
Normal file
25
apolloActivity/plex/models.py
Normal file
@@ -0,0 +1,25 @@
|
||||
from django.db import models
|
||||
|
||||
import datetime
|
||||
from django.utils import timezone
|
||||
# Create your models here.
|
||||
class Address(models.Model):
|
||||
ip_address = models.CharField(max_length=200)
|
||||
first_connect = models.DateTimeField('date first accessed on address')
|
||||
|
||||
def created_recently(self):
|
||||
return self.first_connect >= timezone.now() - datetime.timedelta(days=1)
|
||||
|
||||
def __str__(self):
|
||||
return self.ip_address
|
||||
|
||||
class Location(models.Model):
|
||||
address = models.ForeignKey(Address, on_delete=models.CASCADE)
|
||||
ip_version = models.IntegerField(default=4)
|
||||
country = models.CharField(max_length=100)
|
||||
city = models.CharField(max_length=100)
|
||||
region = models.CharField(max_length=100)
|
||||
postal_code = models.IntegerField(default=0)
|
||||
|
||||
def __str__(self):
|
||||
return str([self.country, self.city, self.region])
|
||||
3
apolloActivity/plex/tests.py
Normal file
3
apolloActivity/plex/tests.py
Normal file
@@ -0,0 +1,3 @@
|
||||
from django.test import TestCase
|
||||
|
||||
# Create your tests here.
|
||||
14
apolloActivity/plex/urls.py
Normal file
14
apolloActivity/plex/urls.py
Normal file
@@ -0,0 +1,14 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
# @Author: KevinMidboe
|
||||
# @Date: 2016-11-23 20:43:37
|
||||
# @Last Modified by: KevinMidboe
|
||||
# @Last Modified time: 2016-11-23 20:43:50
|
||||
|
||||
from django.conf.urls import url
|
||||
|
||||
from . import views
|
||||
|
||||
urlpatterns = [
|
||||
url(r'^$', views.index, name='index'),
|
||||
]
|
||||
7
apolloActivity/plex/views.py
Normal file
7
apolloActivity/plex/views.py
Normal file
@@ -0,0 +1,7 @@
|
||||
from django.shortcuts import render
|
||||
|
||||
# Create your views here.
|
||||
from django.http import HttpResponse
|
||||
|
||||
def index(request):
|
||||
return HttpResponse("Hello, world. You're at the plex index.")
|
||||
Reference in New Issue
Block a user