Django

117 views
Skip to first unread message

Srinivasulu Reddy

unread,
Apr 19, 2014, 2:07:38 AM4/19/14
to django...@googlegroups.com

Hello folks,
                 I am new to python/django . i am earning myself i want to know effective way of learning python / django . i am following django book for django .  Light bird apps also.

So please anyone can help me to find the good way learn the python / django . I love to learn the python / django .

François Schiettecatte

unread,
Apr 19, 2014, 10:52:20 AM4/19/14
to django...@googlegroups.com
The tutorial on the django site is very good, and there is a wealth of documentation. That is how I learnt django.

And the OReilly books for python are great, as is Dive Into Python by Pilgrim.

François
> --
> 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/00b6b705-9442-44a1-b61e-968ccab6ee1f%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

signature.asc

Mark Phillips

unread,
Apr 19, 2014, 11:02:08 AM4/19/14
to django users
"Two Scoops of Django" is also very good.

I would suggest following the tutorial from start to finish and build the poll app. This will give you a hands on over view of the basics. 

After the poll app, come up with a project of your own and start building it. Use a virtual environment, git, south, wsgi, apache and fabrik to develop on one machine using runserver and deploy the app to an Apache server on another machine. There is lots of online documentation on how to set all this up. You will spend some time on just getting the development/deployment environment working, which is also a good learning experience. As you come up with ideas along the lines of "How would I make my app do ......", search the documentation and THEN ask specific questions. Be creative and have some fun!

Good luck!

Mark

John DeRosa

unread,
Apr 19, 2014, 11:03:10 AM4/19/14
to django...@googlegroups.com

On Apr 19, 2014, at 8:02 AM, Mark Phillips <ma...@phillipsmarketing.biz> wrote:

> "Two Scoops of Django" is also very good.
>
>

+1 for TSoD. Super book!

Mario Gudelj

unread,
Apr 20, 2014, 12:16:18 AM4/20/14
to django...@googlegroups.com

Two scoops is not a beginner's book. Start with tutorials. The one on django site is a must, but there are lots of other tuts as well on the net. Tango with django is a good one. Also django book is awesome resource although somewhat outdated now. But I'd read first 7 chapters anyway

--
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.

Srinivasulu Reddy

unread,
Apr 20, 2014, 1:53:44 AM4/20/14
to django...@googlegroups.com
Hello mark,
   
             I got suggestion what you all mention was great to me. I did poll application and have some basic view on django, but thing I have to mention here is there are so many module how learn all these in effective way. Like for example take 'django.templates' , it contain different fields and modules , functions like RequestContext ,loader . How do i learn these in useful way .

Mark Phillips

unread,
Apr 20, 2014, 3:12:33 PM4/20/14
to django users
It all depends on how you learn. You can read the API documentation and gain a good understanding of what django provides as a framework. Or, read the source and the comments to really understand what is going on. Reading the source is a great use of your time.

Personally, I find it easier to learn the different aspects of a framework by building something and running into situation of "how would I implement functionality X", and then read the docs, forums, source and ask questions to see how others solved this problem. One advantage is that you learn **how** to find "django answers" to specific problems/issues as well as how to use the framework. But everyone learns differently, so you need to do what is best for your style of learning.

YMMV,

Mark


--
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.

Srinivasulu Reddy

unread,
Apr 23, 2014, 2:05:28 AM4/23/14
to django...@googlegroups.com

I am getting error in poll app tutorial 4 in when changed the results view and creating results.html .

 I am posting screen shot’s of both terminal and in my browser showing content



Exception value is String index out of range in django .





Screenshot from 2014-04-23 09:26:39.png
Screenshot from 2014-04-23 09:28:06.png

Daniel Roseman

unread,
Apr 23, 2014, 3:28:54 AM4/23/14
to django...@googlegroups.com
Why have you posted screenshots of text to a text-based newsgroup? Please copy and paste the relevant text into a message (the Django error page even has a special link to go to a copy and paste view).
--
DR.

Srinivasulu Reddy

unread,
Apr 23, 2014, 5:27:45 AM4/23/14
to django...@googlegroups.com
Hi Daniel ,


      you asked me copy and paste the error i got. In dealing of poll app part 4 help me to find a way to solve the problem in dealing with results.html and results view .

   Before changing results view it's working good. After changing result view and after creating in results.html . I am getting this problem after clicking "Vote" buttion on my browser.


  python manage.py runserver

Validating models...

0 errors found
April 23, 2014 - 09:20:10
Django version 1.6.2, using settings 'dj_tutorial.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
[23/Apr/2014 09:20:15] "GET /poll/ HTTP/1.1" 200 408
[23/Apr/2014 09:20:18] "GET /poll/specifics/7/ HTTP/1.1" 200 599
[23/Apr/2014 09:20:23] "POST /poll/7/votes/ HTTP/1.1" 302 0
Internal Server Error: /poll/7/results/
Traceback (most recent call last):
  File "/root/.virtualenvs/djan/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 114, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/home/seenu/work/Django_proj/d_tutorial/dj_tutorial/poll/views.py", line 24, in results
    poll = get_object_or_404(Poll, poll_id)
  File "/root/.virtualenvs/djan/local/lib/python2.7/site-packages/django/shortcuts/__init__.py", line 113, in get_object_or_404
    return queryset.get(*args, **kwargs)
  File "/root/.virtualenvs/djan/local/lib/python2.7/site-packages/django/db/models/query.py", line 298, in get
    clone = self.filter(*args, **kwargs)
  File "/root/.virtualenvs/djan/local/lib/python2.7/site-packages/django/db/models/query.py", line 590, in filter
    return self._filter_or_exclude(False, *args, **kwargs)
  File "/root/.virtualenvs/djan/local/lib/python2.7/site-packages/django/db/models/query.py", line 608, in _filter_or_exclude
    clone.query.add_q(Q(*args, **kwargs))
  File "/root/.virtualenvs/djan/local/lib/python2.7/site-packages/django/db/models/sql/query.py", line 1192, in add_q
    if not self.need_having(q_object):
  File "/root/.virtualenvs/djan/local/lib/python2.7/site-packages/django/db/models/sql/query.py", line 1155, in need_having
    return any(self.need_having(c) for c in obj.children)
  File "/root/.virtualenvs/djan/local/lib/python2.7/site-packages/django/db/models/sql/query.py", line 1155, in <genexpr>
    return any(self.need_having(c) for c in obj.children)
  File "/root/.virtualenvs/djan/local/lib/python2.7/site-packages/django/db/models/sql/query.py", line 1153, in need_having
    or (hasattr(obj[1], 'contains_aggregate')
IndexError: string index out of range
[23/Apr/2014 09:20:24] "GET /poll/7/results/ HTTP/1.1" 500 91775

Srinivasulu Reddy

unread,
Apr 24, 2014, 7:10:33 AM4/24/14
to django...@googlegroups.com


On Wednesday, April 23, 2014 2:57:45 PM UTC+5:30, Srinivasulu Reddy wrote:
Hi Folksl ,


      In dealing with poll app tutorial 4 i am getting an error, posting it down. Help me to find a way to solve the problem in dealing with results.html and results view . It's throwing IndexError.

   Before changing results view it's working good. After changing result view and after creating in results.html . I am getting this problem after clicking "Vote" button on my browser.  Is anyone there to help me

Lee

unread,
Apr 24, 2014, 11:36:56 AM4/24/14
to django...@googlegroups.com
Can you share your views.py, result.html and urls.py?

Lee

unread,
Apr 25, 2014, 4:05:58 PM4/25/14
to django...@googlegroups.com
In case you dont see my email, I copy my reply here too:

Hi, 

Your problem is in the results view function. I'm not sure what version of the tutorial you are following, but assuming you are using Django 1.6, the following:

def results(request, poll_id):
    poll = get_object_or_404(Poll, poll_id)
    return render(request, 'poll/results.html', {'poll':poll})

Should be:

def results(request, poll_id):
    poll = get_object_or_404(Poll, pk=poll_id)
    return render(request, 'poll/results.html', {'poll':poll})

Hope it helps. 

Srinivasulu Reddy

unread,
Apr 26, 2014, 5:17:24 AM4/26/14
to django...@googlegroups.com
Hello Lee,

    Thank you Lee, after changing the code according to your suggestion, it's working. 
Reply all
Reply to author
Forward
0 new messages