text stringlengths 0 1.05M | meta dict |
|---|---|
from django.shortcuts import redirect
from django.views.generic import DetailView, TemplateView
from simplestore.cart.utils import get_cart
from .forms import CustomerOrderForm, ShippingAddressForm
from .models.order import Order
class CheckoutOrderCreateView(TemplateView):
template_name = 'checkout_index.html'
... | {
"repo_name": "martinstastny/django-simple-ecommerce",
"path": "simplestore/checkout/views.py",
"copies": "2",
"size": "2310",
"license": "mit",
"hash": 3015450977345170000,
"line_mean": 28.6153846154,
"line_max": 76,
"alpha_frac": 0.6268398268,
"autogenerated": false,
"ratio": 4.125,
"config_t... |
from django.shortcuts import redirect
from django.views.generic import ListView, DetailView
from django.contrib import messages
from django import forms
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Submit
from .models import Product, ProductComment
from django.http import JsonResponse
cla... | {
"repo_name": "HardBite/steewi",
"path": "steewi/products/views.py",
"copies": "1",
"size": "3302",
"license": "bsd-3-clause",
"hash": -3313236447608580000,
"line_mean": 34.8913043478,
"line_max": 147,
"alpha_frac": 0.6220472441,
"autogenerated": false,
"ratio": 3.8440046565774155,
"config_test... |
from django.shortcuts import redirect
from django.views.generic import ListView
from konfera.models.event import Event, MEETUP, CONFERENCE
class EventsByTypeListView(ListView):
event_type = None
queryset = Event.objects.all()
paginate_by = 10
def get(self, request, *args, **kwargs):
queryset... | {
"repo_name": "kapucko/django-konfera",
"path": "konfera/views.py",
"copies": "1",
"size": "1059",
"license": "mit",
"hash": -4940803747310090000,
"line_mean": 24.8292682927,
"line_max": 67,
"alpha_frac": 0.6921624174,
"autogenerated": false,
"ratio": 3.6267123287671232,
"config_test": false,
... |
from django.shortcuts import redirect
from django.views.generic import TemplateView, FormView
from badges.models import Badge, BadgeUser
from commits.forms import RepositoryForm
from commits.models import Repository, Commit
from social.models import Post
from social.tasks import grab_users_posts
class Index(Template... | {
"repo_name": "mindinpanic/codingmood",
"path": "codemood/common/views.py",
"copies": "2",
"size": "2425",
"license": "mit",
"hash": -1268083286108670700,
"line_mean": 33.1549295775,
"line_max": 88,
"alpha_frac": 0.6432989691,
"autogenerated": false,
"ratio": 4.292035398230088,
"config_test": f... |
from django.shortcuts import redirect
from django.views.generic import TemplateView
from ..course.models import Course
from ..evaluation.models import Evaluation
# Create your views here.
class DashboardView(TemplateView):
template_name = "dashboard/courses.html"
def post(self, request, *args, **kwargs):
if not re... | {
"repo_name": "carlosa54/evaluation_system",
"path": "evaluation_system/dashboard/views.py",
"copies": "1",
"size": "1801",
"license": "mit",
"hash": -2956943536572595700,
"line_mean": 30.6140350877,
"line_max": 84,
"alpha_frac": 0.7168239867,
"autogenerated": false,
"ratio": 3.3167587476979743,
... |
from django.shortcuts import redirect
from django.views.generic import TemplateView
from django.contrib.auth.decorators import login_required
from django.utils.decorators import method_decorator
from django.contrib import messages
from django.template import RequestContext
from bucketlist.models import Bucketlistitem,... | {
"repo_name": "andela-jngatia/Just-Do-It",
"path": "bucketlist/views/bucketlistitem_view.py",
"copies": "1",
"size": "4267",
"license": "mit",
"hash": 5728652259666714000,
"line_mean": 40.0288461538,
"line_max": 76,
"alpha_frac": 0.648230607,
"autogenerated": false,
"ratio": 4.54419595314164,
"... |
from django.shortcuts import redirect
from django.views.generic import TemplateView
from django.contrib.sites.models import Site
from courses import models
from courses.utils import DAYS
from courses.encoder import default_encoder
from courses.views.decorators import Renderer
render = Renderer(template_prefix='course... | {
"repo_name": "JGrippo/YACS",
"path": "courses/views/newviews.py",
"copies": "2",
"size": "3690",
"license": "mit",
"hash": 6694720138146842000,
"line_mean": 30.5384615385,
"line_max": 89,
"alpha_frac": 0.637398374,
"autogenerated": false,
"ratio": 3.6141038197845248,
"config_test": false,
"h... |
from django.shortcuts import redirect
from django.views.generic import TemplateView
from django.views.generic import ListView, DetailView
from django.views.generic.edit import FormView
from django.views.generic.edit import CreateView, UpdateView, DeleteView
from django.core.urlresolvers import reverse_lazy
from django.... | {
"repo_name": "tigeli/futurice-ldap-user-manager",
"path": "fum/servers/views.py",
"copies": "1",
"size": "3115",
"license": "bsd-3-clause",
"hash": -3125860903597700000,
"line_mean": 34.8045977011,
"line_max": 106,
"alpha_frac": 0.6776886035,
"autogenerated": false,
"ratio": 3.7260765550239237,
... |
from django.shortcuts import redirect
from django.views.generic import TemplateView
from data_services.models import DimUser
from lib.templatetags.base_extras import set_notification
from ts_emod2.models import Scenario
import json
class JSONEditorView(TemplateView):
template_name = "ts_emod2/json_editor.html"
... | {
"repo_name": "vecnet/vnetsource",
"path": "ts_emod2/views/JSONEditorView.py",
"copies": "2",
"size": "1831",
"license": "mpl-2.0",
"hash": 5639742885179738000,
"line_mean": 35.64,
"line_max": 122,
"alpha_frac": 0.6324412889,
"autogenerated": false,
"ratio": 4.050884955752212,
"config_test": fa... |
from django.shortcuts import redirect
from django.views.generic import TemplateView
class TemporaryPassWordTemplateView(TemplateView):
def get(self, request, *args, **kwargs):
context = self.get_context_data(**kwargs)
return self.render_to_response(context)
def dispatch(self, request, *args,... | {
"repo_name": "michealcarrerweb/LHVent_app",
"path": "source_utils/permission_mixins.py",
"copies": "1",
"size": "2489",
"license": "mit",
"hash": 3630818723034227700,
"line_mean": 35.6029411765,
"line_max": 102,
"alpha_frac": 0.6396143029,
"autogenerated": false,
"ratio": 4.021001615508886,
"c... |
from django.shortcuts import redirect
from django.views.generic import View
from django.views.generic.base import TemplateView
from braces.views import LoginRequiredMixin
import json
from django.template import RequestContext
from django.template.loader import render_to_string
from django.http import HttpResponse
from ... | {
"repo_name": "asmaps/kvmate",
"path": "kvmate/vnc/views.py",
"copies": "2",
"size": "2256",
"license": "mit",
"hash": 9105099026067525000,
"line_mean": 47,
"line_max": 363,
"alpha_frac": 0.6879432624,
"autogenerated": false,
"ratio": 4.057553956834532,
"config_test": false,
"has_no_keywords"... |
from django.shortcuts import redirect
from django.views import generic
from django.core.urlresolvers import reverse_lazy
from django.contrib import messages
from django.utils.translation import ugettext_lazy as _
from django.conf import settings
from cobra.views.mixins import PageTitleMixin
from cobra.core.loading imp... | {
"repo_name": "lyoniionly/django-cobra",
"path": "src/cobra/apps/accounts/views.py",
"copies": "1",
"size": "2519",
"license": "apache-2.0",
"hash": 9058201284621165000,
"line_mean": 33.0540540541,
"line_max": 89,
"alpha_frac": 0.6740770147,
"autogenerated": false,
"ratio": 3.8993808049535605,
... |
from django.shortcuts import redirect
from fun_views.patterns.form.process import form_process_pattern
from fun_views.views.utils import (get_context_base, get_validity_base,
make_base_view, not_set_get_form_class,
not_set_get_success_url,
... | {
"repo_name": "keithasaurus/django_fun_views",
"path": "fun_views/views/generic/form/process.py",
"copies": "1",
"size": "1925",
"license": "mit",
"hash": 1333823076150763300,
"line_mean": 36.7450980392,
"line_max": 74,
"alpha_frac": 0.5890909091,
"autogenerated": false,
"ratio": 3.96907216494845... |
from django.shortcuts import redirect
from mobler import settings as mobler_settings
from mobler.browscap import browser
import time
import urlparse
import urllib
COOKIE_AGE = mobler_settings.MOBLER_COOKIE_AGE
COOKIE_NAME = mobler_settings.MOBLER_COOKIE_NAME
def build_full_path(request):
''' Build a full path+que... | {
"repo_name": "dmpayton/django-mobler",
"path": "mobler/middleware.py",
"copies": "1",
"size": "1640",
"license": "mit",
"hash": -8555970087463622000,
"line_mean": 38.0476190476,
"line_max": 87,
"alpha_frac": 0.662195122,
"autogenerated": false,
"ratio": 3.7788018433179724,
"config_test": false... |
from django.shortcuts import redirect
# from multidb.pinning import pin_this_thread, unpin_this_thread
from .models import Service, StopPoint
def real_ip_middleware(get_response):
def middleware(request):
if 'HTTP_X_REAL_IP' in request.META:
request.META['REMOTE_ADDR'] = request.META['HTTP_X_R... | {
"repo_name": "jclgoodwin/bustimes.org.uk",
"path": "busstops/middleware.py",
"copies": "1",
"size": "2239",
"license": "mpl-2.0",
"hash": 4994722576675940000,
"line_mean": 33.4461538462,
"line_max": 120,
"alpha_frac": 0.5466726217,
"autogenerated": false,
"ratio": 4.398821218074656,
"config_te... |
from django.shortcuts import redirect
from projects.models import User, Skill
from social.pipeline.partial import partial
from social.exceptions import AuthException
@partial
def require_extra_data(strategy, details, user=None, is_new=False, *args, **kwargs):
if not is_new:
return
if strategy.sessio... | {
"repo_name": "tochev/obshtestvo.bg",
"path": "auth/pipeline.py",
"copies": "1",
"size": "2046",
"license": "unlicense",
"hash": -8042507613610973000,
"line_mean": 28.2428571429,
"line_max": 85,
"alpha_frac": 0.6153470186,
"autogenerated": false,
"ratio": 3.6864864864864866,
"config_test": fals... |
from django.shortcuts import redirect
from requests.utils import quote
from social_core.pipeline.partial import partial
from django.core.files import File
from django.core.files.temp import NamedTemporaryFile
import uuid
import urllib
import random
import string
from django.contrib import messages
from base.utils impo... | {
"repo_name": "internship2016/sovolo",
"path": "app/user/social_auth.py",
"copies": "1",
"size": "7983",
"license": "mit",
"hash": 7926949725774097000,
"line_mean": 40.578125,
"line_max": 139,
"alpha_frac": 0.5832393837,
"autogenerated": false,
"ratio": 4.282725321888412,
"config_test": false,
... |
from django.shortcuts import redirect
from rest_framework import permissions, viewsets
from rest_framework.decorators import api_view, permission_classes
from . import models
from . import serializers
from ..scraps.models import Scrap
class ScrapBookViewSet(viewsets.ModelViewSet):
queryset = models.ScrapBook.obj... | {
"repo_name": "tonysyu/scrappyr-app",
"path": "scrappyr/scrapbooks/api.py",
"copies": "1",
"size": "1108",
"license": "mit",
"hash": -7589611375908872000,
"line_mean": 34.7419354839,
"line_max": 86,
"alpha_frac": 0.7590252708,
"autogenerated": false,
"ratio": 3.6567656765676566,
"config_test": ... |
from django.shortcuts import redirect
from reversion import VersionAdmin
from django.contrib import admin
from django.contrib import messages
from django.core.exceptions import ValidationError
from base.admin import PrettyFilterMixin, RestrictedCompetitionAdminMixin
from base.util import editonly_fieldsets
from .mod... | {
"repo_name": "tbabej/roots",
"path": "competitions/admin.py",
"copies": "3",
"size": "6212",
"license": "mit",
"hash": 1972946047068515000,
"line_mean": 24.1497975709,
"line_max": 77,
"alpha_frac": 0.5291371539,
"autogenerated": false,
"ratio": 4.03638726445744,
"config_test": false,
"has_no... |
from django.shortcuts import redirect
from social.pipeline.partial import partial
@partial
def get_additional_user_info(strategy, details, user=None, *args, **kwargs):
if user:
return {'is_new': False}
backend = kwargs.get('backend')
response = kwargs.get('response')
print(str(response).encode('utf-8'))
pri... | {
"repo_name": "mas2tg/cs3240-f16-team07",
"path": "users/pipeline.py",
"copies": "1",
"size": "2382",
"license": "mit",
"hash": 6128810457953273000,
"line_mean": 28.0487804878,
"line_max": 95,
"alpha_frac": 0.6456759026,
"autogenerated": false,
"ratio": 3.049935979513444,
"config_test": false,
... |
from django.shortcuts import redirect
import django.views.generic as generic
import settings
import public
from django.core.urlresolvers import reverse
from django.http import Http404
from django.core.exceptions import ObjectDoesNotExist
from django.template.response import TemplateResponse
HOT_VIEW_SETTINGS = {'viewn... | {
"repo_name": "samuelcolvin/HotDjango",
"path": "views_base.py",
"copies": "1",
"size": "12924",
"license": "mit",
"hash": -1068483117345308200,
"line_mean": 39.0123839009,
"line_max": 128,
"alpha_frac": 0.5808573197,
"autogenerated": false,
"ratio": 3.860215053763441,
"config_test": false,
"... |
from django.shortcuts import redirect
# compat
import django
if django.VERSION[:2] < (1, 10):
from django.core.urlresolvers import reverse
else:
from django.urls import reverse
class PasswordProtectedMiddleware(object):
def __init__(self, get_response=None):
if get_response:
self.get... | {
"repo_name": "benzkji/djangocms-misc",
"path": "djangocms_misc/basic/middleware/password_protected.py",
"copies": "2",
"size": "1236",
"license": "mit",
"hash": 5795285021950337000,
"line_mean": 32.4054054054,
"line_max": 71,
"alpha_frac": 0.640776699,
"autogenerated": false,
"ratio": 4.32167832... |
from django.shortcuts import redirect
from approver.workflows import project_crud
from approver.decorators import login_required
import approver.utils as utils
from django.core.urlresolvers import reverse
@login_required
def similar_projects(request, project_id=None,from_page=None):
project = project_crud.ge... | {
"repo_name": "amberlallen/qipr_approver",
"path": "qipr_approver/approver/views/similar_projects.py",
"copies": "1",
"size": "1277",
"license": "apache-2.0",
"hash": -4504519460172787700,
"line_mean": 37.7272727273,
"line_max": 89,
"alpha_frac": 0.6311667972,
"autogenerated": false,
"ratio": 4.2... |
from django.shortcuts import redirect
from django.conf import settings
from django.contrib.auth import get_user_model
from django.core.exceptions import PermissionDenied
from social.pipeline.partial import partial
from django.db.models import Q
from django.http import HttpResponse
import random
from urllib.parse impo... | {
"repo_name": "oleg-chubin/let_me_play",
"path": "let_me_auth/social/pipeline.py",
"copies": "1",
"size": "6583",
"license": "apache-2.0",
"hash": -3912812449428894000,
"line_mean": 30.3476190476,
"line_max": 96,
"alpha_frac": 0.5912198086,
"autogenerated": false,
"ratio": 3.9278042959427206,
"... |
from django.shortcuts import redirect
from .forms import PrescriptionForm
from core.views import is_doctor, is_nurse, is_admin, is_patient
from core.models import *
from .models import Prescription
from django.contrib.auth.decorators import login_required, user_passes_test
from django.utils import timezone
from dja... | {
"repo_name": "jimga150/HealthNet",
"path": "HealthNet/prescriptions/views.py",
"copies": "1",
"size": "4979",
"license": "mit",
"hash": -1549362847782167000,
"line_mean": 32.4161073826,
"line_max": 119,
"alpha_frac": 0.6806587668,
"autogenerated": false,
"ratio": 3.743609022556391,
"config_tes... |
from django.shortcuts import redirect
from jinja2 import Environment, meta
from airmozilla.base import mozillians
from airmozilla.main.models import Event, CuratedGroup
from airmozilla.main.views import is_contributor
def can_edit_event(event, user, default='manage:events'):
if (not user.has_perm('main.change_e... | {
"repo_name": "blossomica/airmozilla",
"path": "airmozilla/manage/views/utils.py",
"copies": "2",
"size": "1445",
"license": "bsd-3-clause",
"hash": 6870112359505821000,
"line_mean": 29.1041666667,
"line_max": 75,
"alpha_frac": 0.6283737024,
"autogenerated": false,
"ratio": 3.8328912466843503,
... |
from django.shortcuts import redirect
from marketplace.models import Category, Package
from .models import Recommendation
def recommend(object_to_like, workbench_user):
"""Saves the recommendation of object by user
:param object_to_like: The object that is recommended
:param workbench_user: The workbenc... | {
"repo_name": "MOOCworkbench/MOOCworkbench",
"path": "recommendations/utils.py",
"copies": "1",
"size": "1385",
"license": "mit",
"hash": 4023452058540903000,
"line_mean": 40.9696969697,
"line_max": 101,
"alpha_frac": 0.7068592058,
"autogenerated": false,
"ratio": 4.287925696594427,
"config_tes... |
from django.shortcuts import redirect
from .models import UserDevice
def device_required(function=None):
"""
Make sure the user has an authorized device
"""
def _dec(view_func):
def _view(request, *args, **kwargs):
try:
device = UserDevice.objects.get(user=request.u... | {
"repo_name": "bsarsgard/passbrain",
"path": "secrets/decorators.py",
"copies": "1",
"size": "1169",
"license": "mit",
"hash": 1234955698722103600,
"line_mean": 30.5945945946,
"line_max": 71,
"alpha_frac": 0.4910179641,
"autogenerated": false,
"ratio": 4.394736842105263,
"config_test": false,
... |
from django.shortcuts import redirect
from ..product.models import ProductAbstract, Variant
from ..util import JSONResponse
from . import forms
from . import models
from . import signals
from .app import cart_app
class AddToCartHandler(object):
"""
Parametrized handler for `product_view`, which produces *add ... | {
"repo_name": "fusionbox/satchless",
"path": "satchless/cart/handler.py",
"copies": "1",
"size": "3815",
"license": "bsd-3-clause",
"hash": -6385501283119798000,
"line_mean": 42.8620689655,
"line_max": 84,
"alpha_frac": 0.5530799476,
"autogenerated": false,
"ratio": 4.878516624040921,
"config_t... |
from django.shortcuts import redirect
from utils.bag import Context
from utils.auth_entry import list_silos, get_datasets_count, authz, add_auth_info_to_context
from djangomako.shortcuts import render_to_response, render_to_string
def home(request):
# logged in user
c = Context() # duck-typed context object... | {
"repo_name": "benosteen/RDFDatabank",
"path": "django/src/frontend/views.py",
"copies": "1",
"size": "1075",
"license": "mit",
"hash": -6586988723374660000,
"line_mean": 36.0689655172,
"line_max": 92,
"alpha_frac": 0.6679069767,
"autogenerated": false,
"ratio": 3.3489096573208723,
"config_test... |
from django.shortcuts import redirect
from vecnet.simulation import sim_model
from data_services.data_api import EMODBaseline
from data_services.models import DimBaseline, SimulationGroup, DimUser, Simulation
from lib.templatetags.base_extras import set_notification
from ts_repr.views.creation.DetailsView import deri... | {
"repo_name": "vecnet/vnetsource",
"path": "ts_emod2/utils/conversion.py",
"copies": "2",
"size": "3598",
"license": "mpl-2.0",
"hash": 6933741570089754000,
"line_mean": 41.8452380952,
"line_max": 143,
"alpha_frac": 0.6712062257,
"autogenerated": false,
"ratio": 4.164351851851852,
"config_test"... |
from django.shortcuts import redirect
class RedirectFirstSubpageMiddleware(object):
def __init__(self, get_response):
self.get_response = get_response
# One-time configuration and initialization.
def __call__(self, request):
# Code to be executed for each request before
# the... | {
"repo_name": "bnzk/djangocms-misc",
"path": "djangocms_misc/basic/middleware/redirect_subpage.py",
"copies": "2",
"size": "1271",
"license": "mit",
"hash": -2606788364739062300,
"line_mean": 41.3666666667,
"line_max": 107,
"alpha_frac": 0.6073957514,
"autogenerated": false,
"ratio": 4.3676975945... |
from django.shortcuts import redirect, render, get_object_or_404
from django.contrib.auth import logout as auth_logout
from django.contrib.auth.decorators import login_required
from django.views.decorators.cache import cache_page
from django.views.decorators.cache import cache_control
from guardian.shortcuts import ge... | {
"repo_name": "FalkorCloud/falkor",
"path": "hub/falkor/views.py",
"copies": "1",
"size": "2107",
"license": "mit",
"hash": -7444148719667019000,
"line_mean": 34.1166666667,
"line_max": 122,
"alpha_frac": 0.693877551,
"autogenerated": false,
"ratio": 3.8660550458715597,
"config_test": false,
... |
from django.shortcuts import redirect, render, get_object_or_404
from django.core.paginator import Paginator, InvalidPage, EmptyPage
from datetime import date
from models import Post, Category
from taggit.models import Tag
def index(request):
category_list = Category.objects.all()
return render(request, 'fancy/blog... | {
"repo_name": "Mercy-Nekesa/sokoapp",
"path": "sokoapp/blog/views.py",
"copies": "1",
"size": "1905",
"license": "mit",
"hash": 4718885690920771000,
"line_mean": 28.3076923077,
"line_max": 85,
"alpha_frac": 0.7207349081,
"autogenerated": false,
"ratio": 2.967289719626168,
"config_test": false,
... |
from django.shortcuts import redirect, render, get_object_or_404
from django.core.servers.basehttp import FileWrapper
from django.http import HttpResponse
from django.core.exceptions import ValidationError
from django.utils.html import escape
from .models import User, Recipe
from .forms import RecipeForm
from .tools.b... | {
"repo_name": "benosment/recipes",
"path": "recipes/views.py",
"copies": "1",
"size": "6537",
"license": "mit",
"hash": 6977832804030120000,
"line_mean": 40.9038461538,
"line_max": 88,
"alpha_frac": 0.5675386263,
"autogenerated": false,
"ratio": 3.800581395348837,
"config_test": false,
"has_n... |
from django.shortcuts import redirect, render, get_object_or_404
from django.http import HttpResponse
from core.models import *
def home(request):
context = {}
return render(request, 'core/home.html', context)
def xmltv(request):
response = HttpResponse(content_type='text/html; charset=utf-8')
respons... | {
"repo_name": "MarconiMediaGroup/M3U8-Creator",
"path": "src/core/views.py",
"copies": "1",
"size": "1591",
"license": "apache-2.0",
"hash": 646294981300714500,
"line_mean": 37.8048780488,
"line_max": 86,
"alpha_frac": 0.5505971087,
"autogenerated": false,
"ratio": 3.6490825688073394,
"config_t... |
from django.shortcuts import redirect, render, get_object_or_404
from django.http import JsonResponse
from django.contrib import messages
from django.views.decorators.http import require_http_methods
from django.views.decorators.csrf import ensure_csrf_cookie
from simple_history.utils import update_change_reason
from d... | {
"repo_name": "tjcsl/director",
"path": "web3/apps/docs/views.py",
"copies": "1",
"size": "6618",
"license": "mit",
"hash": -4666049151261948000,
"line_mean": 34.9673913043,
"line_max": 110,
"alpha_frac": 0.6382592928,
"autogenerated": false,
"ratio": 3.847674418604651,
"config_test": false,
... |
from django.shortcuts import redirect, render, get_object_or_404
from django.utils import timezone
from .models import Post
from .forms import PostForm
def post_list(request):
posts = Post.objects.filter(published_date__lte=timezone.now()).order_by('published_date')
return render(request, 'blog/post_list.html'... | {
"repo_name": "swietlana/changelog-builder",
"path": "Blog/blog/views.py",
"copies": "1",
"size": "1425",
"license": "apache-2.0",
"hash": 5627100594633369000,
"line_mean": 35.5384615385,
"line_max": 94,
"alpha_frac": 0.6238596491,
"autogenerated": false,
"ratio": 3.5984848484848486,
"config_te... |
from django.shortcuts import redirect, render, HttpResponse, get_object_or_404
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from django.contrib.syndication.views import Feed
from django.core.urlresolvers import reverse
from blog.models import Article, Comment, Category, CategoryToArticle
f... | {
"repo_name": "toucanb/django-blog-embed",
"path": "views.py",
"copies": "1",
"size": "3307",
"license": "bsd-3-clause",
"hash": -4045654774252284400,
"line_mean": 28.2654867257,
"line_max": 134,
"alpha_frac": 0.7438766253,
"autogenerated": false,
"ratio": 3.4198552223371252,
"config_test": fal... |
from django.shortcuts import redirect, render
from django.conf import settings
from django import http
from django.contrib.auth import logout as auth_logout
from django.contrib.auth.decorators import login_required
from django.core.urlresolvers import reverse
# from django.template.context import RequestContext
from an... | {
"repo_name": "oleg-chubin/let_me_play",
"path": "let_me_auth/views.py",
"copies": "1",
"size": "6224",
"license": "apache-2.0",
"hash": 1858040624670545000,
"line_mean": 33.3867403315,
"line_max": 103,
"alpha_frac": 0.6642030848,
"autogenerated": false,
"ratio": 4.020671834625323,
"config_test... |
from django.shortcuts import redirect, render
from django.contrib.auth.decorators import login_required
from redeer.feeds.models import Group
from redeer.feeds.upload import import_google_reader
from redeer.gui.forms import UploadForm
def index(request):
groups = Group.objects.for_user(request.user.pk).order_by... | {
"repo_name": "davidszotten/redeer",
"path": "redeer/gui/views.py",
"copies": "1",
"size": "1028",
"license": "mit",
"hash": 2545320415088218000,
"line_mean": 22.9069767442,
"line_max": 78,
"alpha_frac": 0.6780155642,
"autogenerated": false,
"ratio": 3.6714285714285713,
"config_test": false,
... |
from django.shortcuts import redirect, render
from django.contrib.auth import authenticate, login
from django.views.generic import TemplateView, View
from .forms import RegisterForm, LoginForm
# Create your views here.
class HomePageView(TemplateView):
def get(self, request, **kwargs):
if not request.use... | {
"repo_name": "AccuraGit/PodcastPlatform",
"path": "welcome/views.py",
"copies": "1",
"size": "2143",
"license": "mit",
"hash": -6480177040641169000,
"line_mean": 27.9594594595,
"line_max": 70,
"alpha_frac": 0.6164255716,
"autogenerated": false,
"ratio": 4.243564356435644,
"config_test": false,... |
from django.shortcuts import redirect, render
from django.contrib.auth import get_user_model
from django.views.generic import FormView, CreateView
from django.views.generic.detail import SingleObjectMixin
from .forms import ExistingListItemForm, ItemForm, NewListForm
from .models import List
User = get_user_model()
... | {
"repo_name": "jrwiegand/tdd-project",
"path": "lists/views.py",
"copies": "1",
"size": "1826",
"license": "mit",
"hash": -3016452971383706000,
"line_mean": 25.8529411765,
"line_max": 71,
"alpha_frac": 0.6856516977,
"autogenerated": false,
"ratio": 3.4714828897338403,
"config_test": false,
"h... |
from django.shortcuts import redirect, render
from django.contrib.auth import logout as auth_logout
from django.contrib.auth import login as auth_login
from django.contrib.auth import authenticate
def logout(request):
auth_logout(request)
return redirect('/')
def login(request):
""" This view deals with... | {
"repo_name": "erikiado/jp2_online",
"path": "tosp_auth/views.py",
"copies": "1",
"size": "1419",
"license": "mit",
"hash": 5201546089662853000,
"line_mean": 34.45,
"line_max": 86,
"alpha_frac": 0.6685472496,
"autogenerated": false,
"ratio": 4.417445482866044,
"config_test": false,
"has_no_ke... |
from django.shortcuts import redirect, render
from django.contrib import auth
from django.core.context_processors import csrf
def login(request):
return_path = request.META.get('HTTP_REFERER', '/')
args = {}
args.update(csrf(request))
if request.POST:
email = request.POST.get('email', '')
... | {
"repo_name": "vitaliyharchenko/Stepee",
"path": "customuser/views.py",
"copies": "1",
"size": "1105",
"license": "mit",
"hash": -2235065246693371100,
"line_mean": 33.5625,
"line_max": 70,
"alpha_frac": 0.6036199095,
"autogenerated": false,
"ratio": 4.138576779026217,
"config_test": false,
"h... |
from django.shortcuts import redirect, render
from django.core.exceptions import ValidationError
from django.http import HttpResponse
from lists.models import Item,List
# Create your views here.
def home_page(request):
if request.method=='POST':
list_=List.objects.create()
item_text=request.POST['i... | {
"repo_name": "HaoPatrick/tdd-pyhton",
"path": "lists/views.py",
"copies": "1",
"size": "1221",
"license": "mit",
"hash": 2696066332247012400,
"line_mean": 32.9166666667,
"line_max": 70,
"alpha_frac": 0.665028665,
"autogenerated": false,
"ratio": 3.6339285714285716,
"config_test": false,
"has... |
from django.shortcuts import redirect, render
from django.core.exceptions import ValidationError
from lists.models import Item, List
def home_page(request):
return render(request, 'home.html')
def new_list(request):
list_ = List.objects.create()
item = Item(text=request.POST['item_text'], list=list_)
... | {
"repo_name": "fmaguire/python_tdd_book",
"path": "lists/views.py",
"copies": "1",
"size": "1024",
"license": "mit",
"hash": 9010722097125905000,
"line_mean": 27.4444444444,
"line_max": 72,
"alpha_frac": 0.6171875,
"autogenerated": false,
"ratio": 3.878787878787879,
"config_test": false,
"has... |
from django.shortcuts import redirect, render
from django.core.urlresolvers import reverse
from django.contrib.auth import authenticate,\
login as djlogin, logout as djlogout
from django.contrib.auth.models import User
from django.contrib import messages
import re
from .forms import Lo... | {
"repo_name": "shakib609/AskFmClone",
"path": "apps/auth/views.py",
"copies": "1",
"size": "2936",
"license": "mit",
"hash": 3936209385280498700,
"line_mean": 37.1298701299,
"line_max": 78,
"alpha_frac": 0.5705040872,
"autogenerated": false,
"ratio": 4.616352201257862,
"config_test": false,
"... |
from django.shortcuts import redirect, render
from django.core.urlresolvers import reverse
import os
import json
from functools import wraps
from django.http.response import JsonResponse
from django.conf import settings
from django.template import Context, Template
from rest_framework import status
from django.db.mode... | {
"repo_name": "amschaal/bioshare",
"path": "bioshareX/utils.py",
"copies": "1",
"size": "14503",
"license": "mit",
"hash": -4075465211365027300,
"line_mean": 40.2017045455,
"line_max": 255,
"alpha_frac": 0.6088395504,
"autogenerated": false,
"ratio": 3.866435617168755,
"config_test": false,
"... |
from django.shortcuts import redirect, render
from django.db import transaction
from shoutbox.models import ShoutboxEntry
from shoutbox.forms import ShoutboxPostForm
def recent_entries(request, entrycount=5):
"""Render a set of recent entries"""
entries = ShoutboxEntry.objects.order_by('-created')[:entrycount... | {
"repo_name": "jokey2k/ShockGsite",
"path": "shoutbox/views.py",
"copies": "1",
"size": "1989",
"license": "bsd-3-clause",
"hash": 7622083737546997000,
"line_mean": 38.78,
"line_max": 75,
"alpha_frac": 0.5771744595,
"autogenerated": false,
"ratio": 4.333333333333333,
"config_test": false,
"ha... |
from django.shortcuts import redirect, render
from django.http import HttpResponse
from django.contrib import auth
from django import forms
from django.contrib import messages as msgs
from django.utils.translation import ugettext as _
from servo.models import Location, UserProfile, Order, Note
class ProfileForm(forms... | {
"repo_name": "aucor/servo",
"path": "servo/views/users.py",
"copies": "1",
"size": "2519",
"license": "bsd-2-clause",
"hash": 4342545101486440400,
"line_mean": 33.9861111111,
"line_max": 81,
"alpha_frac": 0.6470821755,
"autogenerated": false,
"ratio": 3.9420970266040687,
"config_test": false,
... |
from django.shortcuts import redirect, render
from django.http import HttpResponse
from django.views.decorators.http import require_POST
from django.views.decorators.csrf import csrf_exempt
from tapiriik.services import Service
from tapiriik.auth import User
import json
def authredirect(req, service, level=None):
... | {
"repo_name": "gavioto/tapiriik",
"path": "tapiriik/web/views/oauth/__init__.py",
"copies": "10",
"size": "1744",
"license": "apache-2.0",
"hash": -2822357664333477000,
"line_mean": 36.9130434783,
"line_max": 113,
"alpha_frac": 0.7173165138,
"autogenerated": false,
"ratio": 3.9817351598173514,
... |
from django.shortcuts import redirect, render
from django.urls import reverse
from django.contrib.auth import logout
from django.contrib.auth import authenticate, login
from django.contrib import messages
def log_in_user(request):
successful_redirect = request.GET.get('next', reverse('homepage:index'))
usern... | {
"repo_name": "bakstad/django_sandbox",
"path": "django_project/auth/views.py",
"copies": "1",
"size": "1129",
"license": "mit",
"hash": 8554996713774935000,
"line_mean": 32.2058823529,
"line_max": 93,
"alpha_frac": 0.693534101,
"autogenerated": false,
"ratio": 4.197026022304833,
"config_test":... |
from django.shortcuts import redirect, render
from django.utils.http import urlencode
from django.views.decorators.csrf import csrf_exempt
from django_auth_lti.decorators import lti_role_required
from ab_tool.models import (Track, InterventionPointUrl, InterventionPoint,
Experiment)
from ab_tool.controllers import... | {
"repo_name": "penzance/ab-testing-tool",
"path": "ab_tool/views/selection_pages.py",
"copies": "1",
"size": "3667",
"license": "mit",
"hash": 7445388174062910000,
"line_mean": 48.5540540541,
"line_max": 117,
"alpha_frac": 0.6921188983,
"autogenerated": false,
"ratio": 3.3985171455050973,
"conf... |
from django.shortcuts import redirect, render
from django.utils.translation import ugettext as _
from django.core.exceptions import ObjectDoesNotExist
from django.views.decorators.http import require_GET
from django.contrib.auth.decorators import login_required
from user.models import Activation, ACTIVATION_TYPES
fro... | {
"repo_name": "fsr/course-management",
"path": "user/views/verify.py",
"copies": "1",
"size": "2046",
"license": "bsd-3-clause",
"hash": -7005487852368010000,
"line_mean": 26.28,
"line_max": 103,
"alpha_frac": 0.5889540567,
"autogenerated": false,
"ratio": 4.298319327731092,
"config_test": fals... |
from django.shortcuts import redirect, render
from django.utils.translation import ugettext_lazy as _
from django.views.generic import View
from customer.models import CustomerProfile
from .models import Partner
# Create your views here or die
class PartnerMentorCreateView(View):
template_name = 'ad_manage/ment... | {
"repo_name": "dilosung/ad-manage",
"path": "ad_manage/djangoapps/partner/views.py",
"copies": "2",
"size": "1191",
"license": "mit",
"hash": 3357274201517746000,
"line_mean": 36.21875,
"line_max": 79,
"alpha_frac": 0.6742233417,
"autogenerated": false,
"ratio": 3.904918032786885,
"config_test"... |
from django.shortcuts import redirect, render
from django.views.decorators.csrf import csrf_exempt
from merdeka.apps.utils.func import find_model, make_response, json_response, jsonify, set_data, set_status, set_message
from .forms import LoginForm, RegisterForm
def api_view(request, **kwargs):
resp = make_respons... | {
"repo_name": "kamar42/merdeka-backend",
"path": "merdeka/apps/base/views.py",
"copies": "1",
"size": "3466",
"license": "mit",
"hash": -2004960283237213000,
"line_mean": 30.2252252252,
"line_max": 120,
"alpha_frac": 0.5920369302,
"autogenerated": false,
"ratio": 3.699039487726788,
"config_test... |
from django.shortcuts import redirect, render
from django.views.decorators.http import require_http_methods
from django.contrib.auth.decorators import login_required
from django.contrib.admin.views.decorators import staff_member_required
from django.conf import settings
from .backend.parser import import_stream, peopl... | {
"repo_name": "opencivicdata/opencivicdata.org",
"path": "upload/views.py",
"copies": "1",
"size": "3983",
"license": "bsd-3-clause",
"hash": 334849562087871500,
"line_mean": 27.654676259,
"line_max": 81,
"alpha_frac": 0.6359527994,
"autogenerated": false,
"ratio": 3.96318407960199,
"config_tes... |
from django.shortcuts import redirect, render
from django.views.generic import TemplateView, View
from actors.models import SubZone, Category, Amendity
from django.http import HttpResponse, HttpResponseNotFound
import json
class GetSubzoneScore(View):
'''
AJAX call to generate keys
'''
def get(self, r... | {
"repo_name": "anduslim/hacksg",
"path": "on_admin/views.py",
"copies": "1",
"size": "2982",
"license": "bsd-3-clause",
"hash": -4925724819019528000,
"line_mean": 32.8977272727,
"line_max": 129,
"alpha_frac": 0.5932260228,
"autogenerated": false,
"ratio": 3.8980392156862744,
"config_test": fals... |
from django.shortcuts import redirect, render
from py3njection import inject
from learn.forms import ExerciseForm
from learn.infrastructure.database import Database
from learn.models import Translation
from learn.services.answer import Answer
from learn.services.repetition import compute_next_repetition
@inject
def ... | {
"repo_name": "Aigrefin/py3learn",
"path": "learn/views/exercise.py",
"copies": "1",
"size": "1901",
"license": "mit",
"hash": -5249886846032791000,
"line_mean": 43.2093023256,
"line_max": 114,
"alpha_frac": 0.7169910573,
"autogenerated": false,
"ratio": 3.9936974789915967,
"config_test": false... |
from django.shortcuts import redirect, render
import clinq.models as model
from django.http import HttpResponse, StreamingHttpResponse
from django.db.models import Count, Min, Sum, Avg
from django.shortcuts import get_object_or_404, render
# Create your views here.
def Home(request):
return render(request, 'home... | {
"repo_name": "Ahn1/Clinq",
"path": "web/clinq/views.py",
"copies": "1",
"size": "1474",
"license": "mit",
"hash": -6532730208259617000,
"line_mean": 26.2962962963,
"line_max": 123,
"alpha_frac": 0.7360922659,
"autogenerated": false,
"ratio": 3.1767241379310347,
"config_test": false,
"has_no_... |
from django.shortcuts import redirect, render
from account.decorators import login_required
from account.views import SettingsView as AccountSettingsView
from pinax.lms.activities.models import get_activities, UserState
from .forms import SettingsForm
from .signals import adoption_level_change, blurb_read
class Se... | {
"repo_name": "jtauber/learning-greek",
"path": "learning_greek/views.py",
"copies": "1",
"size": "1940",
"license": "mit",
"hash": -867608081515665200,
"line_mean": 30.8032786885,
"line_max": 119,
"alpha_frac": 0.6953608247,
"autogenerated": false,
"ratio": 3.9754098360655736,
"config_test": f... |
from django.shortcuts import redirect, render
from rest_framework.permissions import IsAuthenticatedOrReadOnly
from rest_framework.decorators import detail_route, list_route
from rest_framework.response import Response
from rest_framework.exceptions import ValidationError
from .permissions import IsOwnerOrReadOnly
fr... | {
"repo_name": "Jingyu-Yao/elitetraderoutes",
"path": "traderoutes/views.py",
"copies": "1",
"size": "5001",
"license": "mit",
"hash": -7060449464923210000,
"line_mean": 39.9918032787,
"line_max": 122,
"alpha_frac": 0.6706658668,
"autogenerated": false,
"ratio": 4.673831775700934,
"config_test":... |
from django.shortcuts import redirect, render_to_response, get_object_or_404
from django.template import RequestContext
from django.contrib.auth.decorators import login_required
from journeyman.workers.models import BuildNode
from journeyman.workers.forms import WorkerForm
def create(request):
# Post request?
... | {
"repo_name": "stephrdev/loetwerk",
"path": "journeyman/workers/views.py",
"copies": "1",
"size": "2077",
"license": "mit",
"hash": 4318126740372202000,
"line_mean": 30.4696969697,
"line_max": 76,
"alpha_frac": 0.6509388541,
"autogenerated": false,
"ratio": 3.8391866913123844,
"config_test": fa... |
from django.shortcuts import redirect, render_to_response
from django.http import HttpResponse, HttpResponseNotAllowed, HttpResponseNotFound, HttpRequest
from django.template.loader import render_to_string
from pltbelay.models import BelaySession, PltCredentials, GoogleCredentials, Stash, PendingLogin, PendingAccount
f... | {
"repo_name": "brownplt/k3",
"path": "dj-plt-belay/pltbelay/views.py",
"copies": "1",
"size": "14879",
"license": "apache-2.0",
"hash": 6290659400929711000,
"line_mean": 30.5902335456,
"line_max": 116,
"alpha_frac": 0.6927884939,
"autogenerated": false,
"ratio": 3.456213704994193,
"config_test"... |
from django.shortcuts import redirect, render_to_response
from web.campaign.models import Campaign, Scan, Premium
from django.template.context import RequestContext
from django.core.urlresolvers import reverse
from web.lib.json import JsonResponse
from datetime import datetime
from web.campaign.models import Note
from... | {
"repo_name": "TheAmbitiousInc/com.theambitious.qrtrace.web",
"path": "web/track/views.py",
"copies": "1",
"size": "3900",
"license": "mit",
"hash": 7311387815084660000,
"line_mean": 30.9754098361,
"line_max": 116,
"alpha_frac": 0.488974359,
"autogenerated": false,
"ratio": 4.266958424507659,
"... |
from django.shortcuts import redirect, resolve_url, get_object_or_404
from django.views.decorators.http import require_POST
from django.views.generic import ListView
from django.views.generic.dates import ArchiveIndexView, DateDetailView
from .models import Post, Category, Comment
class PostViewMixin:
date_field... | {
"repo_name": "baixuexue123/glory",
"path": "blog/views.py",
"copies": "1",
"size": "3371",
"license": "mit",
"hash": -1536428750292514300,
"line_mean": 29.3333333333,
"line_max": 91,
"alpha_frac": 0.6133056133,
"autogenerated": false,
"ratio": 3.5933831376734258,
"config_test": false,
"has_n... |
from django.shortcuts import redirect
from django.urls import reverse
from django.shortcuts import render
from django.contrib.auth.decorators import login_required
from django.contrib import messages
from django.http import Http404
from django.conf import settings
from django.contrib.auth.decorators import user_... | {
"repo_name": "martinrusev/amonone",
"path": "amon/apps/users/views.py",
"copies": "1",
"size": "2783",
"license": "mit",
"hash": 6018973685322184000,
"line_mean": 27.3157894737,
"line_max": 125,
"alpha_frac": 0.646784046,
"autogenerated": false,
"ratio": 3.8545706371191137,
"config_test": fals... |
from django.shortcuts import redirect
from django.utils.datastructures import MultiValueDict
from django.utils.http import urlencode
from .models import Tour
def tour_middleware(get_response):
# One-time configuration and initialization.
def middleware(request):
# Code to be executed for ... | {
"repo_name": "vaal-/il2_stats",
"path": "src/stats/middleware.py",
"copies": "1",
"size": "1227",
"license": "mit",
"hash": 7674520255262634000,
"line_mean": 32.0833333333,
"line_max": 115,
"alpha_frac": 0.6096169519,
"autogenerated": false,
"ratio": 4.382142857142857,
"config_test": false,
... |
from django.shortcuts import render as render_to_response, redirect
from django.contrib.auth import authenticate
from django.contrib.auth import login as auth_login
from django.contrib.auth import logout as auth_logout
from django.contrib.auth.decorators import login_required
from django.core.urlresolvers import revers... | {
"repo_name": "noamsu/djangodash2012",
"path": "djangodash/views.py",
"copies": "1",
"size": "12170",
"license": "mit",
"hash": -2570248971730318000,
"line_mean": 25.9866962306,
"line_max": 85,
"alpha_frac": 0.6114215283,
"autogenerated": false,
"ratio": 3.6568509615384617,
"config_test": false... |
from django.shortcuts import render #For render templates
from DjangoApp1.models import Bares, Tapas
from django.http import HttpResponse, HttpResponseRedirect
from django.contrib.auth import authenticate, login, logout
from django.shortcuts import redirect
from DjangoApp1.forms import LoginForm, RegisterForm, TapaFo... | {
"repo_name": "santidediego/LearningDjango",
"path": "DjangoApp1/views.py",
"copies": "1",
"size": "3746",
"license": "mit",
"hash": -1076261604978548700,
"line_mean": 27.1578947368,
"line_max": 85,
"alpha_frac": 0.6638184246,
"autogenerated": false,
"ratio": 3.373873873873874,
"config_test": f... |
from django.shortcuts import render, get_list_or_404, get_object_or_404
from django.contrib.auth.decorators import login_required
from django.db import IntegrityError
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect
from .models import Todo
# Create your views here.
@login_req... | {
"repo_name": "kodingway/django-teardown-todo",
"path": "todo/core/views.py",
"copies": "1",
"size": "1883",
"license": "mit",
"hash": -2335504720136935400,
"line_mean": 30.9152542373,
"line_max": 105,
"alpha_frac": 0.6494954859,
"autogenerated": false,
"ratio": 3.750996015936255,
"config_test"... |
from django.shortcuts import render, get_list_or_404, get_object_or_404
from django.http import HttpResponseRedirect
from userprofiles.models import Profile, Project
from wasteprocessors.models import WasteProcessor, MaterialType, Waste, WasteType
from wasteprocessors.forms import WasteForm, SearchFilterForm
# Create... | {
"repo_name": "robalford/reConstruct",
"path": "wasteprocessors/views.py",
"copies": "1",
"size": "2675",
"license": "bsd-3-clause",
"hash": 760973981313203700,
"line_mean": 42.8524590164,
"line_max": 81,
"alpha_frac": 0.651588785,
"autogenerated": false,
"ratio": 3.9865871833084947,
"config_te... |
from django.shortcuts import render, get_list_or_404, get_object_or_404
from django.shortcuts import redirect, render_to_response
from django.template import RequestContext
from django.http import HttpResponse, HttpResponseRedirect
from django.contrib.auth.decorators import login_required
from django.contrib.auth impor... | {
"repo_name": "msvalina/books-of-shika",
"path": "shika/views.py",
"copies": "1",
"size": "9199",
"license": "mit",
"hash": 581640549419044900,
"line_mean": 36.7008196721,
"line_max": 80,
"alpha_frac": 0.6174584194,
"autogenerated": false,
"ratio": 4.26669758812616,
"config_test": false,
"has... |
from django.shortcuts import render, get_list_or_404, get_object_or_404
from django.views import generic
from .models import Post
from .models import Tag
class IndexView(generic.ListView):
template_name = 'myblogapp/index.html'
context_object_name = 'latest_post_list'
current_page = 0
POSTS_PER_PAGE ... | {
"repo_name": "TomGijselinck/mywebsite",
"path": "myblogapp/views.py",
"copies": "1",
"size": "2445",
"license": "mit",
"hash": -4513436312677047000,
"line_mean": 34.4347826087,
"line_max": 109,
"alpha_frac": 0.6335378323,
"autogenerated": false,
"ratio": 3.5129310344827585,
"config_test": fals... |
from django.shortcuts import render, get_list_or_404, get_object_or_404, redirect
from django.http import HttpResponse
from django.http import Http404
from django.db.models.functions import Lower
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from random import randint
from .models import Ques... | {
"repo_name": "automorphisms-of-a-square/mathreview",
"path": "theorems/views.py",
"copies": "1",
"size": "4776",
"license": "mit",
"hash": 5129953555114040000,
"line_mean": 40.1724137931,
"line_max": 132,
"alpha_frac": 0.662479062,
"autogenerated": false,
"ratio": 3.612708018154312,
"config_te... |
from django.shortcuts import render, get_list_or_404
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from blogApp.models import Post
from django.http import HttpResponse
from django.views.decorators.clickjacking import xframe_options_exempt
# import logging
# logger = logging.getLogger(__na... | {
"repo_name": "SPARLab/BikeMaps",
"path": "blogApp/views/index.py",
"copies": "1",
"size": "1345",
"license": "mit",
"hash": -2163796278996758800,
"line_mean": 32.6,
"line_max": 104,
"alpha_frac": 0.7167286245,
"autogenerated": false,
"ratio": 3.337468982630273,
"config_test": false,
"has_no_... |
from django.shortcuts import render, get_list_or_404
from micro_blog.microblog.models import Post, Category, Tags
from django.db.models import Count
from django.conf import settings
# Create your views here.
def categories_tags_lists():
categories_list = Category.objects.filter(is_active=True, post__status='Publ... | {
"repo_name": "nikhila05/micro-blog",
"path": "micro_blog/posts/views.py",
"copies": "1",
"size": "2692",
"license": "mit",
"hash": 758522702158172700,
"line_mean": 39.7878787879,
"line_max": 112,
"alpha_frac": 0.6608469539,
"autogenerated": false,
"ratio": 3.537450722733246,
"config_test": fal... |
from django.shortcuts import render, get_list_or_404
from operator import itemgetter
from collections import OrderedDict
from Teams.models import Team
def standings_index(request):
teams_list = get_list_or_404(Team)
percentage_list = dict()
for team in teams_list:
percentage_list[team] = team.re... | {
"repo_name": "pawelad/BLM",
"path": "Standings/views.py",
"copies": "1",
"size": "1076",
"license": "mit",
"hash": -3621073436807499300,
"line_mean": 36.1034482759,
"line_max": 118,
"alpha_frac": 0.657063197,
"autogenerated": false,
"ratio": 3.802120141342756,
"config_test": false,
"has_no_k... |
from django.shortcuts import render, get_object_or_404 as go404, redirect
from django.views.decorators.http import require_POST
from django.contrib.auth.decorators import login_required
from django.contrib import messages
from django import forms
from .models import Problem, Code, Upvote, Hint, HintUpvote
from django.c... | {
"repo_name": "afg984/happycoding",
"path": "problem/views.py",
"copies": "1",
"size": "4814",
"license": "mit",
"hash": 7688645162002121000,
"line_mean": 31.0933333333,
"line_max": 112,
"alpha_frac": 0.6391773993,
"autogenerated": false,
"ratio": 3.627731725697061,
"config_test": false,
"has... |
from django.shortcuts import render, get_object_or_404, get_list_or_404, HttpResponse, redirect
from .models import Recept, Sestavina, Priprava
from .forms import IngredientsForm, PublishRecipeForm, RecipesForm
from django.db.models import Count
from django.contrib.auth.decorators import login_required
def index(requ... | {
"repo_name": "zigazupancic/recipes",
"path": "getrecipe/views.py",
"copies": "1",
"size": "5127",
"license": "mit",
"hash": -1265155590105694700,
"line_mean": 42.811965812,
"line_max": 113,
"alpha_frac": 0.57530238,
"autogenerated": false,
"ratio": 3.431057563587684,
"config_test": false,
"h... |
from django.shortcuts import render, get_object_or_404, get_list_or_404
from django.contrib.auth.decorators import login_required
from django.http import HttpResponseRedirect, HttpResponse
from django.template import RequestContext, loader
from django.core.urlresolvers import reverse
from django.contrib.auth import log... | {
"repo_name": "steven-martins/Marking",
"path": "back/marks/views.py",
"copies": "1",
"size": "4828",
"license": "mit",
"hash": 2209575040907617500,
"line_mean": 37.0157480315,
"line_max": 99,
"alpha_frac": 0.6603148302,
"autogenerated": false,
"ratio": 3.893548387096774,
"config_test": false,
... |
from django.shortcuts import render, get_object_or_404, get_list_or_404
from django.contrib.auth import authenticate, login, get_user_model
from django.contrib.auth.decorators import login_required
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect
from django.conf import settings... | {
"repo_name": "CharlesGust/django-imagr",
"path": "imagr_site/imagr_app/views.py",
"copies": "2",
"size": "20447",
"license": "mit",
"hash": 5157815092893042000,
"line_mean": 38.0209923664,
"line_max": 79,
"alpha_frac": 0.612314765,
"autogenerated": false,
"ratio": 4.0894,
"config_test": false,... |
from django.shortcuts import render, get_object_or_404, get_list_or_404
from django.http import HttpResponse, HttpResponseRedirect
from django.core.urlresolvers import reverse
from django.conf import settings
from django.core.mail import EmailMultiAlternatives
from django.template import Context
from django.template.lo... | {
"repo_name": "Pshrub/office-poll-topic",
"path": "poll/views.py",
"copies": "1",
"size": "3994",
"license": "mit",
"hash": 1186077747992140800,
"line_mean": 43.8764044944,
"line_max": 111,
"alpha_frac": 0.6960440661,
"autogenerated": false,
"ratio": 3.5756490599820947,
"config_test": false,
... |
from django.shortcuts import render, get_object_or_404, get_list_or_404
from django.http import HttpResponse
from .models import *
NUM_QUESTIONS = 12
def index(request):
# get the quiz in order to grab questions, answers, and create quiz attempt
my_quiz = get_object_or_404(Quiz, name="Ultimate Quiz")
# get the q... | {
"repo_name": "Cdingram/QuizApp",
"path": "quizapp/views.py",
"copies": "1",
"size": "1597",
"license": "apache-2.0",
"hash": 8013510563436430000,
"line_mean": 30.3333333333,
"line_max": 127,
"alpha_frac": 0.7201001879,
"autogenerated": false,
"ratio": 3.299586776859504,
"config_test": false,
... |
from django.shortcuts import render, get_object_or_404, get_list_or_404
from django.http import HttpResponseRedirect
from .models import Event
from main.models import TeamMember
from django.conf import settings
def events(request, template):
events = Event.objects.all()
member = None
if request.user.is_authenticat... | {
"repo_name": "rit-sailing/website",
"path": "events/views.py",
"copies": "1",
"size": "2009",
"license": "mit",
"hash": 7851453564905695000,
"line_mean": 38.3921568627,
"line_max": 146,
"alpha_frac": 0.7401692384,
"autogenerated": false,
"ratio": 3.219551282051282,
"config_test": false,
"has... |
from django.shortcuts import render, get_object_or_404, get_list_or_404
from django import forms
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.http import HttpResponse, HttpResponseRedirect
from django.http import *
from django.views.decorators.csrf import csrf_e... | {
"repo_name": "malerv/gardakan",
"path": "linkUs/chatUs/views.py",
"copies": "1",
"size": "6969",
"license": "apache-2.0",
"hash": 220341146514528600,
"line_mean": 34.0201005025,
"line_max": 108,
"alpha_frac": 0.5881762089,
"autogenerated": false,
"ratio": 4.203256936067551,
"config_test": fals... |
from django.shortcuts import render, get_object_or_404, get_list_or_404;
from django.views.decorators.http import require_GET, require_POST;
from django.http import HttpResponse, HttpResponseNotFound, HttpResponseRedirect;
from django.core.paginator import Paginator;
from django.template import loader;
from .models imp... | {
"repo_name": "etanever/nginx-django-bootstrap",
"path": "ask/qa/views.py",
"copies": "1",
"size": "4046",
"license": "mit",
"hash": -5039964694572584000,
"line_mean": 29.4210526316,
"line_max": 81,
"alpha_frac": 0.7014335146,
"autogenerated": false,
"ratio": 3.2239043824701197,
"config_test": ... |
from django.shortcuts import render, get_object_or_404,get_list_or_404
from quran.models import *
# Create your views here.
def index(request):
suras = get_list_or_404(Sura)
return render(request,'index.html', {'suras': [suras[:38],suras[38:76],suras[76:]]})
def sura(request, sura_number):
cur_trans = int(... | {
"repo_name": "suhailvs/django-quran",
"path": "sample/myapp/views.py",
"copies": "1",
"size": "2151",
"license": "bsd-3-clause",
"hash": -3920789268115039700,
"line_mean": 42.9183673469,
"line_max": 118,
"alpha_frac": 0.6494653649,
"autogenerated": false,
"ratio": 2.822834645669291,
"config_te... |
from django.shortcuts import render, get_object_or_404, get_list_or_404, redirect
from django.contrib.auth.models import User
from django.core.paginator import Paginator, InvalidPage, EmptyPage
from anapneo.neo.models import UserProfile, Neo, Feedback
from anapneo.neo.forms import NeoForm, UserProfileForm, FeedbackFor... | {
"repo_name": "hsgr/anapneo",
"path": "anapneo/neo/views.py",
"copies": "1",
"size": "6141",
"license": "mpl-2.0",
"hash": -7228730388020555000,
"line_mean": 33.6949152542,
"line_max": 116,
"alpha_frac": 0.5935515388,
"autogenerated": false,
"ratio": 3.6882882882882884,
"config_test": false,
... |
from django.shortcuts import render, get_object_or_404, get_list_or_404, redirect
from django.http import HttpResponse
from django.apps import apps
from django.views.generic.detail import DetailView
from django.views.generic.list import ListView
from django.utils import timezone
from collections import OrderedDict
fro... | {
"repo_name": "louisdijkstra/kumbhmela-metadata",
"path": "dataentry/views.py",
"copies": "1",
"size": "7724",
"license": "mit",
"hash": 3269452372496913400,
"line_mean": 27.3970588235,
"line_max": 99,
"alpha_frac": 0.6592439151,
"autogenerated": false,
"ratio": 3.2023217247097846,
"config_test... |
from django.shortcuts import render, get_object_or_404, get_list_or_404, redirect
from django.views.generic import View
from django.core.urlresolvers import reverse_lazy
# from django.core.files.uploadedfile import SimpleUploadedFile
from django.contrib.auth.decorators import login_required
from django.utils.decorators... | {
"repo_name": "Ashkeelun/GitHealth",
"path": "GitHealth/health/views.py",
"copies": "1",
"size": "1528",
"license": "mit",
"hash": 8303872428261794000,
"line_mean": 35.4047619048,
"line_max": 81,
"alpha_frac": 0.7009162304,
"autogenerated": false,
"ratio": 3.9280205655526994,
"config_test": fal... |
from django.shortcuts import render, get_object_or_404, get_list_or_404, redirect, render_to_response
from ECAReview.models import Activity, Review
from django.http import HttpResponseRedirect, HttpResponse
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from django.db.models import Count
from ... | {
"repo_name": "SOMA-PainKiller/ECAReview",
"path": "ECAReview/views.py",
"copies": "1",
"size": "6487",
"license": "mit",
"hash": -7268071164100235000,
"line_mean": 32.6113989637,
"line_max": 122,
"alpha_frac": 0.6344997688,
"autogenerated": false,
"ratio": 3.767131242740999,
"config_test": fal... |
from django.shortcuts import render, get_object_or_404, Http404, HttpResponse
from django.http import HttpResponseRedirect
from django.contrib.contenttypes.models import ContentType
from django.contrib.auth.decorators import login_required
from .forms import CommentForm
from .models import Comment
@login_required #... | {
"repo_name": "shawon922/django-blog-api",
"path": "comments/views.py",
"copies": "1",
"size": "2383",
"license": "mit",
"hash": -7835443795325304000,
"line_mean": 28.4197530864,
"line_max": 77,
"alpha_frac": 0.6290390264,
"autogenerated": false,
"ratio": 3.925864909390445,
"config_test": false... |
from django.shortcuts import render, get_object_or_404, HttpResponseRedirect, HttpResponse
from myblog.models import Article
from django.views.decorators.csrf import csrf_exempt
from django.utils import timezone
from django.core.urlresolvers import reverse
def index(request):
latest_articles = Article.objects.fil... | {
"repo_name": "mileto94/Django-tutorial",
"path": "blog/myblog/views.py",
"copies": "1",
"size": "1557",
"license": "mit",
"hash": 3222530525033545000,
"line_mean": 37.925,
"line_max": 90,
"alpha_frac": 0.6377649326,
"autogenerated": false,
"ratio": 3.9820971867007673,
"config_test": false,
"... |
from django.shortcuts import render, get_object_or_404, HttpResponse, redirect
from django.contrib.auth.decorators import login_required
from django.utils import timezone
from django.contrib import messages
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from django.contrib.auth.models import U... | {
"repo_name": "akbarpn136/logapp-dj",
"path": "perek_tugas/views.py",
"copies": "1",
"size": "35105",
"license": "mit",
"hash": -9212578340464117000,
"line_mean": 41.7588306943,
"line_max": 120,
"alpha_frac": 0.5350519869,
"autogenerated": false,
"ratio": 3.2459546925566345,
"config_test": fals... |
from django.shortcuts import render, get_object_or_404, HttpResponseRedirect
from django.http import HttpResponse
from django.contrib import messages
from .models import Post
from .forms import PostForm
# Create your views here.
def posts_home(request):
return HttpResponse("<h1>sdfd</h1>")
def post_list(reque... | {
"repo_name": "xeroz/crud-django",
"path": "posts/views.py",
"copies": "1",
"size": "1594",
"license": "mit",
"hash": 6525536932636877000,
"line_mean": 20.5405405405,
"line_max": 76,
"alpha_frac": 0.5959849435,
"autogenerated": false,
"ratio": 4.015113350125945,
"config_test": false,
"has_no_... |
from django.shortcuts import render, get_object_or_404, HttpResponseRedirect
from treasure_hunt.models import Level, UserProfile
from django.contrib.auth.decorators import login_required
import django
django.setup() #Hack to fix Models not ready error
def index(request):
return render(request, 'treasurehunt/trea... | {
"repo_name": "code-haven/Django-treasurehunt-demo",
"path": "treasure_hunt/views.py",
"copies": "1",
"size": "1561",
"license": "mit",
"hash": -7037415903785250000,
"line_mean": 42.3611111111,
"line_max": 106,
"alpha_frac": 0.7008327995,
"autogenerated": false,
"ratio": 3.798053527980535,
"con... |
from django.shortcuts import render, get_object_or_404
# Create your views here.
from .models import Classitem
from .switcher import all_dept
from django.http import HttpResponse, JsonResponse
from django.core import serializers
from django.db.models import Q # for search with partial words
def index(request):
# r... | {
"repo_name": "kangsanChang/mjutt",
"path": "timetable/views.py",
"copies": "1",
"size": "2110",
"license": "apache-2.0",
"hash": 5869118710343279000,
"line_mean": 41.3555555556,
"line_max": 124,
"alpha_frac": 0.5891920252,
"autogenerated": false,
"ratio": 2.6435506241331486,
"config_test": fal... |
from django.shortcuts import render, get_object_or_404
from apps.models import App
from download.models import ReleaseDownloadsByDate
def all_stats(request):
apps = App.objects.filter(active=True)
context = {
'apps': apps,
}
return render(request, 'all_stats.html', context)
def app_stats(... | {
"repo_name": "abhijithanilkumar/ns-3-AppStore",
"path": "src/download/views.py",
"copies": "1",
"size": "1230",
"license": "mit",
"hash": -1890574664600644400,
"line_mean": 30.5384615385,
"line_max": 81,
"alpha_frac": 0.612195122,
"autogenerated": false,
"ratio": 3.682634730538922,
"config_tes... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.