Wednesday, February 10, 2016

w5d3 - Django, and the perils of paint-by-numbers

Today was more Django. I wish I could say it was enlightening, but it's still mostly cut, paste, and pray.  We're working on a super-simplistic ecommerce site with several pages of pseudo products. My only real extension was working on adding images to pages via templating, with each product associated with a particular picture.  I got all the elements working ok (a links field added to the model, images in the static files folder, but I just could not figure out the templating syntax.  Eventually, with an instructors help, I was able to get the images working.

Perhaps more interestingly, I looked into the python scripts that comprise Django. Holy spiderweb, batman! Every module references several other modules.  I had some idea of trying to unravel the underpinnings of Django,but I'm not sure that's reasonable in one human life time.  Instead, I think I will try to work out how the render function works, and especially how it parses the templating script.


All of this section makes me very uncomfortable.  Python was just feeling reasonably comfortable.  Even if I didn't know how to make something work, I understood enough to ask google for help in an intelligent way.  So much of Django is just magic so far.  I often don't even know  how to formulate a searchable question.  Hopefully, familiarity through repetition will make the framework more approachable.

No comments:

Post a Comment