bootstrap static files
0
__init__.py
Normal file
BIN
__init__.pyc
Normal file
8
ordynacja/admin.py~
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
from django.contrib import admin
|
||||||
|
|
||||||
|
# Register your models here.
|
||||||
|
from .models import Komitet, Okreg, Glosy
|
||||||
|
|
||||||
|
admin.site.register(Komitet)
|
||||||
|
admin.site.register(Okreg)
|
||||||
|
admin.site.register(Glosy)
|
19
ordynacja/models.py~
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
from django.db import models
|
||||||
|
|
||||||
|
# Create your models here.
|
||||||
|
|
||||||
|
class Komitet(models.Model):
|
||||||
|
name = models.CharField(max_length=255)
|
||||||
|
kw_id = models.IntegerField(primary_key=True)
|
||||||
|
|
||||||
|
class Okreg(models.Model):
|
||||||
|
name = models.CharField(max_length=255)
|
||||||
|
o_id = models.IntegerField(primary_key=True)
|
||||||
|
|
||||||
|
class Glos(models.Model):
|
||||||
|
g_id = models.IntegerField(primary_key=True)
|
||||||
|
liczba = models.IntegerField()
|
||||||
|
komitet = models.ForeignKey(Komitet)
|
||||||
|
okreg = models.ForeignKey(Okreg, related_name="okregi")
|
7
ordynacja/static/css/bootstrap.min.css
vendored
Normal file
10
ordynacja/static/css/styles.css
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
.picture {
|
||||||
|
min-width: 50%;
|
||||||
|
min-height: 100%;
|
||||||
|
position: absolute;
|
||||||
|
margin: auto;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
}
|
4
ordynacja/static/css/styles.css~
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
.picture {
|
||||||
|
min-width: 50%;
|
||||||
|
min-height: 100%;
|
||||||
|
}
|
BIN
ordynacja/static/img/okregi/Sejm_RP_okr©gi.svg.png
Normal file
After Width: | Height: | Size: 252 KiB |
BIN
ordynacja/static/img/okregi/okrag_1.png
Normal file
After Width: | Height: | Size: 9.5 KiB |
BIN
ordynacja/static/img/okregi/okrag_10.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
ordynacja/static/img/okregi/okrag_11.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
ordynacja/static/img/okregi/okrag_12.png
Normal file
After Width: | Height: | Size: 6.9 KiB |
BIN
ordynacja/static/img/okregi/okrag_13.png
Normal file
After Width: | Height: | Size: 6.6 KiB |
BIN
ordynacja/static/img/okregi/okrag_14.png
Normal file
After Width: | Height: | Size: 8.3 KiB |
BIN
ordynacja/static/img/okregi/okrag_15.png
Normal file
After Width: | Height: | Size: 7.6 KiB |
BIN
ordynacja/static/img/okregi/okrag_16.png
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
ordynacja/static/img/okregi/okrag_17.png
Normal file
After Width: | Height: | Size: 8.1 KiB |
BIN
ordynacja/static/img/okregi/okrag_18.png
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
ordynacja/static/img/okregi/okrag_19.png
Normal file
After Width: | Height: | Size: 4.2 KiB |
BIN
ordynacja/static/img/okregi/okrag_2.png
Normal file
After Width: | Height: | Size: 7.5 KiB |
BIN
ordynacja/static/img/okregi/okrag_20.png
Normal file
After Width: | Height: | Size: 9.0 KiB |
BIN
ordynacja/static/img/okregi/okrag_21.png
Normal file
After Width: | Height: | Size: 9.9 KiB |
BIN
ordynacja/static/img/okregi/okrag_22.png
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
ordynacja/static/img/okregi/okrag_23.png
Normal file
After Width: | Height: | Size: 9.0 KiB |
BIN
ordynacja/static/img/okregi/okrag_24.png
Normal file
After Width: | Height: | Size: 13 KiB |
BIN
ordynacja/static/img/okregi/okrag_25.png
Normal file
After Width: | Height: | Size: 8.7 KiB |
BIN
ordynacja/static/img/okregi/okrag_26.png
Normal file
After Width: | Height: | Size: 9.7 KiB |
BIN
ordynacja/static/img/okregi/okrag_27.png
Normal file
After Width: | Height: | Size: 6.4 KiB |
BIN
ordynacja/static/img/okregi/okrag_28.png
Normal file
After Width: | Height: | Size: 7.1 KiB |
BIN
ordynacja/static/img/okregi/okrag_29.png
Normal file
After Width: | Height: | Size: 5.7 KiB |
BIN
ordynacja/static/img/okregi/okrag_3.png
Normal file
After Width: | Height: | Size: 9.2 KiB |
BIN
ordynacja/static/img/okregi/okrag_30.png
Normal file
After Width: | Height: | Size: 5.7 KiB |
BIN
ordynacja/static/img/okregi/okrag_31.png
Normal file
After Width: | Height: | Size: 4.7 KiB |
BIN
ordynacja/static/img/okregi/okrag_32.png
Normal file
After Width: | Height: | Size: 6.6 KiB |
BIN
ordynacja/static/img/okregi/okrag_33.png
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
ordynacja/static/img/okregi/okrag_34.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
ordynacja/static/img/okregi/okrag_35.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
ordynacja/static/img/okregi/okrag_36.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
ordynacja/static/img/okregi/okrag_37.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
ordynacja/static/img/okregi/okrag_38.png
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
ordynacja/static/img/okregi/okrag_39.png
Normal file
After Width: | Height: | Size: 6.1 KiB |
BIN
ordynacja/static/img/okregi/okrag_4.png
Normal file
After Width: | Height: | Size: 9.8 KiB |
BIN
ordynacja/static/img/okregi/okrag_40.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
ordynacja/static/img/okregi/okrag_41.png
Normal file
After Width: | Height: | Size: 9.6 KiB |
BIN
ordynacja/static/img/okregi/okrag_5.png
Normal file
After Width: | Height: | Size: 9.4 KiB |
BIN
ordynacja/static/img/okregi/okrag_6.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
ordynacja/static/img/okregi/okrag_7.png
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
ordynacja/static/img/okregi/okrag_8.png
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
ordynacja/static/img/okregi/okrag_9.png
Normal file
After Width: | Height: | Size: 5.2 KiB |
2
ordynacja/static/js/app.js
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
console.log(glosy);
|
||||||
|
console.log(komitety);
|
2
ordynacja/static/js/app.js~
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
console.log(glosy);
|
||||||
|
console.log(JSON.parse(komitety));
|
@ -1,10 +1,28 @@
|
|||||||
|
{% load static %}
|
||||||
|
<link rel="stylesheet" type="text/css" href="{% static "css/bootstrap.min.css" %}">
|
||||||
|
<link rel="stylesheet" type="text/css" href="{% static "css/styles.css" %}">
|
||||||
|
|
||||||
{% if okreg_list %}
|
{% if okreg_list %}
|
||||||
Okreg {{ okreg_name }}
|
Okreg {{ okreg_name }}
|
||||||
<ul>
|
<div class="row">
|
||||||
{% for glos in okreg_list %}
|
<div class="col-md-6">
|
||||||
<li>{{ glos.komitet.name }} - {{ glos.liczba }}</li>
|
<img class="picture" src="{% static "img/okregi/okrag_"|add:okreg_id|add:".png" %}" alt="{{ okreg_name }}" />
|
||||||
{% endfor %}
|
</div>
|
||||||
</ul>
|
<div class="col-md-6">
|
||||||
|
<ul>
|
||||||
|
{% for glos in okreg_list %}
|
||||||
|
<li>{{ glos.komitet.name }} - {{ glos.liczba }}</li>
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
var glosy = {{glosy_json|safe}};
|
||||||
|
var komitety = {{komitety|safe}};
|
||||||
|
</script>
|
||||||
|
<script src="{% static "js/app.js" %}"></script>
|
||||||
|
|
||||||
{% else %}
|
{% else %}
|
||||||
<p>Wrong okreg.</p>
|
<p>Wrong okreg.</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -1,10 +1,28 @@
|
|||||||
|
{% load static %}
|
||||||
|
<link rel="stylesheet" type="text/css" href="{% static "css/bootstrap.min.css" %}">
|
||||||
|
<link rel="stylesheet" type="text/css" href="{% static "css/styles.css" %}">
|
||||||
|
|
||||||
{% if okreg_list %}
|
{% if okreg_list %}
|
||||||
Okreg {{ okreg_list.objects }}
|
Okreg {{ okreg_name }}
|
||||||
<ul>
|
<div class="row">
|
||||||
{% for glos in okreg_list %}
|
<div class="col-md-6">
|
||||||
<li>{{ glos.komitet.name }} - {{ glos.liczba }}</li>
|
<img class="picture" src="{% static "img/okregi/okrag_"|add:okreg_id|add:".png" %}" alt="{{ okreg_name }}" />
|
||||||
{% endfor %}
|
</div>
|
||||||
</ul>
|
<div class="col-md-6">
|
||||||
|
<ul>
|
||||||
|
{% for glos in okreg_list %}
|
||||||
|
<li>{{ glos.komitet.name }} - {{ glos.liczba }}</li>
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
var glosy = '{{glosy_json|safe}}';
|
||||||
|
var komitety = '{{komitety|safe}}';
|
||||||
|
</script>
|
||||||
|
<script src="{% static "js/app.js" %}"></script>
|
||||||
|
|
||||||
{% else %}
|
{% else %}
|
||||||
<p>Wrong okreg.</p>
|
<p>Wrong okreg.</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -1,8 +1,10 @@
|
|||||||
from django.conf.urls import url
|
from django.conf.urls import url
|
||||||
|
from django.conf.urls.static import static
|
||||||
|
from django.conf import settings
|
||||||
|
|
||||||
from . import views
|
from . import views
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
url('^$', views.index, name='index'),
|
url('^$', views.index, name='index'),
|
||||||
url(r'^okreg/(?P<okreg_id>\d+)/$', views.okreg, name='okreg')
|
url(r'^okreg/(?P<okreg_id>\d+)/$', views.okreg, name='okreg')
|
||||||
]
|
] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
|
||||||
|
10
ordynacja/urls.py~
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
from django.conf.urls import url
|
||||||
|
from django.conf.urls.static import static
|
||||||
|
from django.conf import settings
|
||||||
|
|
||||||
|
from . import views
|
||||||
|
|
||||||
|
urlpatterns = [
|
||||||
|
url('', views.index, name='index'),
|
||||||
|
url(r'^okreg/(?P<okreg_id>\d+)/$', views.okreg, name='okreg')
|
||||||
|
] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
|
@ -1,7 +1,8 @@
|
|||||||
from django.shortcuts import render
|
from django.shortcuts import render
|
||||||
from django.http import HttpResponse
|
from django.http import HttpResponse
|
||||||
from django.template import loader
|
from django.template import loader
|
||||||
from .models import Glos
|
from django.core import serializers
|
||||||
|
from .models import Glos,Komitet
|
||||||
|
|
||||||
|
|
||||||
def index(request):
|
def index(request):
|
||||||
@ -11,7 +12,10 @@ def okreg(request, okreg_id):
|
|||||||
g = Glos.objects.filter(okreg__o_id=okreg_id)
|
g = Glos.objects.filter(okreg__o_id=okreg_id)
|
||||||
template = loader.get_template('ordynacja/index.html')
|
template = loader.get_template('ordynacja/index.html')
|
||||||
context = {
|
context = {
|
||||||
|
'okreg_id': okreg_id,
|
||||||
'okreg_list': g,
|
'okreg_list': g,
|
||||||
'okreg_name': g[0].okreg.name
|
'okreg_name': g[0].okreg.name,
|
||||||
|
'glosy_json': serializers.serialize('json', g),
|
||||||
|
'komitety': serializers.serialize('json', Komitet.objects.all())
|
||||||
}
|
}
|
||||||
return HttpResponse(template.render(context, request))
|
return HttpResponse(template.render(context, request))
|
||||||
|
21
ordynacja/views.py~
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
from django.shortcuts import render
|
||||||
|
from django.http import HttpResponse
|
||||||
|
from django.template import loader
|
||||||
|
from django.core import serializers
|
||||||
|
from .models import Glos,Komitet
|
||||||
|
|
||||||
|
|
||||||
|
def index(request):
|
||||||
|
return HttpResponse("This is main page. Here will be the map")
|
||||||
|
|
||||||
|
def okreg(request, okreg_id):
|
||||||
|
g = Glos.objects.filter(okreg__o_id=okreg_id)
|
||||||
|
template = loader.get_template('ordynacja/index.html')
|
||||||
|
context = {
|
||||||
|
'okreg_id': okreg_id,
|
||||||
|
'okreg_list': g,
|
||||||
|
'okreg_name': g[0].okreg.name,
|
||||||
|
'glosy_json': serializers.serialize('json', g),
|
||||||
|
'komitety': serializers.serialize('json', Komitet.objects.all())
|
||||||
|
}
|
||||||
|
return HttpResponse(template.render(context, request))
|
121
ordynacje/settings.py~
Normal file
@ -0,0 +1,121 @@
|
|||||||
|
"""
|
||||||
|
Django settings for ordynacje project.
|
||||||
|
|
||||||
|
Generated by 'django-admin startproject' using Django 1.9.4.
|
||||||
|
|
||||||
|
For more information on this file, see
|
||||||
|
https://docs.djangoproject.com/en/1.9/topics/settings/
|
||||||
|
|
||||||
|
For the full list of settings and their values, see
|
||||||
|
https://docs.djangoproject.com/en/1.9/ref/settings/
|
||||||
|
"""
|
||||||
|
|
||||||
|
import os
|
||||||
|
|
||||||
|
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
|
||||||
|
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
||||||
|
|
||||||
|
|
||||||
|
# Quick-start development settings - unsuitable for production
|
||||||
|
# See https://docs.djangoproject.com/en/1.9/howto/deployment/checklist/
|
||||||
|
|
||||||
|
# SECURITY WARNING: keep the secret key used in production secret!
|
||||||
|
SECRET_KEY = '21-xihxno3d-_aj&yh^sauesx4wgje!(owy_t!evw$t&rs+((x'
|
||||||
|
|
||||||
|
# SECURITY WARNING: don't run with debug turned on in production!
|
||||||
|
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.middleware.security.SecurityMiddleware',
|
||||||
|
'django.contrib.sessions.middleware.SessionMiddleware',
|
||||||
|
'django.middleware.common.CommonMiddleware',
|
||||||
|
'django.middleware.csrf.CsrfViewMiddleware',
|
||||||
|
'django.contrib.auth.middleware.AuthenticationMiddleware',
|
||||||
|
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
|
||||||
|
'django.contrib.messages.middleware.MessageMiddleware',
|
||||||
|
'django.middleware.clickjacking.XFrameOptionsMiddleware',
|
||||||
|
]
|
||||||
|
|
||||||
|
ROOT_URLCONF = 'ordynacje.urls'
|
||||||
|
|
||||||
|
TEMPLATES = [
|
||||||
|
{
|
||||||
|
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
||||||
|
'DIRS': [],
|
||||||
|
'APP_DIRS': True,
|
||||||
|
'OPTIONS': {
|
||||||
|
'context_processors': [
|
||||||
|
'django.template.context_processors.debug',
|
||||||
|
'django.template.context_processors.request',
|
||||||
|
'django.contrib.auth.context_processors.auth',
|
||||||
|
'django.contrib.messages.context_processors.messages',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
]
|
||||||
|
|
||||||
|
WSGI_APPLICATION = 'ordynacje.wsgi.application'
|
||||||
|
|
||||||
|
|
||||||
|
# Database
|
||||||
|
# https://docs.djangoproject.com/en/1.9/ref/settings/#databases
|
||||||
|
|
||||||
|
DATABASES = {
|
||||||
|
'default': {
|
||||||
|
'ENGINE': 'django.db.backends.sqlite3',
|
||||||
|
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# Password validation
|
||||||
|
# https://docs.djangoproject.com/en/1.9/ref/settings/#auth-password-validators
|
||||||
|
|
||||||
|
AUTH_PASSWORD_VALIDATORS = [
|
||||||
|
{
|
||||||
|
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
|
||||||
|
},
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
# Internationalization
|
||||||
|
# https://docs.djangoproject.com/en/1.9/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.9/howto/static-files/
|
||||||
|
|
||||||
|
STATIC_URL = '/static/'
|
22
ordynacje/urls.py~
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
"""ordynacje URL Configuration
|
||||||
|
|
||||||
|
The `urlpatterns` list routes URLs to views. For more information please see:
|
||||||
|
https://docs.djangoproject.com/en/1.9/topics/http/urls/
|
||||||
|
Examples:
|
||||||
|
Function views
|
||||||
|
1. Add an import: from my_app import views
|
||||||
|
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
|
||||||
|
Class-based views
|
||||||
|
1. Add an import: from other_app.views import Home
|
||||||
|
2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home')
|
||||||
|
Including another URLconf
|
||||||
|
1. Import the include() function: from django.conf.urls import url, include
|
||||||
|
2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls'))
|
||||||
|
"""
|
||||||
|
from django.conf.urls import url, include
|
||||||
|
from django.contrib import admin
|
||||||
|
|
||||||
|
urlpatterns = [
|
||||||
|
url(r'^ordynacja/, include('ordynacja.urls')),
|
||||||
|
url(r'^admin/', admin.site.urls),
|
||||||
|
]
|
20
ordynacje/wsgi.py~
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
"""
|
||||||
|
WSGI config for ordynacje 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.9/howto/deployment/wsgi/
|
||||||
|
"""
|
||||||
|
|
||||||
|
import os
|
||||||
|
|
||||||
|
from django.core.wsgi import get_wsgi_application
|
||||||
|
path = '/home/gregz09/Pulpit/ordynacje/ordynacje'
|
||||||
|
if path not in sys.path:
|
||||||
|
sys.path.append(path)
|
||||||
|
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "ordynacje.settings")
|
||||||
|
|
||||||
|
application = get_wsgi_application()
|
||||||
|
|
||||||
|
|
122
settings.py
Normal file
@ -0,0 +1,122 @@
|
|||||||
|
"""
|
||||||
|
Django settings for ordynacje project.
|
||||||
|
|
||||||
|
Generated by 'django-admin startproject' using Django 1.9.4.
|
||||||
|
|
||||||
|
For more information on this file, see
|
||||||
|
https://docs.djangoproject.com/en/1.9/topics/settings/
|
||||||
|
|
||||||
|
For the full list of settings and their values, see
|
||||||
|
https://docs.djangoproject.com/en/1.9/ref/settings/
|
||||||
|
"""
|
||||||
|
|
||||||
|
import os
|
||||||
|
|
||||||
|
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
|
||||||
|
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
||||||
|
|
||||||
|
|
||||||
|
# Quick-start development settings - unsuitable for production
|
||||||
|
# See https://docs.djangoproject.com/en/1.9/howto/deployment/checklist/
|
||||||
|
|
||||||
|
# SECURITY WARNING: keep the secret key used in production secret!
|
||||||
|
SECRET_KEY = '21-xihxno3d-_aj&yh^sauesx4wgje!(owy_t!evw$t&rs+((x'
|
||||||
|
|
||||||
|
# SECURITY WARNING: don't run with debug turned on in production!
|
||||||
|
DEBUG = True
|
||||||
|
|
||||||
|
ALLOWED_HOSTS = []
|
||||||
|
|
||||||
|
|
||||||
|
# Application definition
|
||||||
|
|
||||||
|
INSTALLED_APPS = [
|
||||||
|
'ordynacja.apps.OrdynacjaConfig',
|
||||||
|
'django.contrib.admin',
|
||||||
|
'django.contrib.auth',
|
||||||
|
'django.contrib.contenttypes',
|
||||||
|
'django.contrib.sessions',
|
||||||
|
'django.contrib.messages',
|
||||||
|
'django.contrib.staticfiles',
|
||||||
|
]
|
||||||
|
|
||||||
|
MIDDLEWARE_CLASSES = [
|
||||||
|
'django.middleware.security.SecurityMiddleware',
|
||||||
|
'django.contrib.sessions.middleware.SessionMiddleware',
|
||||||
|
'django.middleware.common.CommonMiddleware',
|
||||||
|
'django.middleware.csrf.CsrfViewMiddleware',
|
||||||
|
'django.contrib.auth.middleware.AuthenticationMiddleware',
|
||||||
|
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
|
||||||
|
'django.contrib.messages.middleware.MessageMiddleware',
|
||||||
|
'django.middleware.clickjacking.XFrameOptionsMiddleware',
|
||||||
|
]
|
||||||
|
|
||||||
|
ROOT_URLCONF = 'ordynacje.urls'
|
||||||
|
|
||||||
|
TEMPLATES = [
|
||||||
|
{
|
||||||
|
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
||||||
|
'DIRS': [],
|
||||||
|
'APP_DIRS': True,
|
||||||
|
'OPTIONS': {
|
||||||
|
'context_processors': [
|
||||||
|
'django.template.context_processors.debug',
|
||||||
|
'django.template.context_processors.request',
|
||||||
|
'django.contrib.auth.context_processors.auth',
|
||||||
|
'django.contrib.messages.context_processors.messages',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
]
|
||||||
|
|
||||||
|
WSGI_APPLICATION = 'ordynacje.wsgi.application'
|
||||||
|
|
||||||
|
|
||||||
|
# Database
|
||||||
|
# https://docs.djangoproject.com/en/1.9/ref/settings/#databases
|
||||||
|
|
||||||
|
DATABASES = {
|
||||||
|
'default': {
|
||||||
|
'ENGINE': 'django.db.backends.sqlite3',
|
||||||
|
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# Password validation
|
||||||
|
# https://docs.djangoproject.com/en/1.9/ref/settings/#auth-password-validators
|
||||||
|
|
||||||
|
AUTH_PASSWORD_VALIDATORS = [
|
||||||
|
{
|
||||||
|
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
|
||||||
|
},
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
# Internationalization
|
||||||
|
# https://docs.djangoproject.com/en/1.9/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.9/howto/static-files/
|
||||||
|
|
||||||
|
STATIC_URL = '/static/'
|
BIN
settings.pyc
Normal file
22
urls.py
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
"""ordynacje URL Configuration
|
||||||
|
|
||||||
|
The `urlpatterns` list routes URLs to views. For more information please see:
|
||||||
|
https://docs.djangoproject.com/en/1.9/topics/http/urls/
|
||||||
|
Examples:
|
||||||
|
Function views
|
||||||
|
1. Add an import: from my_app import views
|
||||||
|
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
|
||||||
|
Class-based views
|
||||||
|
1. Add an import: from other_app.views import Home
|
||||||
|
2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home')
|
||||||
|
Including another URLconf
|
||||||
|
1. Import the include() function: from django.conf.urls import url, include
|
||||||
|
2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls'))
|
||||||
|
"""
|
||||||
|
from django.conf.urls import url, include
|
||||||
|
from django.contrib import admin
|
||||||
|
|
||||||
|
urlpatterns = [
|
||||||
|
url(r'^ordynacja/', include('ordynacja.urls')),
|
||||||
|
url(r'^admin/', admin.site.urls),
|
||||||
|
]
|
20
wsgi.py
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
"""
|
||||||
|
WSGI config for ordynacje 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.9/howto/deployment/wsgi/
|
||||||
|
"""
|
||||||
|
|
||||||
|
import os,sys
|
||||||
|
|
||||||
|
from django.core.wsgi import get_wsgi_application
|
||||||
|
path = '/home/gregz09/Pulpit/ordynacje/ordynacje'
|
||||||
|
if path not in sys.path:
|
||||||
|
sys.path.append(path)
|
||||||
|
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "ordynacje.settings")
|
||||||
|
|
||||||
|
application = get_wsgi_application()
|
||||||
|
|
||||||
|
|