bifurcation

master
daz 2014-02-06 13:45:40 +01:00
parent 402821dcdf
commit 85fe104dd3
5 changed files with 22 additions and 12 deletions

View File

@ -1,6 +1,6 @@
# Django settings for papiez_ipsum project. # Django settings for papiez_ipsum project.
DEBUG = False DEBUG = True
TEMPLATE_DEBUG = DEBUG TEMPLATE_DEBUG = DEBUG
ADMINS = ( ADMINS = (

View File

@ -28,7 +28,6 @@ def unpopable(width, height):
#======== your friendly decorators :3 ====================================== #======== your friendly decorators :3 ======================================
def redis_me(func): def redis_me(func):
def inner(*args, **kwargs): def inner(*args, **kwargs):
import ipdb; ipdb.set_trace()
if not redis or SAGE_REDIS: if not redis or SAGE_REDIS:
return func(*args, **kwargs) return func(*args, **kwargs)

View File

@ -39,11 +39,11 @@
<div class="alert alert-info"> <div class="alert alert-info">
beta feature: <a href="{% url 'papiezator:grand_conclave' 255 200 1 %}">BXVI!</a> beta feature: <a href="{% url 'papiezator:index' 'Benedictus_XVI' %}">BXVI!</a>
</div> </div>
<div class="alert alert-info"> <div class="alert alert-info">
beta feature: <a href="{% url 'papiezator:noir' 255 200 %}">noirpope</a> <a href="{% url 'papiezator:noir' 255 200 %}">norimakipope</a>
</div> </div>
<h3>How do i popes?</h3> <h3>How do i popes?</h3>
@ -53,15 +53,15 @@
<div class="row"> <div class="row">
<div class="col-xs-5"> <div class="col-xs-5">
<h2>Get your popes</h2> <h2>Get your popes</h2>
<img class="pope" src="{% url 'papiezator:conclave' 255 200 %}"> <img class="pope" src="{% url 'papiezator:grand_conclave' 255 200 pope %}">
<img class="pope" src="{% url 'papiezator:conclave' 115 100 %}"> <img class="pope" src="{% url 'papiezator:grand_conclave' 115 100 pope %}">
<img class="pope" src="{% url 'papiezator:conclave' 135 100 %}"> <img class="pope" src="{% url 'papiezator:grand_conclave' 135 100 pope %}">
</div> </div>
<div class="col-xs-7"> <div class="col-xs-7">
<h2>Get your popes today</h2> <h2>Get your popes today</h2>
<img class="pope" src="{% url 'papiezator:conclave' 160 200 %}"> <img class="pope" src="{% url 'papiezator:grand_conclave' 160 200 pope %}">
<img class="pope" src="{% url 'papiezator:conclave' 140 200 %}"> <img class="pope" src="{% url 'papiezator:grand_conclave' 140 200 pope %}">
<img class="pope" src="{% url 'papiezator:conclave' 300 100 %}"> <img class="pope" src="{% url 'papiezator:grand_conclave' 300 100 pope %}">
</div> </div>
</div> </div>

View File

@ -9,6 +9,7 @@ wh = r'(?P<width>\d+)/(?P<height>\d+)/$'
urlpatterns = patterns( urlpatterns = patterns(
'', '',
url(r'^$', views.index, name='index'), url(r'^$', views.index, name='index'),
url(r'^(?P<pope>\w+)/$', views.index, name='index'),
url(r'^' + wh, views.conclave, name='conclave'), url(r'^' + wh, views.conclave, name='conclave'),
url(r'^' + whp, views.conclave, name='grand_conclave'), url(r'^' + whp, views.conclave, name='grand_conclave'),
url(r'^noirpope/' + wh, noir.view, name='noir'), url(r'^noirpope/' + wh, noir.view, name='noir'),

View File

@ -3,13 +3,23 @@ from django.shortcuts import render
from django.core.urlresolvers import reverse from django.core.urlresolvers import reverse
from papiezator.papiezator_settings import LOLGITHUB_URL from papiezator.papiezator_settings import LOLGITHUB_URL
from papiezator.pope_utils import get_pope, http_return_image from papiezator.pope_utils import get_pope, http_return_image
from papiezator.models import Pope
def index(request): def index(request, pope=None):
if pope:
pope = Pope.objects.filter(name=pope.replace('_', ' ')).first()
if pope:
pope = pope.id
if not pope:
pope = 0
c = { c = {
"absolute_url": request.build_absolute_uri(reverse("papiezator:conclave", args=[200, 300])), "absolute_url": request.build_absolute_uri(reverse("papiezator:conclave", args=[200, 300])),
"absolute_url_exp": request.build_absolute_uri("width/height/"), "absolute_url_exp": request.build_absolute_uri("width/height/"),
"github_url": LOLGITHUB_URL "github_url": LOLGITHUB_URL,
"pope": pope
} }
return render(request, "papiezator/index.html", c) return render(request, "papiezator/index.html", c)