This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.core.urlresolvers import RegexURLResolver | |
from django.contrib.auth.decorators import login_required | |
from django.conf.urls import patterns, include, url | |
from django.conf import settings | |
from django.contrib import admin | |
admin.autodiscover() | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
location / { | |
include uwsgi_params; | |
uwsgi_param SCRIPT_NAME ""; | |
uwsgi_pass 127.0.0.1:8003; | |
uwsgi_read_timeout 300; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="slideshow"> | |
<ul class="bxslider"> | |
{% for image in images %} | |
<li><img src="{{image.url}}" alt=""></li> | |
{% endfor %} | |
</ul> | |
<div class="gallery-thumbs-container"> | |
<ul id="gallery-thumbs" class="gallery-thumbs-list"> | |
{% for image in images %} | |
<li class="thumb-item"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Thanks to Torchbox | |
# http://techblog.torchbox.com/post/54428118919/minimum-number-of-forms-in-a-django-formset | |
from django import forms | |
class MinimumRequiredFormSet(forms.models.BaseInlineFormSet): | |
""" | |
Inline formset that enforces a minimum number of non-deleted forms | |
that are not empty |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function shuffle(array) { | |
var n = array.length, t, i; | |
while (n) { | |
i = Math.random() * n-- | 0; // 0 ≤ i < n | |
t = array[n]; | |
array[n] = array[i]; | |
array[i] = t; | |
} | |
return array; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
location ~ /more_details.php { | |
if ($args ~* "^profileID=(\d+)") { | |
set $mid $1; | |
set $args ''; | |
rewrite ^.*$ /view/$mid permanent; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*.pyc | |
.DS_Store | |
build/ | |
dist/ | |
*.egg-info/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% if messages %} | |
<div class="container messages"> | |
<div class="row"> | |
<div class="col-md-12"> | |
{% for message in messages %} | |
<div class="alert {% if message.tags %} alert-{{ message.tags }}{% endif %}"> | |
<a class="close" data-dismiss="alert" href="#">×</a> | |
{{ message }} | |
</div> | |
{% endfor %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django import forms | |
from django.utils.safestring import mark_safe | |
class CustomModelChoiceField(forms.ModelChoiceField): | |
def label_from_instance(self, obj): | |
return mark_safe("My Object custom label <strong>%i</strong>" % obj.id) | |
class MyForm(forms.ModelForm): | |
my_field = CustomModelChoiceField(label=_('The form label'), queryset=MyModel.objects.filter(), widget=forms.RadioSelect, empty_label=None) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="/media/js/raphael-min.js"></script> | |
<script type="text/javascript"> | |
var paper; | |
var arc; | |
var colorArr = ["#d0ad6d","#E78B6D","#DD64B3","#7BDD69","#E7E06D"]; | |
var pieData = [112, 50, 67]; | |
var sectorAngleArr = []; | |
var total = 0; | |
var startAngle = -90; | |
var endAngle = -90; |