Re: Some questions on using Django
On Wed, Feb 11, 2009 at 9:39 AM, koranthala wrote: > (1) >Could somebody let me know whether this is usual? Am I missing > some basic viewpoints which is causing me to write far too much code > than necessary? i.e. Am I or am I not following Django framework > properly? No, this approach is quite normal for an AJAX-heavy RIA. Templates make writing the HTML portion of your site easier, but if your sites are, as you say, almost entirely JavaScript-based, then I'd think it very natural not to use templates much. I have been building web apps for a while, but only recently have I begun to use much JavaScript. I use templates quite a bit, and find they make my life easier, but I'm only adding jQuery plug-ins, so more of my front-end code is HTML than JavaScript. However, I have found some utility in using various template tags within my JavaScript. > > (2) >Another question that I have is - is it usual to have no major > architecture in the web coding? > I am very much worried that I am missing something major and it is > going to blow up in my face later. If someone can help me on this too, > it would be very helpful. > There are some best practices in terms of code organization (making your apps reusable, directory layout, etc.), but really the entire point of using a framework such as Django is that the framework handles the 80% of the code that you'd need to rewrite for every web application you build, while allowing you to concentrate on the 20% of the code that is the domain-specific logic. Thus, a lot of the stuff you'd have to do that would otherwise emerge as a pattern in web architecture is already built in to Django. The other nice part is that Python itself has little need for programmers to use design patterns, as the language has been designed to address the flaws that make design patterns necessary. Iterators are part of the language, a singleton is a module of functions, etc. As Thomas said, "Welcome to python and django". ---Peter --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Some questions on using Django
koranthala schrieb: > Hi all, >Please excuse me if this is a naive question. I am a developer/ > programmer who is now into web development for the first time. >I have read through Django tutorial and I have a moderate > understanding of how Django works. > >I have two major questions, which is bugging me quite a lot. I will > try to put it succinctly. > > (1) >One problem is that in my site, I am not using templates very much > - My understanding is that on using templates quite a bit only one can > unlock the full efficiency of Django. >However, when I am designing my site, I find that I am not using > templates too much. > > I don't use templates much, too. But I use auto escape in python code (some small wrapper around mark_safe() and join()) > (2) > Another question that I have is - is it usual to have no major > architecture in the web coding? i.e. When I used to do C programming, > I used to use all sort of design patterns etc. Now I am into web > programming using Django, and now I dont find the need to have a > complex architecture. Simple applications can be written in some hours if you are familiar with django. And very complex things can be done, too: Welcome to python and django Thomas -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Some questions on using Django
Hi all, Please excuse me if this is a naive question. I am a developer/ programmer who is now into web development for the first time. I have read through Django tutorial and I have a moderate understanding of how Django works. I have two major questions, which is bugging me quite a lot. I will try to put it succinctly. (1) One problem is that in my site, I am not using templates very much - My understanding is that on using templates quite a bit only one can unlock the full efficiency of Django. However, when I am designing my site, I find that I am not using templates too much. To explain more: My site is a ajax based site which uses YUI quite a bit. In almost all pages, html part is very less compared to javascript and CSS. On an average, the html portion would be around 20-25 lines while CSS is ~300 lines and javascript (not considering YUI) is ~1000 lines. Using ajax I get 20-30 bytes of data everytime the user performs some action, and is made in a viewable format using Javascript. Since the code is like this, I use templates for just displaying very small things - like name of the user etc. Other than that I am not using template functionalitiles (filters or constructs like if, for etc) at all. Could somebody let me know whether this is usual? Am I missing some basic viewpoints which is causing me to write far too much code than necessary? i.e. Am I or am I not following Django framework properly? (2) Another question that I have is - is it usual to have no major architecture in the web coding? i.e. When I used to do C programming, I used to use all sort of design patterns etc. Now I am into web programming using Django, and now I dont find the need to have a complex architecture. The functionality is complex - but I am implicitly following MVT pattern by using Django and I do not find any need for other major architectural decisions. The only decisions that we make now is how to have the DB setup - other than that we just have code in views to handle individual scenarios based on user actions. This is very different from my earlier programming experience. So, I am very much worried that I am missing something major and it is going to blow up in my face later. If someone can help me on this too, it would be very helpful. Regards Koran --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---