This file contains hidden or 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.conf import settings | |
| from django.contrib import messages | |
| from django.contrib.auth.models import User | |
| from django.contrib.auth.decorators import login_required | |
| from django.core.urlresolvers import reverse | |
| from django.http import HttpResponseRedirect, HttpResponse, HttpResponseForbidden, HttpResponseNotFound | |
| from django.shortcuts import render_to_response, get_object_or_404 | |
| from django.template import RequestContext | |
| from django.template.loader import render_to_string | |
| from django.views.generic import list_detail |
This file contains hidden or 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
| -e git://github.com/audreyr/django-startcbv#egg=django-startcbv-0.1.0-dev |
This file contains hidden or 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
| class Activity(models.Model): | |
| def get_delete_url(self): | |
| reverse('activity_ajax_delete', kwargs={'id':self.id}) | |
| class ActivityItem(models.Model): | |
| def get_delete_url(self): | |
| reverse('activity_ajax_delete', kwargs={'id':self.activity.id}) |
This file contains hidden or 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
| "Diversity is not about big sticks and hitting people over the head. | |
| It is about creating a welcome and open environment and active | |
| efforts to recruit members who would not otherwise participate. | |
| Great efforts by PyLadies are proving to be very effective. | |
| In contrast, big stick politics drive people away. | |
| Please abandon this notion of using diversity as a stick to bonk | |
| people over the head. It is counterproductive, misguided and offensive." |
This file contains hidden or 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
| # in settings.py | |
| LOGIN_URL = '/login/' | |
| LOGIN_REDIRECT_URL = '/' | |
| LOGOUT_URL = '/logout/' | |
| # in root urls.py | |
| (r'^login/$', 'django.contrib.auth.views.login', {}, 'login',), | |
| (r'^logout/$', 'django.contrib.auth.views.logout', {}, 'logout',), | |
| # in the HTML |
This file contains hidden or 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.contrib.auth import authenticate, login | |
| def signup(request, template_name="accounts/signup.html"): | |
| form = SignupForm(request.POST or None) | |
| if form.is_valid(): | |
| user = User.objects.create_user( | |
| username=request.POST.get('username'), | |
| first_name=request.POST.get('first_name'), |
This file contains hidden or 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
| # Forms.py | |
| from django import forms | |
| from django.conf import settings | |
| from apps.common.utils.widgets import FileBrowserFrontendWidget | |
| from uni_form.helpers import FormHelper, Submit, Reset | |
| from uni_form.helpers import Layout, Fieldset, Row, Column, HTML | |
| from models import Lead |
This file contains hidden or 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
| def sucky_way(x, y): | |
| """ This sucks when the nesting gets deep""" | |
| if x: | |
| return 'Too hard things get all nested and stuff' | |
| else: | |
| y += 1 | |
| return y | |
| def better_way(x, y): | |
| """ Makes pydanny happy""" |
This file contains hidden or 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 | |
| local_settings.py | |
| coverage | |
| docs/_build | |
| docs/_static | |
| *~ |
This file contains hidden or 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
| #!/usr/bin/python | |
| import random | |
| import webbrowser | |
| target = random.randrange(3, 483) | |
| url = 'http://us.pycon.org/2012/review/%s/' % target | |
| webbrowser.open(url) |