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

32 views
Skip to first unread message

Amimo Benja

unread,
Dec 13, 2013, 8:30:57 AM12/13/13
to django...@googlegroups.com
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. 


Thanks.

I will gladly appreciate

Amirouche Boubekki

unread,
Dec 13, 2013, 11:52:50 AM12/13/13
to django...@googlegroups.com
Héllo Amimo,


2013/12/13 Amimo Benja <amimob...@gmail.com>
simple_prototype_of_online_voting_system
==================================

The name must be shorter. «voting_system» is good for instance
 
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. 


It seems like I can vote several time. I'not sure because I see nowhere the number of vote casted.

- The repository is missing the link to the website (first link)
- Which version of Python/Django do you use?

Code review:

The overal is not bad, need improvement but the app is small so there is little to comment actually so what follows is mostly *remarks* not big mistakes

- use render instead of render_to_response
- here, you are already doing rendering in the view, it's not good, you should use a filter in a template, also
- in the same function, you defined two times context_dict
- here, try/except is too big, you must only wrap the statment that raise the exception except if you know what you do...
- Also, you seem to simply return if there is an error. This is a mistake.
- here, there is not type checking on the identifier and existence checking, you must return 404 or 5xx depending on the error.
- «vq_chc.final_count += final_count» works well.
- about function is useless, just use a generic template view for that no need to have a view.
- Also enforce pep8, 4spaces instead of 8, no short names like «abt» instead of «about». It's useless cognitive load for the reader.

HTH

Thanks.

I will gladly appreciate

Amirouche

Amirouche Boubekki

unread,
Dec 13, 2013, 2:13:01 PM12/13/13
to django...@googlegroups.com
- «vq_chc.final_count += final_count» works well.
You need to use Django update or the operation is not atomic.

Amimo Benja

unread,
Dec 13, 2013, 2:34:10 PM12/13/13
to django...@googlegroups.com
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...@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...@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/CAL7_Mo-qYLrnDGd9%3DXNfQGN9g1hJze5%3D_H7-KyobHm3av7vn-g%40mail.gmail.com.

For more options, visit https://groups.google.com/groups/opt_out.

Reply all
Reply to author
Forward
0 new messages