- added a django app into the project

- little tests trying to calculate how SC calcs survivability (not
resolved yet)
- dejaqt born as idea for standalone library.
This commit is contained in:
2014-06-01 16:16:38 +02:00
parent d0ce5ef086
commit 18b157972b
28 changed files with 732 additions and 27 deletions

0
dj/__init__.py Normal file
View File

0
dj/scon/__init__.py Normal file
View File

3
dj/scon/admin.py Normal file
View File

@@ -0,0 +1,3 @@
from django.contrib import admin
# Register your models here.

10
dj/scon/forms.py Normal file
View File

@@ -0,0 +1,10 @@
'''
Created on 27.05.2014
@author: g4b
'''
from django import forms
class ConfigForm(forms.Form):
def __init__(self, *args, **kwargs):

10
dj/scon/logic.py Normal file
View File

@@ -0,0 +1,10 @@
'''
'''
def config(condict):
# modify condict.
return condict
def overview(condict):
return condict

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

3
dj/scon/models.py Normal file
View File

@@ -0,0 +1,3 @@
from django.db import models
# Create your models here.

View File

@@ -0,0 +1 @@
Site Not Found.

View File

@@ -0,0 +1 @@
Internal Server Error.

View File

@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>{{ title }}</title>
{% block extrahead %}{% endblock extrahead%}
{% block css %}{% endblock css %}
{% block js %}{% endblock js %}
</head>
<body>{% block context %}
{% endblock context %}</body>
</html>

View File

@@ -0,0 +1 @@
{% extends "base.html" %}

View File

@@ -0,0 +1,11 @@
{% extends "scon/base.html" %}
{% load i18n %}
{% block context %}
{% blocktrans %}{% endblocktrans %}
<form class="form">
{% csrf_token %}
{{ form.as_p }}
<button type="submit">Submit</button>
</form>
{% endblock context %}

3
dj/scon/tests.py Normal file
View File

@@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.

10
dj/scon/views.py Normal file
View File

@@ -0,0 +1,10 @@
from django.shortcuts import render
from django.http import HttpResponse
from django.template import RequestContext, loader
import logic
def config(request):
t = loader.get_template('scon/config.html')
c = RequestContext(request, logic.config({'title': 'Configure your Client'}))
return HttpResponse(t.render(c))

82
dj/settings.py Normal file
View File

@@ -0,0 +1,82 @@
"""
Django settings for dj project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import os
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.6/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'xp$g5ho)(=013v9#qb@sncz%ye7#oy34&1=ltj1315d)j+lwm)'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
TEMPLATE_DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
)
MIDDLEWARE_CLASSES = (
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
)
ROOT_URLCONF = 'scon.dj.urls'
WSGI_APPLICATION = 'dj.wsgi.application'
# Database
# https://docs.djangoproject.com/en/1.6/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
}
# Internationalization
# https://docs.djangoproject.com/en/1.6/topics/i18n/
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'UTC'
USE_I18N = True
USE_L10N = True
USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.6/howto/static-files/
STATIC_URL = '/static/'

12
dj/urls.py Normal file
View File

@@ -0,0 +1,12 @@
from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'dj.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^admin/', include(admin.site.urls)),
#url(r'^scon/', include('scon.urls')),
)

14
dj/wsgi.py Normal file
View File

@@ -0,0 +1,14 @@
"""
WSGI config for dj project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "dj.settings")
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()