On Tue, 2009-04-07 at 06:46 -0700, zayatzz wrote: > Hello > > Im mainly thinking bit ahead here, while im still in the beginning of > writing my first real project/application with django. > If someone could answer all or some of those questions and perhaps > provide examples, then i would greatly appreciate your help and buy > you a beer, whenever you end up near where i live :). > > 1) Cookies. I read from older posts that there is some kind of django > authentication library/module for holding that kind of information. In > any case, lets say that i dig deep enough into that module and figure > out how to do all that while session is active, but how do i read that > information from browser cookie next time the user comes to this site?
You're looking at too low a level. The basic session management application that comes with Django (django.contrib.sessions) provides the layer between the browser cookie identifier and information you've stored in the session. Note that the data is stored server-side, not in the cookie itself: the cookie provides only the session identifier to retrieve the session information from the session storage. There are other ways to do session (you're not required to use Django's session application, after all), but for many purposes, the Django default app is sufficient and make life very easy. > > 2.1) Since im thinking about creating site with some sort of cms i > want to know what kind of field types should i usefor lengthy texts > like news or basic content articles? Worth reading the documentation on the basic model field types for information like this. The TextField pretty much screams out for use here. > 2.2) Is there a point building full scale cms with django or should > that be done with just python? Will django actually hinder such > projects? You can use Django for this. In fact, the original usage of Django is for the commercial product (still being used by a lot of companies) called Ellington, which is a CMS. > > 3) Are there any examples of pages which get their content from > several views/modules? The question doesn't make sense from the terminology you're using. A "view" function is just a function that is used as the entry point for processing a particular request. After identifying the URL requested, processing has to go somewhere and that somewhere is called a view function. The view can happily call other functions to collect the data it leaves. When the initial view function returns, that returned data is what is sent back to the client. > Or what is the general practice with pages that > load information from different places to one page? Collect the information however you like and pull it all together before rendering it via a template (or some other way to final content that goes into an HttpResponse object). > You create view > that imports information from several modules and shows it as single > page or is there some way to just reload certain area of a webpage > when visitor clicks a button/link or fills a form. Ajax is supported, since that is just another HTTP call. There's also support for detecting if a call is an Ajax-style call or not (there's an is_ajax() method on the HttpRequest object. > > 4) Are there any good examples about how to use javascript/ajax with > django? Yes. Google is your friend here. > > 5) How can i manage images with django. Are there stuff like gdlib/ > imagemagic for django? You can certainly use either of those if you like. The standard Python imaging library is called the Python Imaging Library (PIL) and Django uses that for things like determining the size of an uploaded image. Again, a quick read of the model documentation would probably give you some immediate benefits here. That sort of thing is mentioned when the ImageField is described. There is a *lot* of documentation for Django, the majority of it pitched at a level that somebody learning the framework can pick things up when they're paying attention. Lots of code fragments and more complete examples. Well worth taking a few evenings to read through what's there. Regards, Malcolm --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to [email protected] 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 -~----------~----~----~----~------~----~------~--~---

