Re: Templates, filesystem, caching?

2007-12-22 Thread Rob Hudson
On 12/21/07, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > In the early days of Django, Adrian, Simon et al looked at that. It > wasn't worth it, since, in the grand scheme of things, template caching > and checking the cache wasn't that much faster than loading and parsing, > particularly in th

Re: Django for a seminar registration app?

2007-12-22 Thread Kenneth Gonsalves
On 23-Dec-07, at 10:42 AM, Nicolai Richter (Gm) wrote: > Do you think Django could handle the task easily or do you think > something else would be better? What do you think will be the hardest > part to implement? And how many hours/days/weeks would you think it > takes a new user like me to ge

Django for a seminar registration app?

2007-12-22 Thread Nicolai Richter (Gm)
Dear Django experts, I am a python programmer with about 1.5 years part-time python experience and some web site building experience. I am about to take a project of building a seminar registration site for a client. I have already decided I want to handle that project in python, but I have a ha

Re: Django documentation in chm (Dec 22, 2007)

2007-12-22 Thread [EMAIL PROTECTED]
Thanks for your done. But I can't get the django-documetn-chm for your given url. Can you send a copy to my email [EMAIL PROTECTED] please? Thank you very much, Merry Christmas to you... ^_^ On 12月22日, 下午9时36分, char101 <[EMAIL PROTECTED]> wrote: > Hi, > > I have created a chm format of the

Re: App for rendering and far future caching of css and js files

2007-12-22 Thread Itai Tavor
On 11/11/2007, at 8:27 PM, Itai Tavor wrote: > Hi all, > > I made one of them apps, like the subject says... > > From the README (which is as well as I can explain it, if I could > say it better I'd edit the README, right?): > > The app provides two main functions: > > 1. Render and serve css fil

Re: How to initialize M2M field in new ModelForm?

2007-12-22 Thread Joseph Kocherhans
On 12/22/07, Yatla <[EMAIL PROTECTED]> wrote: > > I need to initialize a selection in a M2M field of the Document > ModelForm during the first GET of a form that creates a new Document - > classes and view as follows: > > class DocumentForm(forms.ModelForm): > class Meta: > model = Doc

Re: Static files in development environment

2007-12-22 Thread pinco
Michael, You are right: the Django admin was stepping on my media directory. I changed the name of "media" directory to "my_media" and now everything works fine. Thank you very much for your help. By the way, thank you also for your blog, which is an invaluable source of learning for every dja

Re: Static files in development environment

2007-12-22 Thread Empty
> I'm having some problems to serve static files in the development > environment. > First, have you read this: http://www.djangoproject.com/documentation/static_files/ > The directory that actually contains the static files under OSX is: > > /Users/paolo/Sites/SF06/sensationalfly/media/ > > > I

Re: Extending pythonpath within python code

2007-12-22 Thread pk
os.path.normpath('e:/a/b/c') will give 'e:\\a\\b\\c' On Dec 22, 6:50 am, Julien <[EMAIL PROTECTED]> wrote: > Thanks for the tip! > > However, it's a bit strange because it only accepts paths with double > back slashes, instead of the forward slashes required for declaring > the template path for

How to initialize M2M field in new ModelForm?

2007-12-22 Thread Yatla
I need to initialize a selection in a M2M field of the Document ModelForm during the first GET of a form that creates a new Document - classes and view as follows: class DocumentForm(forms.ModelForm): class Meta: model = Document class Document(models.Model): ... categori

Static files in development environment

2007-12-22 Thread pinco
Hi, I'm having some problems to serve static files in the development environment. The directory that actually contains the static files under OSX is: /Users/paolo/Sites/SF06/sensationalfly/media/ I modified the settings.py MEDIA_ROOT parameter to: MEDIA_ROOT = '/Users/paolo/Sites/SF06/sensa

Re: Django documentation in chm (Dec 22, 2007)

2007-12-22 Thread pk
Thanks very much for doing this. While reading on djangoproject is nice, sometimes it is faster/better to have a local version -- When I am coding on a plane, for example ! P.K. On Dec 22, 8:36 am, char101 <[EMAIL PROTECTED]> wrote: > Hi, > > I have created a chm format of the django docs taken

Re: How to make fields with editable=False visible in the Admin interface

2007-12-22 Thread Empty
> Well, not universally true. There are a lot of cases where this would, > in fact, be useful information (e.g. last HTTP return code and message > when editing an RSS feed entry for a planet syndication application, or > the mail refusal code for a person's entry in newsletter software so you > c

Re: Tutorial 2 admin Template not found

2007-12-22 Thread Empty
> > So I've discovered that I can get the admin page to show up if I add '/ > System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/ > site-packages/django/contrib/admin/templates' to TEMPLATE_DIRS in the > settings.py file for my project (for some reason this doesn't work in > glo

Re: KeyError in admin

2007-12-22 Thread Christian Schmidt
OK, i founf out, that I get these Error with every model where I have a ManyToMany Field inside. I have some other applications running on the server and there I have the same problems in models with manytomany fields. Is this a problem with python2.4? christian. --~--~-~--~~

Django documentation in chm (Dec 22, 2007)

2007-12-22 Thread char101
Hi, I have created a chm format of the django docs taken from svn at Dec 22, 2007. Link: http://charupload.wordpress.com/2007/12/02/django-documentation-chm/ Note: don't right click and save as on the links because it's a link to a page on divshare, not a direct link to the file. Cheers, Charl

KeyError in admin

2007-12-22 Thread Christian Schmidt
Hi, I've a problem with the Django admininterface on my productive server. If I want add an object with the admininterface I get following error message: KeyError at /admin/catalog/artikel/add/ Request Method: GET Request URL:--MYSERVER--/admin/catalog/artikel/add/ Exception Type:

How to pass extra attributes to User authentication view?

2007-12-22 Thread shabda
To allow users to log-in, I have something like this in urls.py (r'^accounts/login/$', 'django.contrib.auth.views.login', {'template_name': 'myapp/login.html'}), But myapp/login.html expects a number of extra objects from that populated by the login view. In other generic views, I could have add

Re: Extending pythonpath within python code

2007-12-22 Thread Julien
Thanks for the tip! However, it's a bit strange because it only accepts paths with double back slashes, instead of the forward slashes required for declaring the template path for example. import sys sys.path.append('E:\\workspace\\myproject\\trunk\\apps') works but: import sys sys.path.app

Re: Upstream caching and django

2007-12-22 Thread Winsley von Spee
On Fri, 21 Dec 2007 16:30:52 -0800 (PST) JustJohnny <[EMAIL PROTECTED]> wrote: > > Any community recommendations on types of upstream caching for django/ > dynamic sites? (besides the standard "the docs say") > > Any pros/cons on a squid (http://www.squid-cache.org/) vs varnish > (http://va

Re: ModelForm with Image/FileField not working

2007-12-22 Thread Kenneth Gonsalves
On 22-Dec-07, at 3:38 PM, Malcolm Tredinnick wrote: > Here's the problem.. I should have spotted it the first time. You > need > to pass in any files as the second argument to the form. > > newpage = Ph(request.POST, request.FILES) > > So the form is complaining about something valid:

Re: Getting Error - "Error while importing URLconf 'blogango.urls': list index out of range"

2007-12-22 Thread Malcolm Tredinnick
On Sat, 2007-12-22 at 00:53 -0800, shabda wrote: > Ok I found the error, but I still cant understand why this is > happening. What I did was that, in the blogango.urls, I have a line > like > > import feeds > > THe feeds.py is, > > class main_feed (Feed): > blog = Blog.objects.all()[0] Th

Re: ModelForm with Image/FileField not working

2007-12-22 Thread Malcolm Tredinnick
On Sat, 2007-12-22 at 15:33 +0530, Kenneth Gonsalves wrote: > > On 22-Dec-07, at 1:16 PM, Malcolm Tredinnick wrote: [...] > > You should always be checking is_valid() before trying to save to > > avoid > > this type of problem. Since, newpage.is_valid() will be false here, > > you > > can pr

Re: ModelForm with Image/FileField not working

2007-12-22 Thread Kenneth Gonsalves
On 22-Dec-07, at 1:16 PM, Malcolm Tredinnick wrote: > On Sat, 2007-12-22 at 13:00 +0530, Kenneth Gonsalves wrote: >> hi, >> am using the latest svn head, and trying to get ModelForm working >> with Image/FileField. The model is here: >> >> class Photo(models.Model): >> """Photo plus blurb -

Re: Tutorial 2 admin Template not found

2007-12-22 Thread Jeff Anderson
I have no problems going through the tutorial (and creating my own apps) on my mac. Are you using the development server to do all of this? I could see where you'd have the problems you are having if you are trying this all through apache/mod_python. How did you install django? from source? I don't

Re: Tutorial 2 admin Template not found

2007-12-22 Thread kadavy
So I've discovered that I can get the admin page to show up if I add '/ System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/ site-packages/django/contrib/admin/templates' to TEMPLATE_DIRS in the settings.py file for my project (for some reason this doesn't work in global_settings

Re: Extending pythonpath within python code

2007-12-22 Thread Matthias Kestenholz
On Sat, 2007-12-22 at 00:58 -0800, Julien wrote: > Hi there, > > To keep my projects tidy, I'm used to having all my apps in a > subfolder "apps". > This means that I need to add that subfolder to the pythonpath. I can > do this in apache or by doing runserver --pythonpath=apps. > > However, I'd

Extending pythonpath within python code

2007-12-22 Thread Julien
Hi there, To keep my projects tidy, I'm used to having all my apps in a subfolder "apps". This means that I need to add that subfolder to the pythonpath. I can do this in apache or by doing runserver --pythonpath=apps. However, I'd like to extend the pythonpath within the code, for example in se

Re: Getting Error - "Error while importing URLconf 'blogango.urls': list index out of range"

2007-12-22 Thread shabda
Ok I found the error, but I still cant understand why this is happening. What I did was that, in the blogango.urls, I have a line like import feeds THe feeds.py is, class main_feed (Feed): blog = Blog.objects.all()[0] title = blog.title link = "/rss/latest/" description = blog.t

Getting Error - "Error while importing URLconf 'blogango.urls': list index out of range"

2007-12-22 Thread shabda
Getting this error, "Error while importing URLconf 'blogango.urls': list index out of range". The exception stack does not give any cles to what might be wrong. The exception stack is, Traceback: File "C:\Python24\lib\site-packages\django\core\handlers\base.py" in get_response 73. ca

Re: "url" template function problem

2007-12-22 Thread Christos Τrochalakis
On 12/22/07, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > > On Wed, 2007-12-19 at 08:15 -0800, Trochalakis Christos wrote: > > Hello there, > > > > I'm trying to use the "url" template function but i cant make it work. > > > > My attempt: > > > > urls.py: > > > > urlpatterns = patterns('', > >