Re: Django vs. Liferay
Dear List, thank you Malcolm for your reply. I don't have anything really specific, but I *think* I know so much now: We have some static sites, those are already ported to the dcms (language support) pluggable, so the cms part is pretty much solved. That is true for Liferay as well, since it has a cms built in. We have to deal very much with surveys, and there is nothing out of the box for Django nor Liferay, so writing something like that is (as far as I know) easier with Django. Database models, automatic admin interface etc. But there is also the goal to have an "internal", meaning intranet, file-system, unlike a normal file-system with "just" directories, but something like a "general" and a user directory. As far as my knowledge goes (and it isn't very far), neither Liferay nor Django provide such means. On all the other points a completely agree with you, but maybe that's the reason why I have so much trouble finding a solution, because there's lacking the "specificity" for this new project. So I really have to digg into Django (*JOY*) and Liferay (*not so much joy*). I'll try to resume what I've got so far (thanks to Malcolm's answers): -neither Django nor Liferay are "better", they both focus on different things -There is a need for more specificity to be able to decide, best way is to digg into both systems end evaluating -API are possible in Django, also authentication is "simpel" to write -Any other points need further investigation and to be more specific or less "abstract" If I'm wrong on this, please correct me. Thank a lot for the support, Nicola Jordan On Sep 28, 4:15 am, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Sat, 2008-09-27 at 10:16 -0700, Nic Jordan wrote: > > Dear List, > > > I'm currently involved in a project for building en entirely new site. > > The choice of our informatics-advisor is Liferay. I now volunteered to > > try to convince him, that "Django" is the better choice. > > Unfortunately, I don't know anything about Liferay, and I'm still > > fairly new to Django as well. I know that these are two completely > > different "systems". > > Yeah, no kidding. :-) > > > > > To be a bit more specific about what is wanted (what we really need is > > another topic): > > -JSR-168 (or similar specification) and SOA; > > Oeople from the Java side of town always seem to assume that everybody > else knows what each particular JSR is (you're not the first to do > this). I got as far as getting to the Sun Java site to read JSR-168, but > the license says I can only use it for internal evaluation and since > there's a greater than zero chance I might one day want to implement > something "portlet" related in Django and it might even have a large > overlap with something Sun have previously done, I can't agree to that > license, so I can't read the document. What does the "portlet API" do? > > Similarly, SOA is an architecture style. It's not the one Django is > normally used for (since REST-style architecture is more useful for the > types of things Django was built for), but it wouldn't be impossible to > do things in that style. After all, you're still sending data to a URL > that is then processed by a view and in your (Python) view functions you > can do whatever you like, including running that data through SOAPy or > ZSI or any other library that can be used > > > -Capable to handle more than one programming language in data > > activities as well as in application activities; > > What does this mean? Can you give an example, please, since "data and > application activities" just means "code" when I use the normal meanings > of the words. Django requires writing code in Python. You could just > Django on Jython and then call to Java code (modulo running a > non-released version of Jython at the moment, but that will change early > next year). > > > -Independent of Hardware, Software, programming language, operating > > system (as much as possible) > > Django is a Python framework. Liferay doesn't meet this requires, > either, since it's totally Java based. That being said, you can run > Python on more platforms than you can run Java on, so it's more > independent of hardware and OS in that respect. > > > Has some sort of a software library which is expandable and has > > already enough basic business logics in a framework to quickly develop > > a new application on top of it; > > You can see from djangosites.org, random browsing of this mailing and a > few quick Google searches that Django is designed to build a variety of > simple and complex applications quickly. But "quickly" is a very
Django vs. Liferay
Dear List, I'm currently involved in a project for building en entirely new site. The choice of our informatics-advisor is Liferay. I now volunteered to try to convince him, that "Django" is the better choice. Unfortunately, I don't know anything about Liferay, and I'm still fairly new to Django as well. I know that these are two completely different "systems". To be a bit more specific about what is wanted (what we really need is another topic): -JSR-168 (or similar specification) and SOA; -Capable to handle more than one programming language in data activities as well as in application activities; -Independent of Hardware, Software, programming language, operating system (as much as possible) Has some sort of a software library which is expandable and has already enough basic business logics in a framework to quickly develop a new application on top of it; -Has a web services kind of API to the external components, so the independency to any environment is as low as possible; -Easy authority structures preferable via an external LDAP/X.500 system; -Editorial capabilities (separation for writing, checking, publishing and maintaining); -Capable to automatically deal with the differences between the web browsers (IE, Firefox, Safari, etc.); -Able to (automatically) synchronize (and converting) data if these data’s are used and/or distributed over more than one database; -Relatively easily to backup; -Relatively easily to maintain. I'm well aware that there are many things mixed up, not belonging to the question of "using Django or not", but I do not know how to put it simpler, because the mentioned points above are the "cracking ponts" to choose "something". Does anyone have experience which she/he is willing to share with me? If there is something other than Django that fits these "needs", I'm very open for a hint, too. Thank you in advance for taking the time to answer to my somewhat off- topic post, Nicola Jordan --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Lighttpd advice please
b3n <[EMAIL PROTECTED]> writes: > I want to also install Lighttpd on this box - to act as a static media > server. Can / should I also use Lighttpd for Django? Or should the > Python/Django-ness be Apache based, leaving Lighttpd to deal with > media files only. You can use lighttpd to server django. FastCGI seems to be the preferred solution. That's what I use. It works well. > Am I supposed to use use Lighttpd as FastCGI in my circumstances or > not? Django and lighttpd can talk fastcgi together. > I'm not too familar with linux and I coldn't get past the first step > in the Lighttpd installation docs: > > -bash: yum: command not found > > ... so I guess I don't have that yum thing. Can anyone tell me how to > install Lighttpd? Or point me to a tutorial/guide that does (aimed at > linux newbies)? It can be complicated stuff. The lighttpd home page is quite a good place to start. Best to try and find someone with some linux experience to show you the ropes. http://trac.lighttpd.net/trac/#Tutorials -- Nic Ferrier http://prooveme.com - easy, simple, certificated OpenID --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: XML output
Alex Nikolaenkov <[EMAIL PROTECTED]> writes: > Hello guys, > I like just about everything in django, but at this point of me reading django > book I can't imagine the way of xmlizing django. > > Is there a way to use XSLT templates instead of standard django > template language? I have some stuff that is being used for a big project. Works quite well... But big project is nearing completion so I don't have much time right now to upload it to snippetts. I'll _try_ and get it done this week. -- Nic Ferrier http://prooveme.com - easy, simple, certificated OpenID --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: multiple user account login
james_027 <[EMAIL PROTECTED]> writes: > How do I enable multiple user account login in one computer? I don't > know what is the disadvantage if this works this way, I just need it > for development and testing purpose. I normally provide a little hook overide wherever I need a user so that I can say, from the url: http://myapp?_username=somebodyelse of course... the trick is to remember to turn this off in production. -- Nic Ferrier http://prooveme.com - easy, simple, certificated OpenID --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: caching and "hello username" on each page
Bram - Smartelectronix <[EMAIL PROTECTED]> writes: > I would LOVE to use caching for both anonymous and logged in users, but > the problem is that every page on our site (http://www.splicemusic.com) > has the typical "hello username | log out | ..." at the top of each page. > > Now, how can I possibly cache both anonymous and logged in users easily? > I'm guessing that I would need to add @vary_on_cookie before for each > and every view? If the username is the only thing you could store the username in a cookie and have Javascript write it out. Then the page is completly cacheable. -- Nic Ferrier http://www.tapsellferrier.co.uk --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Overriding the model's save() method
Chris Hoeppner <[EMAIL PROTECTED]> writes: > If I get this right, you're saving the original file, and a separate > thumb file. While this seems interesting, it's not what I want to > implement. It's more of a bit of catching the incoming data and > transforming it before it gets saved in the model instance. I don't understand that... save the data into a file and then transform it and save it again. That's what jared's code did and what mine does. -- Nic Ferrier http://www.tapsellferrier.co.uk --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Overriding the model's save() method
Chris Hoeppner <[EMAIL PROTECTED]> writes: > Maybe something like > > def save(self): > self.imageField = pil.thumbnail(self.imageField) > > Can't really tell if I'm on the right track here. Search the list... I've got this from the list: IMAGE_SIZE = [300, 300] THUMBNAIL_SIZE = [100, 100] UPLOAD_TO="photos/%Y/%M%d" THUMBS_TO="thumbs/%Y/%M%d" class Mugshot(models.Model): """Represents a single picture of the user""" person = models.ForeignKey(Person) shot = models.ImageField(upload_to=UPLOAD_TO) thumb = models.ImageField(upload_to=THUMBS_TO, editable=False) name = models.CharField(maxlength=500, blank=True) def __str__(self): return self.name def get_url(self): try: m = re.match(settings.MEDIA_ROOT + "(.*)", self.get_shot_filename()) return n.group(1) except: return self.get_shot_filename() # Django thumbs hack from super jared. # http://superjared.com/entry/django-quick-tips-2-image-thumbnails/ def save(self): logger = logging.getLogger("Mugshot.save") from PIL import Image if not self.thumb: self.save_thumb_file(self.get_shot_filename(), '') image = Image.open(self.get_shot_filename()) # Convert to RGB if necessary # Thanks to Limodou on DjangoSnippets.org # http://www.djangosnippets.org/snippets/20/ if image.mode not in ('L', 'RGB'): image = image.convert('RGB') cropped = utils.image_crop(image, IMAGE_SIZE) cropped.thumbnail(THUMBNAIL_SIZE, Image.ANTIALIAS) cropped.save(self.get_thumb_filename()) # Save this photo instance super(Mugshot, self).save() # Now resize the main image image = Image.open(self.get_shot_filename()) if image.mode not in ('L', 'RGB'): image = image.convert('RGB') cropped = utils.image_crop(image, IMAGE_SIZE) cropped.thumbnail(IMAGE_SIZE, Image.ANTIALIAS) cropped.save(self.get_shot_filename()) class Admin: pass -- Nic Ferrier http://www.tapsellferrier.co.uk --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: REST authentication with apache
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > Hi, > I'm trying to implement a REST service with django and I have a > problem in authentication. > My current approach is with .htaccess with apache password(Basic > Authentication), simple and straight. > But I want to validate users in django, with roles etc. > I've tryed: > > > AuthType basic > AuthName "example.com" > Require valid-user > > > but the 'AUTH_TYPE' in request.META is None, so I can't get the user > and password from user. Can't you just read the base64 data from the auth header and decode it? -- Nic Ferrier http://www.tapsellferrier.co.uk --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: File upload using Flash
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > Hi all, > > some time ago, probably on this list, someone posted a link to a > component in Flash with which you could do file upload from Django. > The component featured a progress bar. > > Does anybody have a link to it? Not to hand... but it's a mootools extension. That should help you find it. -- Nic Ferrier http://www.tapsellferrier.co.uk --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Django advocacy in a commercial environment
Rob Hudson <[EMAIL PROTECTED]> writes: > Python and Django wouldn't be my concern when hiring new employees > since they are easy to learn. It's all the other stuff that comes > with web development that together is harder to find (eg: valid > (x)HTML, CSS, Javascript, database, source control, unix/linux, HTTP, > etc.) I agree with this. I'd be happy to teach anyone django and python. But finding people who know about CSS differences between browsers - now that is hard. -- Nic Ferrier http://www.tapsellferrier.co.uk --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: html sanitizers
Brett Parker <[EMAIL PROTECTED]> writes: > On Fri, Jul 13, 2007 at 11:18:18AM +0100, Nic James Ferrier wrote: >> >> Derek Anderson <[EMAIL PROTECTED]> writes: >> >> > hey all, >> > >> > could anyone point me to a python html sanitizer implementation (or >> > example)? i don't mean to strip all html, just tags and attributes not >> > on a whitelist, such as I/B/A href/U/etc. >> >> I use libxml2/libxslt, something like: >> >> doc = libxml2.htmlParseDoc(whatever, "utf8") >> result = libxslt.applyStylesheetFile(doc, "strip.xslt", {}) >> >> There are loads of ways of stripping in xslt depending on what you >> want to do. > > Only works on well formed XHTML documents though... which although they > should be the norm, really aren't! No. In my example I deliberately used libxml2' HTML parser which is an HTML parser not an XHTML parser. It copes with non-well formed documents as well as all the usual entity problems. -- Nic Ferrier http://www.tapsellferrier.co.uk --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: html sanitizers
Derek Anderson <[EMAIL PROTECTED]> writes: > hey all, > > could anyone point me to a python html sanitizer implementation (or > example)? i don't mean to strip all html, just tags and attributes not > on a whitelist, such as I/B/A href/U/etc. I use libxml2/libxslt, something like: doc = libxml2.htmlParseDoc(whatever, "utf8") result = libxslt.applyStylesheetFile(doc, "strip.xslt", {}) There are loads of ways of stripping in xslt depending on what you want to do. -- Nic Ferrier http://www.tapsellferrier.co.uk --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Is django a good solution for non-CMS web-apps?
walterbyrd <[EMAIL PROTECTED]> writes: > I have been reading that django is good for CMS type sites, but not > especially good for other types of web applications. For example: > financial applications. I have read that TurboGears is better for > those other apps. That seems like nonsense. I am building 3 apps on django. None of them is a CMS. I hate frameworks. But as frameworks go, django is a good one. -- Nic Ferrier http://www.tapsellferrier.co.uk --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: lighttpd & fcgi
Nic James Ferrier <[EMAIL PROTECTED]> writes: > "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > >> Yah, weird. >> >> Is there any advantage of using a socket or tcp? > > A unix socket might be _marginally_ faster. > > But TCP avoids ownership issues of sockets which are a pain in the > butt. I just found out that this: check-local => "disabled" needs to be in the lighttpd conf even if you're using TCP. eg: fastcgi.server = ( "/somut.fcgi" => ( "main" => ( "host" => "127.0.0.1", "port" => , "check-local" => "disable" ) ) ) -- Nic Ferrier http://www.tapsellferrier.co.uk --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: lighttpd & fcgi
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > Yah, weird. > > Is there any advantage of using a socket or tcp? A unix socket might be _marginally_ faster. But TCP avoids ownership issues of sockets which are a pain in the butt. -- Nic Ferrier http://www.tapsellferrier.co.uk --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: lighttpd & fcgi
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > I've been reading this to get lightTPD and fastcgi configured on my > machine: > http://www.djangoproject.com/documentation/fastcgi/ > > There, it says to add this to your lighttpd.conf: > > server.document-root = "/home/user/public_html" > fastcgi.server = ( > "/mysite.fcgi" => ( > "main" => ( > # Use host / port instead of socket for TCP fastcgi > # "host" => "127.0.0.1", > # "port" => 3033, > "socket" => "/home/user/mysite.sock", > "check-local" => "disable", > ) > ), > ) > > > I have run this call to start fastcgi > python manage.py runfcgi method=threaded protocol=fastcgi > host=127.0.0.1 port=3033 > > Here is my question: > The mysite.fcgi file doesn't matter, right? It doesn't have to exist > as lightTPD knows about the fastcgi through the host and port > settings, right? I just found that it does. lighttpd does a stat on that file before serving the request and if it's not there lighttpd just returns 404. Put the file there and it'll send the request. NOTE: this ONLY happens when you're doing tcp based fcgi. When you're doing unix socket stuff it just works and the dummy file doesn't need to be present. Wierd, eh? -- Nic Ferrier http://www.tapsellferrier.co.uk --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: The going rate for Django-based web developers ...
ZebZiggle <[EMAIL PROTECTED]> writes: > Strong python, javascript, CSS, postgres, jquery (or alike), debugging > and lots of general experience in software development. And when I say > CSS, I don't mean graphic design skills, but knowing how to take a > graphic design and translate it into CSS. Someone that can take a > concept and turn it into reality. It's that CSS bit that I find difficult to find. I have a good grasp of CSS... but I still can't do that very well (takes me ages). The people who can are worth a good amount of money (+$50 an hour). -- Nic Ferrier http://www.tapsellferrier.co.uk --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
a diff for the fastcgi server to make umask settable
flup provides the umask init field so that you can change the mask of a unix socket you're using to talk fast cgi. Django doesn't seem to pass this through so I wrote this trival patch. Someone might be interested. Apologies if this is not the right place. -- Nic Ferrier http://www.tapsellferrier.co.uk --- /usr/share/python-support/python-django/django/core/servers/fastcgi.py~ +++ /usr/share/python-support/python-django/django/core/servers/fastcgi.py @@ -39,6 +39,7 @@ daemonize=BOOL whether to detach from terminal. pidfile=FILE write the spawned process-id to this file. workdir=DIRECTORYchange to this directory when daemonizing + umask=NUMBER set the umask used to create the socket Examples: Run a "standard" fastcgi process on a file-descriptor @@ -69,8 +70,13 @@ 'minspare': 2, 'maxchildren': 50, 'maxrequests': 0, +'umask': None, } +# 'mode' added by nic on Thu Jun 7 13:25:07 BST 2007; +# to communicate a mode for a unix socket to the flup fcgi backend + + def fastcgi_help(message=None): print FASTCGI_HELP if message: @@ -127,6 +133,11 @@ wsgi_opts['bindAddress'] = (options["host"], int(options["port"])) elif options["socket"] and not options["host"] and not options["port"]: wsgi_opts['bindAddress'] = options["socket"] +if "umask" in options: +try: +wsgi_opts["umask"] = int(options["umask"]) +except ValueError: +return fastcgi_help("If specified, umask should be an integer.") elif not options["socket"] and not options["host"] and not options["port"]: wsgi_opts['bindAddress'] = None else: --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Looking for Django Developers As Founders
Tim Chase <[EMAIL PROTECTED]> writes: >>> Sorry, my email is >> >> Ermmm It tells us that in the mail header. > > But it doesn't tell us where this is geographically in the > header, the body, or in the follow-up email :) It's in cyberspace, man. -- Nic Ferrier http://www.tapsellferrier.co.uk --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Looking for Django Developers As Founders
Michael Lim <[EMAIL PROTECTED]> writes: > Not in Google Groups. The email is masked off as shown in the reply > thread shown below :-) Bizarre! -- Nic Ferrier http://www.tapsellferrier.co.uk --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Looking for Django Developers As Founders
Michael Lim <[EMAIL PROTECTED]> writes: > Hi all, > > Sorry, my email is > > lim ck michael gmail com Ermmm It tells us that in the mail header. -- Nic Ferrier http://www.tapsellferrier.co.uk --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Very large scale sites in Django
Daniel Ellison <[EMAIL PROTECTED]> writes: > On Thursday 31 May 2007 11:26:37 Nic James Ferrier wrote: >> Daniel Ellison <[EMAIL PROTECTED]> writes: >> > Sounds like this might end up being the highest-traffic Django site there >> > is! :) >> >> Errr... I might be in competition with you there. >> >> /8-> > > Fine. Sounds like this might end up being the second highest-traffic Django > site there is! :) > > What site do you run that gets > 400 hits per second, sustained? You could > definitely provide some sage advice! I might be in competition with you to end up being the highest-traffic django site there is. As to scaling advice... I've gone for the REST/quite-a-few-machines/partitioned-resource-space approach. This should mean that the machines we use are smaller than than normal (maybe even VMs) and so we can have more of them. We have yet to do scaling tests though. So I could still end up with egg on my face (mmm! egg!) -- Nic Ferrier http://www.tapsellferrier.co.uk --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Very large scale sites in Django
Daniel Ellison <[EMAIL PROTECTED]> writes: > Sounds like this might end up being the highest-traffic Django site there > is! :) Errr... I might be in competition with you there. /8-> -- Nic Ferrier http://www.tapsellferrier.co.uk --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Moving Images to Amazon S3
"=?ISO-8859-1?Q?Fr=E9d=E9ric_Sidler?=" <[EMAIL PROTECTED]> writes: > openfount provide something that does the trick > http://www.openfount.com/blog/s3dfs-for-ec2 > > and adrian holovaty did something like that some weeks ago for > chicagocrime.org > http://www.holovaty.com/blog/archive/2006/04/07/0927 Yes. Implementing S3 at this level actually is not terribly hard... it works quite well. And there are good Python bindings for FUSE. -- Nic Ferrier http://www.tapsellferrier.co.uk --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Moving Images to Amazon S3
Kyle Fox <[EMAIL PROTECTED]> writes: > The S3 API requires the file data to be in the format the > open(myfile).read() returns (whatever that is). > > Is there a way to get the same data from an in-memory Image instance, > so I don't need to save/re-read/delete each thumbnail file? Surely the better way to do this is to just use FUSE or something to map S3 into the filesystem? -- Nic Ferrier http://www.tapsellferrier.co.uk --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Django users in London want to meet up for beers?
To talk django and python? Anyone? -- Nic Ferrier http://www.tapsellferrier.co.uk --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: adding XSLT templating to Django
Eugene Morozov <[EMAIL PROTECTED]> writes: >> - there is proper separation between data and style, my JSON doesn't >> include any stylistic information, only stuff that describes the data > > I still think that your example is not the best. "div" and "span" has > no semantic meaning, they're just HTML placeholders. Well, ok. The reason for them is that you need them for structure. It doesn't make sense to use another tag for some arbitary POSH. >> - you get to use XSLT to turn the JSON into anything you want... you >> need Atom from a resource as well as HTML? Just have 2 different >> stylesheets but the same JSON. > > I think it is possible with plain Django templates, too. Just define 2 > different templates. But then you're doing the python logic bits (for example, serializing a seqence) more than once. With mine you only do the programming-y bits once and then use XSLT to transform to whatever. The templates are very simple then. I've used this approach in a couple of frameworks. > Your small framework could be really useful in some situations, I was > just thinking about how to apply my XSLT knowledge to ease web > development tasks. But I think that need better examples really > showing benefits of XSLT approach. I was turned off by those HTML > elements in JSON data immediately. Maybe this is just my personal > opinion. Maybe... I'm not sure what upsets you about them really. The exact language you use is up to you... you can put whatever you like in and it'll get turned into XML. For example, this would output something like ATOM: tfxslt.send_json(HttpResponse(), {"feed": [{"author": {"email": "[EMAIL PROTECTED]"}}, {"published": "Sat May 12 22:57:26 BST 2007" }, [{"item": {"summary": "a bit about this item"}}]]}, "atom") And of course... if you've got anything that can serialize any other data structure to JSON then you can use that as well. I'm really busy actually using my stuff at the mo... I'm hoping to try and post it over this weekend on snippets. -- Nic Ferrier http://www.tapsellferrier.co.uk --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: adding XSLT templating to Django
Eugene Morozov <[EMAIL PROTECTED]> writes: > On 11 май, 13:23, Nic James Ferrier <[EMAIL PROTECTED]> > wrote: >> def user_alerts(request, user_name): >> me = get_object_or_404(User, username=user_name) >> alerts = Alert.objects.filter(user=me, seen=False) >> return tfxslt.send_json(HttpResponse(), >> { "div": >> [ { "abbr": >> { "@title": alert.created, >> "span": alert.message }} for alert in >> alerts]}, >> xslt="user_alerts") >> > > Sorry, I don't get the point. I think that XSLT is a way to separate > presentation from data. But your json looks like some kind of HTML. I > don't understand how this is better than existing Django templates. It has several advantages: - there is proper separation between data and style, my JSON doesn't include any stylistic information, only stuff that describes the data - the JSON template *is* python, you can pretty much do anything with it: you can separate bits of the rendering with different methods, you can test it outside of Django, you can pass it around and process it with Python quite naturally. - you get JSON output if you want it, direct from your view - you get to use XSLT to turn the JSON into anything you want... you need Atom from a resource as well as HTML? Just have 2 different stylesheets but the same JSON. The way I tend to use the templates is to output POSH (Plain Old Semantic HTML) like JSON which will be transformed by XSLT into display HTML/XHTML but you don't have to do it that way... the JSON could be any old thing. I find it simpler to use POSH because I can mock up the POSH outside of a programming language. I can even get designers to template the POSH which they will then transform with XSLT. > I know and use XSLT but usually for converting between different XML > formats. XSLT works very well as a dynamic transformation language. It is very fast indeed and you can do so much with it. I don't understand why anyone would want to use these hobbled little template languages inside things like Django and Rails. -- Nic Ferrier http://www.tapsellferrier.co.uk --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: First impression of django
"James Bennett" <[EMAIL PROTECTED]> writes: > On 5/11/07, Nic James Ferrier <[EMAIL PROTECTED]> wrote: >> Something needs to be done though... or ongoing maintenance of Django >> apps is going to be really hard. > > I haven't found it terribly hard with a little coding discipline; the > way we've handled it is to write the necessary SQL and commit it to > our repository along with model changes, so we have a history of how > the model has evolved over time. Some way of specifying "revision > numbers" of models and having Django find the necessary SQL files to > execute (where those files were manually constructed) is really all > the automation I'd like to see :) That works. Good plan. But it's getting away from the ORM principle isn't it? I don't mind that personally... I think that ORMs are over-rated (hence my "I hate frameworks") but they sure do help with things like form validation and such (because the necessary authoritative meta data is in python rather than SQL). -- Nic Ferrier http://www.tapsellferrier.co.uk --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
adding XSLT templating to Django
I've been using Django for a few weeks now and I have to say, despite my general hatred of frameworks, I'm quite impressed with it. It is very fast to get up and going, the ORM works pretty well. New forms are really, really good. I don't like learning new template languages though... so I plugged in XSLT (which I know really well) and I thought people might be interested in how I did that. So I thought I'd tell you here. I've got a little but of python that renders JSON type structures to simple XML. So what I do is have a function that I pass an HttpResponse and some JSON and an XSLT filename and it: - turns the JSON into XML - loads the stylesheet from the XSLT filename - pushes the XML through the XSLT - collects the transformation and sends it to the HttpResponse The description is all a bit academic. Here's an example from a real app's views.py: def user_ratings(request, user_name): user = get_object_or_404(User, username=user_name) return send_json(HttpResponse, { "abbr": { "@title": user_name, "div": { "@class": "ratings", "div": [ { "div": { "@class": "looks", "span": user.looks }}, { "div": { "@class": "looks", "span": user.looks }} ]}}}, xslt="user_ratings") Here's another real example from the same app, with a generator: def user_alerts(request, user_name): me = get_object_or_404(User, username=user_name) alerts = Alert.objects.filter(user=me, seen=False) return tfxslt.send_json(HttpResponse(), { "div": [ { "abbr": { "@title": alert.created, "span": alert.message }} for alert in alerts]}, xslt="user_alerts") I think this works quite well; - the programmatic template is actually python, albeit a specialized JSON syntax of python - it's pretty clear what the template is going to result in, as XML - it makes the XSLT pretty simple I've used it on 3 very different projects now and it's been fine on each one. If there's any interest in this I'd consider trying to make my stuff Django-fied enough to fit in sorta properly... maybe if you return a special JSON/XSLT object to an HttpResponse or something. If anyone wants the xslt/json module I'll post it somewhere. On another note is anyone interested in a London meet up? I'd love to have a beer with a few other Django developers and chew the cud. -- Nic Ferrier http://www.tapsellferrier.co.uk --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: How well should I know Python before using Django?
"Greg Donald" <[EMAIL PROTECTED]> writes: >> 1) beginner >> 2) intermediate >> 3) expert > > 0) None > > But what about experience in other programming languages? If you > currently know zero programming languages, learning any new > programming language or framework will require some significant > effort. IMO Python is an excellent first language. I'd go along with that... actually when you're writing a Django app you don't need to know much of anything except Django. It's pretty declarative. -- Nic Ferrier http://www.tapsellferrier.co.uk --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---