Tango with Django Chapter 7 (Add_page)

2013-11-13 Thread Amimo Benja
Hey all,

Am currently practicing using this tutorial 
http://www.tangowithdjango.com/book/chapters/forms.html, but I'm constantly 
getting this error "The current URL, rango/category//add_page/, didn't 
match any of these." every time I click on the Add a 
Page link 
in the Category.html. I don't know how to solve it. Any help? Thanks.

Here are my 
1. Views.py http://pastebin.mozilla.org/3595121
2. rango/urls.py http://pastebin.mozilla.org/3595145
3. add_page.html http://pastebin.mozilla.org/3595156
4. category.html http://pastebin.mozilla.org/3595158

-- 
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/4731ffd8-f500-40a2-af7b-9587195bc092%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Tango with Django tutorial, problem getting category function to pass a variable

2013-11-13 Thread Amimo Benja
Hi Jimmy am currently facing an error that "The current URL, 
rango/category//add_page/, didn't match any of these." How did you resolve 
it?

On Sunday, October 27, 2013 12:01:06 PM UTC+3, James Yeo wrote:
>
> Hey yall
>
> Here is my current views.py:
>
> http://pastebin.mozilla.org/3361332
>
> PROBLEM:
>
> I'm trying to add an "Add Page" form to the project, per the tutorial at 
> this step:
>
>
> http://www.tangowithdjango.com/book/chapters/forms.html#creating-an-add-pages-view-template-and-url-mapping
>
> When I click on "Add Page" in a category view, I get
>
> TypeError at /rango/add_page/ 
>
> add_page() takes exactly 2 arguments (1 given)
>
>
> THOUGHTS:
>
> So far as I can tell, line 60 adds category_name_url to context_dict, 
> which means that category_name_url should go into the context that gets 
> passed on.. or else I am seriously failing to grasp this, which is the more 
> likely idea. I'm pretty sure I can't just add another argument to the 
> render_to_response, so the only other option I can think of is to put a 
> dictionary in the render_to_response, which includes category_name_url... 
> BUT I don't know what all else is in the context_dict at that point. 
>
> been fiddling with this for a couple hours now, seemingly getting nowhere. 
> I based my current code on the stuff 
> here
> .
>

-- 
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/16e7b037-bccb-4577-9458-de534b242a3b%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Tango with Django tutorial, problem getting category function to pass a variable

2013-11-13 Thread Amimo Benja
More details please.


On Wed, Nov 13, 2013 at 3:22 PM, Sergiy Khohlov  wrote:

> check your template. or html
> Many thanks,
>
> Serge
>
>
> +380 636150445
> skype: skhohlov
>
>
> On Wed, Nov 13, 2013 at 2:18 PM, Amimo Benja 
> wrote:
> > Hi Jimmy am currently facing an error that "The current URL,
> > rango/category//add_page/, didn't match any of these." How did you
> resolve
> > it?
> >
> >
> > On Sunday, October 27, 2013 12:01:06 PM UTC+3, James Yeo wrote:
> >>
> >> Hey yall
> >>
> >> Here is my current views.py:
> >>
> >> http://pastebin.mozilla.org/3361332
> >>
> >> PROBLEM:
> >>
> >> I'm trying to add an "Add Page" form to the project, per the tutorial at
> >> this step:
> >>
> >>
> >>
> http://www.tangowithdjango.com/book/chapters/forms.html#creating-an-add-pages-view-template-and-url-mapping
> >>
> >> When I click on "Add Page" in a category view, I get
> >>
> >> TypeError at /rango/add_page/
> >>
> >> add_page() takes exactly 2 arguments (1 given)
> >>
> >>
> >> THOUGHTS:
> >>
> >> So far as I can tell, line 60 adds category_name_url to context_dict,
> >> which means that category_name_url should go into the context that gets
> >> passed on.. or else I am seriously failing to grasp this, which is the
> more
> >> likely idea. I'm pretty sure I can't just add another argument to the
> >> render_to_response, so the only other option I can think of is to put a
> >> dictionary in the render_to_response, which includes
> category_name_url...
> >> BUT I don't know what all else is in the context_dict at that point.
> >>
> >> been fiddling with this for a couple hours now, seemingly getting
> nowhere.
> >> I based my current code on the stuff here.
> >
> > --
> > 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 http://groups.google.com/group/django-users.
> > To view this discussion on the web visit
> >
> https://groups.google.com/d/msgid/django-users/16e7b037-bccb-4577-9458-de534b242a3b%40googlegroups.com
> .
> >
> > For more options, visit https://groups.google.com/groups/opt_out.
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Django users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/django-users/27JudVqDgD8/unsubscribe.
> To unsubscribe from this group and all its topics, 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 http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CADTRxJOq4J5WzywGeO_1SX6tSacOkWBQqpd5eram7%3Dz6O9kJ2Q%40mail.gmail.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CA%2B5znFG1p3WXtT1%3DMwjoBw_g%3Du15YZxP%3DArwhX8ijD6z_OVChA%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Tango with Django Chapter 7 (Add_page)

2013-11-14 Thread Amimo Benja
It seems not to be working. It raises an error that Invalid block tag: 
''views:category_name_url''

On Wednesday, November 13, 2013 3:38:47 PM UTC+3, Sergiy Khohlov wrote:
>
> try to change 
> Add a Page 
>  to 
> Add a Page 
> Many thanks, 
>
> Serge 
>
>
> +380 636150445 
> skype: skhohlov 
>
>
> On Wed, Nov 13, 2013 at 2:14 PM, Amimo Benja 
> > 
> wrote: 
> > Hey all, 
> > 
> > Am currently practicing using this tutorial 
> > http://www.tangowithdjango.com/book/chapters/forms.html, but I'm 
> constantly 
> > getting this error "The current URL, rango/category//add_page/, didn't 
> match 
> > any of these." every time I click on the Add a Page link in the 
> > Category.html. I don't know how to solve it. Any help? Thanks. 
> > 
> > Here are my 
> > 1. Views.py http://pastebin.mozilla.org/3595121 
> > 2. rango/urls.py http://pastebin.mozilla.org/3595145 
> > 3. add_page.html http://pastebin.mozilla.org/3595156 
> > 4. category.html http://pastebin.mozilla.org/3595158 
> > 
> > -- 
> > 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...@googlegroups.com . 
> > To post to this group, send email to 
> > django...@googlegroups.com. 
>
> > Visit this group at http://groups.google.com/group/django-users. 
> > To view this discussion on the web visit 
> > 
> https://groups.google.com/d/msgid/django-users/4731ffd8-f500-40a2-af7b-9587195bc092%40googlegroups.com.
>  
>
> > For more options, visit https://groups.google.com/groups/opt_out. 
>

-- 
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/ad99603c-5f6b-41e4-9b55-3509c6c348b1%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Tango with Django Chapter 7 (Add_page)

2013-11-14 Thread Amimo Benja
Thanks Lee, it worked. The problem was I had not passed category_name_url 
from my view function to the category template. The moment I passed it, it 
worked without any problem. Thanks a lot Man. At least I can proceed. 
Phee...w!!! Thanks again.

On Thursday, November 14, 2013 3:08:27 PM UTC+3, Lee wrote:
>
> Noob here so I may be way wrong but it looks to me like your problem is 
> probably in link in category page when generating the link to add_page, 
> given the url in the error is missing the category name in the URL. Have 
> you passed category_name_url from your view function to the category 
> template? Your views.py link seems to show forms.py rather than the view 
> functions so I cant see the view, but my category view looks as follows and 
> works:
>
>  def category(request, category_name_url):
> context = RequestContext(request)
> category_name = decode_url(category_name_url)
> context_dict = {'category_name': category_name, 'category_name_url': 
> category_name_url}
>
> try:
> category = Category.objects.get(name=category_name)
> pages = Page.objects.filter(category=category)
> context_dict['pages'] = pages
> context_dict['category'] = category
> except Category.DoesNotExist:
> pass
>
> return render_to_response('rango/category.html', context_dict, context)
>
> And I am also mid way through Tango with Django if you hadn't guessed ;-)
>
>
> On Wednesday, 13 November 2013 12:14:40 UTC, Amimo Benja wrote:
>>
>> Hey all,
>>
>> Am currently practicing using this tutorial 
>> http://www.tangowithdjango.com/book/chapters/forms.html, but I'm 
>> constantly getting this error "The current URL, 
>> rango/category//add_page/, didn't match any of these." every time I 
>> click on the Add a Page <http://127.0.0.1:8000/rango/category//add_page/> 
>> link 
>> in the Category.html. I don't know how to solve it. Any help? Thanks.
>>
>> Here are my 
>> 1. Views.py http://pastebin.mozilla.org/3595121
>> 2. rango/urls.py http://pastebin.mozilla.org/3595145
>> 3. add_page.html http://pastebin.mozilla.org/3595156
>> 4. category.html http://pastebin.mozilla.org/3595158
>>
>>

-- 
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/74663178-37fa-4124-9a6a-82e069c636f3%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Tango with Django Chapter 7 (Add_page)

2013-11-20 Thread Amimo Benja
Hi Lee,

I have been continuing with the django tutorials and at the moment I am on 
chapter 10 dealing with cookies.

On the exercises when a user logs in and clicks the about page link, mine 
just shows he visited the site 1 time no matter how many times he clicks on 
the about page. Is it supposed to be so or am I missing something? 

On Thursday, November 14, 2013 4:49:13 PM UTC+3, Lee wrote:
>
> No problem at all, glad it worked out for you :-)
>
> Good luck with the rest of the tutorial
>
> Cheers
>
> On Thursday, 14 November 2013 12:16:06 UTC, Amimo Benja wrote:
>>
>> Thanks Lee, it worked. The problem was I had not passed category_name_url 
>> from my view function to the category template. The moment I passed it, it 
>> worked without any problem. Thanks a lot Man. At least I can proceed. 
>> Phee...w!!! Thanks again.
>>
>> On Thursday, November 14, 2013 3:08:27 PM UTC+3, Lee wrote:
>>>
>>> Noob here so I may be way wrong but it looks to me like your problem is 
>>> probably in link in category page when generating the link to add_page, 
>>> given the url in the error is missing the category name in the URL. Have 
>>> you passed category_name_url from your view function to the category 
>>> template? Your views.py link seems to show forms.py rather than the view 
>>> functions so I cant see the view, but my category view looks as follows and 
>>> works:
>>>
>>>  def category(request, category_name_url):
>>> context = RequestContext(request)
>>> category_name = decode_url(category_name_url)
>>> context_dict = {'category_name': category_name, 'category_name_url': 
>>> category_name_url}
>>>
>>> try:
>>> category = Category.objects.get(name=category_name)
>>> pages = Page.objects.filter(category=category)
>>> context_dict['pages'] = pages
>>> context_dict['category'] = category
>>> except Category.DoesNotExist:
>>> pass
>>>
>>> return render_to_response('rango/category.html', context_dict, context)
>>>
>>> And I am also mid way through Tango with Django if you hadn't guessed ;-)
>>>
>>>
>>> On Wednesday, 13 November 2013 12:14:40 UTC, Amimo Benja wrote:
>>>>
>>>> Hey all,
>>>>
>>>> Am currently practicing using this tutorial 
>>>> http://www.tangowithdjango.com/book/chapters/forms.html, but I'm 
>>>> constantly getting this error "The current URL, 
>>>> rango/category//add_page/, didn't match any of these." every time I 
>>>> click on the Add a Page<http://127.0.0.1:8000/rango/category//add_page/> 
>>>> link 
>>>> in the Category.html. I don't know how to solve it. Any help? Thanks.
>>>>
>>>> Here are my 
>>>> 1. Views.py http://pastebin.mozilla.org/3595121
>>>> 2. rango/urls.py http://pastebin.mozilla.org/3595145
>>>> 3. add_page.html http://pastebin.mozilla.org/3595156
>>>> 4. category.html http://pastebin.mozilla.org/3595158
>>>>
>>>>

-- 
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d2b32510-a687-41c3-925a-f139759b346d%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Tango with Django Tutorials

2013-11-22 Thread Amimo Benja
Does anyone know how I can convert the entire Tango with Django Tutorials 
from online to an offline website that I can store and use on my hard disk? 
Please help I desperately need to use this site while am offline

-- 
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/2373b9c1-c6a7-4f79-b391-c70497f6e47e%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Tango with Django Tutorials

2013-11-22 Thread Amimo Benja
Thanks Felipe Coelho, it worked perfectly... At least now I don't have to
worry about the internet being there or not.


On Fri, Nov 22, 2013 at 2:15 PM, Felipe Coelho  wrote:

> On Nov 22, 2013 7:01 AM, "Amimo Benja"  wrote:
> >
> > Does anyone know how I can convert the entire Tango with Django
> Tutorials from online to an offline website that I can store and use on my
> hard disk? Please help I desperately need to use this site while am
> offline
>
> The book is open source, just download the sources and make your own local
> copy with sphinx
>
> https://github.com/leifos/tango_with_django_book
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Django users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/django-users/bwJConCLNdw/unsubscribe.
> To unsubscribe from this group and all its topics, 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 http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAP5dYfMYFJkMmk3Zuh8jNr390ECVcfTyY_O6J-gN5NF4eXugGA%40mail.gmail.com
> .
>
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CA%2B5znFGuNkDhKvEPf6S%2BmsVYN%2BLfShjoWMXSatN8wOC3V-6DWQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Finished and Published Tango with Rango Tutorials

2013-11-30 Thread Amimo Benja
Hello, 

I finished the Tango with Rango Tutorials and published the app at 
amimobenja.pythonanywhere.com/rango/ however it is not working as expected.

Check out the site and review the whole whole code at 
https://github.com/amimobenja/tango_with_django and recommend any necessary 
changes. 

-- 
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/4c9c4d03-f868-4d3b-abc7-0fecddd7dd90%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Finished and Published Tango with Rango Tutorials

2013-12-01 Thread Amimo Benja
Yeah, that's what I also thought... I will update the recommended
changes... Thanks Lee.


On Sat, Nov 30, 2013 at 11:09 PM, Lee  wrote:

> Presumably you are talking about the left menu being broken and the 'Find
> a category' not working?
>
> For the first, looks like you are missing a closing div for the top nav
> bar. Regarding the Find a category not working, I had the same issue and
> there was a problem in the tutorial with an extra tab that should not have
> been there. If I recall, the issue was in the suggest_category view and it
> relates to the following line:
>
> cat_list = get_category_list(8, starts_with)
>
>
> That line should not be tabbed as shown in the tutorial as the tab causes
> it to become part of the above else and so cat_list is not populates as
> expected. Have a look at the final code from the reference site:
>
>
> https://github.com/leifos/tango_with_django/blob/master/tango_with_django_project/rango/views.py
>
>
> On Saturday, 30 November 2013 12:31:13 UTC, Amimo Benja wrote:
>>
>> Hello,
>>
>> I finished the Tango with Rango Tutorials and published the app at
>> amimobenja.pythonanywhere.com/rango/ however it is not working as
>> expected.
>>
>> Check out the site and review the whole whole code at https://github.com/
>> amimobenja/tango_with_django and recommend any necessary changes.
>>
>  --
> You received this message because you are subscribed to a topic in the
> Google Groups "Django users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/django-users/qfC7vgTY4jg/unsubscribe.
> To unsubscribe from this group and all its topics, 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 http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/69476e68-6cd3-4c75-87ed-497f398bca10%40googlegroups.com
> .
>
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CA%2B5znFEzerL521LKMzs-K_%2Btm13J-jRz4ajk3KaU-PZD7xnf6Q%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Prototype of an Online Voting System (I need some constructive criticism here)

2013-12-13 Thread Amimo Benja
simple_prototype_of_online_voting_system

I am new to Django/Python. After a few tutorial, I have tried to develop 
this app.

However, I need some constructive criticism as the app needs to be made 
better and improved.

Please view it and highlight the problem/issues cause I know it has a lot 
of issues and then recommend 
the necessary changes and how to implement those changes. 

Access the app at http://amimobenja.pythonanywhere.com/voting_system/

The code can be accessed at 
https://github.com/amimobenja/simple_prototype_of_online_voting_system
Thanks.

I will gladly appreciate

-- 
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/37b3ef1c-2cde-4d1a-a4d1-a87622718e40%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Prototype of an Online Voting System (I need some constructive criticism here)

2013-12-13 Thread Amimo Benja
Amirouche, the recommendations are actually great.

I new to Django and Python, so how to implement them exactly as you
recommend to me is a little bit difficult.

Can you please fork the repository and update the code so that I can view
how you have implement the changes, if that is fine with you...




On Fri, Dec 13, 2013 at 10:13 PM, Amirouche Boubekki <
amirouche.boube...@gmail.com> wrote:

>
>
> - «vq_chc.final_count += final_count» works well.
>>
> You need to use Django update or the operation is not atomic.
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Django users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/django-users/RzMQiH4345U/unsubscribe.
> To unsubscribe from this group and all its topics, 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 http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAL7_Mo-qYLrnDGd9%3DXNfQGN9g1hJze5%3D_H7-KyobHm3av7vn-g%40mail.gmail.com
> .
>
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CA%2B5znFHwMvVVRsi8vd8B6VMC6LXixb1nKWiMPJ17cp5-YXey8g%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.