Reverse not found problem

2019-05-02 Thread Metin AKIN
Hello, I'm new to django. I have faced with this problem and couldn't find 
an answer to my problem. I zip 2 lists and I want to iterate them 
simultaneously.

I get this error 
>
> Reverse for '{{newspaper}}' not found. '{{newspaper}}' is not a valid view 
> function or pattern name.
>
>

my html file

> {% extends "index-template.html" %}
>>
>> {% block content %}
>> {% load staticfiles %}
>> {% for newspaper, newspaper_name in mylist %}
>> 
>> 
>>  > %}"...
>> {% endfor %}
>> {% endblock %}
>
>
>
>

my index fuction in views.py
def index(request):
newspapers = ["BBC", "Guardian"]

newspaper_names = ["BBC News", "The Guardian"]
mylist = zip(newspapers, newspaper_names)

return render(request, "index.html", {"currentdate": getcurrentdate(), 
"mylist": mylist})

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a80a350b-040b-4e9d-9954-44032ccc9a7c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Overriding Django Form Model Errors

2019-07-28 Thread Metin AKIN


[image: Capture.PNG] [image: Capture - Copy.PNG] 

Hello,
I'm trying to implement a signup form but I couldn't override default field 
error messages. For example, as you can see I get "your password can't be 
too similar" error but I want to show them in custom alert window with 
bootstrap such as the right-hand side image. I don't want to use any 
bootstrap extension.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/5eb6fdf1-45e1-4ad3-819c-7cd425bd047f%40googlegroups.com.