Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6355813
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T22:50:27+00:00 2026-05-24T22:50:27+00:00

Have this error while creating tutorial: http://img718.imageshack.us/img718/2194/unled2bh.jpg Have no freakin idea what’s wrong. It’s

  • 0

Have this error while creating tutorial:
http://img718.imageshack.us/img718/2194/unled2bh.jpg

Have no freakin idea what’s wrong. It’s displays when i added this modifications:

settings.py:

TEMPLATE_CONTEXT_PROCESSORS = (
    'django.core.context_processors.auth',
    'django.core.context_processors.i18n',
    'django.core.context_processors.media',
    'sklep.context_processors.koszyk'
)

EMAIL_PORT = 1025
EMAIL_SKLEPU = 'sklep@sklep-z-koszulkami.pl'

sklep/urls.py

url(r'^koszyk/$', 'koszyk', name="sklep_koszyk"),
url(r'^koszyk/dodaj/(\d+)/$', 'koszyk_dodaj', name="sklep_koszyk_dodaj"),

sklep/views.py

# coding: utf-8
from django.http import HttpResponseRedirect
from django.core.urlresolvers import reverse
from django.views.generic.simple import direct_to_template
from django.core.mail import send_mail
from django.template import Context, loader
from django.conf import settings
from sklep.models import Produkt
from sklep.forms import ZamowienieForm

def koszyk(request):
    koszyk = request.session.get('koszyk', [])
    produkty = list(Produkt.objects.filter(pk__in=koszyk))

    if request.method == 'POST':
        formularz = ZamowienieForm(request.POST)

        if formularz.is_valid():
            dane = formularz.cleaned_data
            tresc = loader.get_template('sklep/zamowienie.txt').render(Context({'produkty': produkty, 'dane': dane}))

            send_mail('Potwierdzenie zakupu', tresc, settings.EMAIL_SKLEPU, [dane['email']])
            send_mail(u'Zamówienie', tresc, dane['email'], [settings.EMAIL_SKLEPU])

            del request.session['koszyk']

            return HttpResponseRedirect(reverse('sklep_koszyk'))
    else:
        formularz = ZamowienieForm()

    if koszyk:
        kontekst = {'koszyk': produkty, 'formularz': formularz}
    else:
        kontekst = {'koszyk': []}

    return direct_to_template(request, 'sklep/koszyk.html', extra_context = kontekst)

def koszyk_dodaj(request, id_produktu):
    koszyk = request.session.get('koszyk', [])
    if int(id_produktu) not in koszyk:
        koszyk.append(int(id_produktu))
    request.session['koszyk'] = koszyk
    return HttpResponseRedirect(reverse('sklep_koszyk'))

context_processors.py

def koszyk(request): return {'stan_koszyka':len(request.session.get('koszyk', []))}

And i have added two templates.
Error shows up, when i enter /sklep/koszyk/ or /sklep/koszyk/dodaj/1/ URL…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T22:50:28+00:00Added an answer on May 24, 2026 at 10:50 pm

    You need to use the full path to your views in urls.py:

    url(r'^koszyk/$', 'app_name.views.koszyk', name="sklep_koszyk"),
    url(r'^koszyk/dodaj/(\d+)/$', 'app_name.views.koszyk_dodaj', name="sklep_koszyk_dodaj"),
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I get this error, while I'm testing the code below: You have an error
i have a problem while loading a UITableView on UITabBarController, i got this error
now I have been at this for a while and there is an error
I am getting this error while creating a public method on a class for
I have no idea what this error is about. It is refusing to compile.
Are you familiar with this error? I have no idea how to fix this:
I am getting this error message while creating table with one of the column
I have this error when trying to generate the meta model with JOOQ: org.jooq.exception.DataAccessException:
I Have this error message : Possible unitended reference comparison; to get a value
I have this error message: Msg 8134, Level 16, State 1, Line 1 Divide

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.