Monday, May 26, 2014

Re: Anyone interested in reviewing the code of a small project - BookMarker

Looks like you're getting a handle on django.
You're not using Class Based Views, but you import generic.  Since you're getting familiar with django, you *might* want to hold off on delving into CBVs.  They're very powerful and can reduce coding, but can be difficult to wrap your head around. 

Once you've created your app with functions, then perhaps go back and wrap 'em in CBV's.  CBV's have a lot of power, but while learning the basics, sticking with functions can be a lot less assimilate all at once.

In your template, you have CSS at the bottom. CSS is typically linked in the <head></head> section.  I suppose most web browsers today are okay either way.  Javascript/jquery is typically near the end of the html, as you have it.

I wish w3c/html5 spec'd tags for <css></css> and <script></script> locations.  Javascript more than css links seem feel sloppy to me, ahh well, it is what it is.

Next, I suspect you might want to work on a base.html and working with {{include's}}.  It's a fairly easy concept to grasp and some of the beauty of django's templating.  I wouldn't recommend delving into custom template tags yet, but it's good to know they exist.

You're template is not complex, being familiar with partials is an easy way to keep it simpler.

-Joe

--
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+unsubscribe@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/d5999370-00bb-4bd8-8982-59dab7eb3630%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment