Založena aplikace 'various' na random věci
This commit is contained in:
parent
08e31a849c
commit
41e95fc574
9 changed files with 33 additions and 0 deletions
|
@ -78,6 +78,7 @@ TEMPLATES = [
|
||||||
'django.contrib.messages.context_processors.messages',
|
'django.contrib.messages.context_processors.messages',
|
||||||
'sekizai.context_processors.sekizai',
|
'sekizai.context_processors.sekizai',
|
||||||
'header_fotky.context_processors.vzhled',
|
'header_fotky.context_processors.vzhled',
|
||||||
|
'various.context_processors.april',
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -132,6 +133,7 @@ INSTALLED_APPS = (
|
||||||
'korektury',
|
'korektury',
|
||||||
'prednasky',
|
'prednasky',
|
||||||
'header_fotky',
|
'header_fotky',
|
||||||
|
'various',
|
||||||
|
|
||||||
# Admin upravy:
|
# Admin upravy:
|
||||||
|
|
||||||
|
|
0
various/__init__.py
Normal file
0
various/__init__.py
Normal file
3
various/admin.py
Normal file
3
various/admin.py
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
from django.contrib import admin
|
||||||
|
|
||||||
|
# Register your models here.
|
5
various/apps.py
Normal file
5
various/apps.py
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
from django.apps import AppConfig
|
||||||
|
|
||||||
|
|
||||||
|
class VariousConfig(AppConfig):
|
||||||
|
name = 'various'
|
14
various/context_processors.py
Normal file
14
various/context_processors.py
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
def april(req):
|
||||||
|
if 'X-April' in req.headers:
|
||||||
|
try:
|
||||||
|
year = int(req.headers['X-April'])
|
||||||
|
return {'april': year}
|
||||||
|
except:
|
||||||
|
pass # Fall-back to regular behaviour
|
||||||
|
|
||||||
|
import datetime
|
||||||
|
today = datetime.date.today()
|
||||||
|
if today.day == 1 and today.month == 4:
|
||||||
|
return {'april': today.year}
|
||||||
|
return {}
|
||||||
|
|
0
various/migrations/__init__.py
Normal file
0
various/migrations/__init__.py
Normal file
3
various/models.py
Normal file
3
various/models.py
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
from django.db import models
|
||||||
|
|
||||||
|
# Create your models here.
|
3
various/tests.py
Normal file
3
various/tests.py
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
from django.test import TestCase
|
||||||
|
|
||||||
|
# Create your tests here.
|
3
various/views.py
Normal file
3
various/views.py
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
from django.shortcuts import render
|
||||||
|
|
||||||
|
# Create your views here.
|
Loading…
Reference in a new issue