Re: weird osx problem (templates path)

2008-09-09 Thread Anakin

@yousef,

i did it 3-4 times, invidually (and all). but nothing changed.
and im working on true settings file. im going to be mad cause this
error :)

On 10 Eylül, 01:08, "Yousef Ourabi" <[EMAIL PROTECTED]> wrote:
> What is interesting is that in the stack trace it doesn't show
> $HOME/Documents/django/bjango/templates on the template_path, which is sort
> of suspicious.
>
> Try commenting out every template loader except:
> filesystem.load_template_source
>
> On Tue, Sep 9, 2008 at 1:38 PM, Anakin <[EMAIL PROTECTED]> wrote:
>
> > hey again.
>
> > @Yousef : this my views.py
>
> > ---
>
> > from bjango.weblog.models import Tags,Categories,Articles
> > from django.shortcuts import render_to_response
> > from django.http import HttpResponse
>
> > def index(request):
> >        return render_to_response('base.html', {"foo": "bar"})
>
> > ---
>
> > @Adi
>
> > yes there is a base.html in templates directory.
>
> > thanx for replys.
>
> > On Sep 9, 11:08 pm, "Yousef Ourabi" <[EMAIL PROTECTED]> wrote:
> > > Could you post a snippet of the view that is loading/rendering the
> > template?
>
> > > On Tue, Sep 9, 2008 at 1:07 PM, Adi J. Sieker <[EMAIL PROTECTED]> wrote:
>
> > > > Hi,
>
> > > > On Tue, 09 Sep 2008 21:56:24 +0200, Anakin <[EMAIL PROTECTED]>
> > wrote:
>
> > > > > im using 10.5.2 osx Leopard. and im working with django 1.0 final
> > > > > release.
>
> > > > > i have some screenshots about this error, settings - traceback and if
> > > > > you need terminal log. you can see in this url.
> > > > >http://www.deneloper.com/django-error/index.html
>
> > > > > please tell me, what is the problem :(
>
> > > > what's the content of the directory
> > > > /Users/onurozkan/Documents/django/bjango/templates?
> > > > Is there a base.html in that directory?
>
> > > > adi
--~--~-~--~~~---~--~~
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: weird osx problem (templates path)

2008-09-09 Thread Anakin

i cant see traceback now, i will add 7-8 hours later (im at work,)
but im suspecting another thing.

i took settings.py another django project (but db,templates dir,
installed apps are changed).
is problem can be secret_key ?

On 10 Eylül, 02:30, Daniel Roseman <[EMAIL PROTECTED]>
wrote:
> On Sep 9, 8:56 pm, Anakin <[EMAIL PROTECTED]> wrote:
>
> > im using 10.5.2 osx Leopard. and im working with django 1.0 final
> > release.
>
> > i have some screenshots about this error, settings - traceback and if
> > you need terminal log. you can see in this 
> > url.http://www.deneloper.com/django-error/index.html
>
> > please tell me, what is the problem :(
>
> > thanx for support.
>
> I wonder if it's actually using the settings file you think it is.
> What does it say in the Settings section of the traceback, further
> down the screen?
> --
> DR.
--~--~-~--~~~---~--~~
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: weird osx problem (templates path)

2008-09-09 Thread Daniel Roseman

On Sep 9, 8:56 pm, Anakin <[EMAIL PROTECTED]> wrote:
> im using 10.5.2 osx Leopard. and im working with django 1.0 final
> release.
>
> i have some screenshots about this error, settings - traceback and if
> you need terminal log. you can see in this 
> url.http://www.deneloper.com/django-error/index.html
>
> please tell me, what is the problem :(
>
> thanx for support.

I wonder if it's actually using the settings file you think it is.
What does it say in the Settings section of the traceback, further
down the screen?
--
DR.
--~--~-~--~~~---~--~~
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: Pyjamas-Desktop and Pyjamas

2008-09-09 Thread bedros

thanks, this looks very promising, I'll try it out

On Sep 6, 1:51 pm, lkcl <[EMAIL PROTECTED]> wrote:
> > words, the code that _was_ handed to the pyjamas compiler is instead
> > handed to the python compiler.
>
>  correction: python _interpreter_ :)  pyjamas-desktop ends up doing
> "import pywebkitgtk", which pulls in webkit, which, given that it's a
> Browser Engine, ends up with *identically* displayed content on the
> desktop as you get through the equivalent AJAX.
>
>  a bit faster, as well, because webkit is _blindingly_ quick.
--~--~-~--~~~---~--~~
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: Admin 500 Error

2008-09-09 Thread Bret W



On Sep 8, 9:43 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote:

> I am aware of one problem reported with the admin home page and debug set to
> False.  It is:
>
> http://code.djangoproject.com/ticket/8110

That was it. Thanks!
--~--~-~--~~~---~--~~
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: What do you use as a build tool (like Ant or make)

2008-09-09 Thread Kevin Teague

There is a list of all Python-based build tools on the python.org
wiki:

http://wiki.python.org/moin/ConfigurationAndBuildTools

I haven't used any of them with Django, but for managing Zope, Plone
and Grok based web apps, zc.buildout is the current preferred tool.
It's a configuration-based build tool (that is it decides to re-build
parts based on changes in the build config files), so it won't handle
the problem of source code recompilation very well, but then if your
project is pure Python, source code recompilation is not a problem :)

zc.buildout shines in two aspects:

 * Managing Python library dependencies

Zope 2 (and Zope 3) used to be distributed from a single source tree.
This was a problem, because it made it hard to share packages between
the various Zope-based projects, and other Python web apps. Zope 3 was
divided into some 80+ packages, new releases of Zope 3 are now just a
list of these packages at specific versions. Very nice when upgrading
the framework because you diff between two releases of the framework
and see which packages have changed - and you can also override this
list if you want to pin a packages version at something older or newer
than what's been included in a given release. This also makes it
really great at managing 3rd party libraries such as SQLAlchemy, etc.

 * Sharing recipes between builds

zc.buildout recipes can be Python code that is part of your own
project, or a recipe can be published on PyPI. This way if someone
else is maintaining a recipe to build a part that you'd like to
include in your project, you can easily re-use their recipe (without
using cut-n-paste re-use). Buildout recipes on PyPI are here:

http://pypi.python.org/pypi?:action=browse=all=512

As for the specific build use cases you mention:

> *  run unit tests

There are buildout recipes for creating testrunners (http://
pypi.python.org/pypi/zc.recipe.testrunner/1.1.0). This will create a ./
bin/test script in your project to run test suites.

> *  copy files to a distribution set based on a target (production,
> staging, clustered, etc.)

By default, a project will have a buildout config file named
buildout.cfg in the root directory. This file can inherit from other
build config files, so you can have a base.cfg, production.cfg and
development.cfg. I usually include things such as PyLint in the dev
build, and specific ports and passwords in the production.cfg file.
Buildout doesn't do remote execution, e.g. if you want to be able to
update production servers from your dev workstation like Rails devs do
with Capistrano.

>   * include config files specific to the target, and not including
> source control files and other development
> time artifacts.

Again, generally solved by having dev.cfg and production.cfg files
containing differences between the environments. And again, if you
have problems such as conditional header files and source code
compilation for multiple target platforms, buildout is probably going
to be the wrong tool.

> *  transfer distribution

Dunno what this means?

Be warned that while buildout is very lovely when your web app begins
to use more and more 3rd party projects, or has an increasingly
complex set of parts - it's awesome to add a couple packages to the
list of eggs used by a project and ask another developer to "svn up; ./
bin/buildout" and they get the same library set installed as you have
in your dev environment - but the introductory documentation for
buildout is still somewhat ... lacking.

>
> Perhaps you just hand build python scripts to do it.  Or do you use
> Ant or make?  I'm coming over from Java, and used to use Ant, but I'm
> migrating over to Python and would like to use what is generally
> considered the Pythonic way.
>

Python doesn't have an equivalent of Ant/Java as far as a certain
build tool being more predominantly used. Generally most of the
current crop of Python build tools are fairly young so you'll find
rough edges on all of the projects (with the exception of SCons I
think, although that's mostly a source code recompiliation build
tool). Most of the build tool interested folks are subscribed to the
distutils-sig mailing list, so it's a good place to ask more
questions:

http://www.python.org/community/sigs/current/distutils-sig/



--~--~-~--~~~---~--~~
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: Hierarchical Tagging

2008-09-09 Thread rsc

Have you also looked at



Cheers,

On Sep 9, 4:41 pm, bedros <[EMAIL PROTECTED]> wrote:
> thanks, I was look for that feature too.
>
> -B
>
> On Sep 9, 4:02 am, "Nikolay Panov" <[EMAIL PROTECTED]> wrote:
>
> > You may check the 
> > following:http://code.djangoproject.com/wiki/CookBookCategoryDataModelhttp://co...
>
> > Have a nice day,
> >    Nikolay.
>
> > On Tue, Sep 9, 2008 at 13:40, Thomas Guettler <[EMAIL PROTECTED]> wrote:
>
> > > Hi,
>
> > > django-tagging looks nice, but I need to have hierarchical tags:
>
> > >   animal / bird / eagle
>
> > > Any idea: Hack/Update django-tagging, create own, use 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Hierarchical Tagging

2008-09-09 Thread bedros

thanks, I was look for that feature too.

-B

On Sep 9, 4:02 am, "Nikolay Panov" <[EMAIL PROTECTED]> wrote:
> You may check the 
> following:http://code.djangoproject.com/wiki/CookBookCategoryDataModelhttp://code.google.com/p/django-categories/
>
> Have a nice day,
>    Nikolay.
>
> On Tue, Sep 9, 2008 at 13:40, Thomas Guettler <[EMAIL PROTECTED]> wrote:
>
> > Hi,
>
> > django-tagging looks nice, but I need to have hierarchical tags:
>
> >   animal / bird / eagle
>
> > Any idea: Hack/Update django-tagging, create own, use 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: weird osx problem (templates path)

2008-09-09 Thread Yousef Ourabi
What is interesting is that in the stack trace it doesn't show
$HOME/Documents/django/bjango/templates on the template_path, which is sort
of suspicious.


Try commenting out every template loader except:
filesystem.load_template_source


On Tue, Sep 9, 2008 at 1:38 PM, Anakin <[EMAIL PROTECTED]> wrote:

>
> hey again.
>
> @Yousef : this my views.py
>
> ---
>
> from bjango.weblog.models import Tags,Categories,Articles
> from django.shortcuts import render_to_response
> from django.http import HttpResponse
>
> def index(request):
>return render_to_response('base.html', {"foo": "bar"})
>
>
> ---
>
> @Adi
>
> yes there is a base.html in templates directory.
>
>
> thanx for replys.
>
>
> On Sep 9, 11:08 pm, "Yousef Ourabi" <[EMAIL PROTECTED]> wrote:
> > Could you post a snippet of the view that is loading/rendering the
> template?
> >
> > On Tue, Sep 9, 2008 at 1:07 PM, Adi J. Sieker <[EMAIL PROTECTED]> wrote:
> >
> >
> >
> > > Hi,
> >
> > > On Tue, 09 Sep 2008 21:56:24 +0200, Anakin <[EMAIL PROTECTED]>
> wrote:
> >
> > > > im using 10.5.2 osx Leopard. and im working with django 1.0 final
> > > > release.
> >
> > > > i have some screenshots about this error, settings - traceback and if
> > > > you need terminal log. you can see in this url.
> > > >http://www.deneloper.com/django-error/index.html
> >
> > > > please tell me, what is the problem :(
> >
> > > what's the content of the directory
> > > /Users/onurozkan/Documents/django/bjango/templates?
> > > Is there a base.html in that directory?
> >
> > > adi
> >
>

--~--~-~--~~~---~--~~
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: Tests catch Errors

2008-09-09 Thread Sven Richter

On Tue, 2008-09-09 at 21:28 +0200, Sven Richter wrote:
> On Tue, 2008-09-09 at 20:25 +0200, Sven Richter wrote:
> 
> > i was playing around with unittests and found the
> > failUnlessRaises(excClass, callableObj) Method.
> > If i understand it right the Method catches Exceptions
> > that are thrown by django.
> > 
> > I tried to send a post to a register form with:
> > res = Client().post('/register/', {data}) which
> > works so far.
> > 
> > Now i want to catch an Error, in this special case
> > the error that is thrown if i forget a field,
> > f.e. the password field.
> > So i want to catch the "forgot-password-field-error".
> > 
> > Now my question is, where can i find the exceptions
> > i can catch? Meaning where are they described?
> 
> I was looking around the net cause i am afraid i cannot
> sleep if i dont solve it tonight :D
> 
> At least i am more confused now.
> I found an example for a unittest which uses
> failUnlessRaises():
> 
> 
> 
> def raises_error(*args, **kwds):
> print args, kwds
> raise ValueError('Invalid value: ' + str(args) + str(kwds))
> 
> class ExceptionTest(unittest.TestCase):
> def testFailUnlessRaises(self):
> self.failUnlessRaises(ValueError, raises_error, 'a', b='c')
> 
> If i understand that right i have to  submit the values
> to the method raises_error from my testmethod which i want to check.
> 
> I am more confused now. How can i submit a post request with
> given data to a method? In this case the raises_error method?
> 
> And how can i catch the error that a form field has to be
> filled with some data?
> 
> At least i am questioning myself if failUnlessRaises
> is available in django the way i want to use it.
> 
> So i am wondering how i can achieve to test
> a form to throw an error?

I found what i was looking for:
self.assertFormError(res, 'form', 'username', 'This field is requied.')

As simple as that.

Just in the case one of the website admins reads here.
An example to that Method, besides an large test example
is provided under:
http://www.djangoproject.com/documentation/models/test_client/

But then i click on documentation and then go to the
apropriate test section i come to:
http://docs.djangoproject.com/en/dev/topics/testing/#assertions
which doesn't provide a link to the large example.

Providing that link would be really cool :-)


Greetings
Sven



--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



get_absolute_url gotcha

2008-09-09 Thread Delta20

I want to post this tip here in case this trips up other people:

The error message " objects don't have get_absolute_url()
methods" does not necessarily mean what it says. The error message is
also displayed if there is an error in the the method.

If a model has a get_absolute_url method that has an error in it (such
as a trivial syntax error), when you try to view the page, django
reports the error as [your] "objects don't have get_absolute_url()
methods". Check the method carefully for typos, variables that don't
exist, and other trivial errors that would normally be caught
otherwise.


--~--~-~--~~~---~--~~
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: What do you use as a build tool (like Ant or make)

2008-09-09 Thread ristretto.rb

Waf looks nice, I'll have a deeper look.

Is anyone using Vellum - http://www.zedshaw.com/projects/vellum/index.html

Thanks for all the replies



On Sep 10, 1:52 am, Adam Stein <[EMAIL PROTECTED]> wrote:
> I'm not doing unit tests at the moment, but for build and release I use
> Waf (http://code.google.com/p/waf/), which happens to be written in
> Python (including the configuration files).
>
>
>
> On Tue, 2008-09-09 at 01:14 -0700, ristretto.rb wrote:
> > Hello,
>
> > What do you use to build a Django project?  By build I mean,
>
> > *  run unit tests
> > *  copy files to a distribution set based on a target (production,
> > staging, clustered, etc.)
> >   * include config files specific to the target, and not including
> > source control files and other development
> > time artifacts.
> > *  transfer distribution
>
> > Perhaps you just hand build python scripts to do it.  Or do you use
> > Ant or make?  I'm coming over from Java, and used to use Ant, but I'm
> > migrating over to Python and would like to use what is generally
> > considered the Pythonic way.
>
> > cheers
>
> > --
>
> Adam Stein @ Xerox Corporation       Email: [EMAIL PROTECTED]
>
> Disclaimer: Any/All views expressed
> here have been proven to be my own.  [http://www.csh.rit.edu/~adam/]
--~--~-~--~~~---~--~~
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: Can not set up project with Django-admin.py

2008-09-09 Thread Karthik Krishnan

Sorry duplicate. Accidentally pressed send twice

On Sep 9, 12:37 pm, Karthik Krishnan <[EMAIL PROTECTED]> wrote:
> Hi,
>
> When I try to use django-admin.py to set up my project,
>
> this is the error that I get
>
> chmod:  changing permissions of 'django-admin.py' Permissions denied
>
> In addition, I can not set up a project that I want.
>
> I am running django on Windows Vista with a Cygwin shell.
>
> Is there anything I can do to resolve it?
>
> Thanks,
>
> Karthik
--~--~-~--~~~---~--~~
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: weird osx problem (templates path)

2008-09-09 Thread Anakin

hey again.

@Yousef : this my views.py

---

from bjango.weblog.models import Tags,Categories,Articles
from django.shortcuts import render_to_response
from django.http import HttpResponse

def index(request):
return render_to_response('base.html', {"foo": "bar"})


---

@Adi

yes there is a base.html in templates directory.


thanx for replys.


On Sep 9, 11:08 pm, "Yousef Ourabi" <[EMAIL PROTECTED]> wrote:
> Could you post a snippet of the view that is loading/rendering the template?
>
> On Tue, Sep 9, 2008 at 1:07 PM, Adi J. Sieker <[EMAIL PROTECTED]> wrote:
>
>
>
> > Hi,
>
> > On Tue, 09 Sep 2008 21:56:24 +0200, Anakin <[EMAIL PROTECTED]> wrote:
>
> > > im using 10.5.2 osx Leopard. and im working with django 1.0 final
> > > release.
>
> > > i have some screenshots about this error, settings - traceback and if
> > > you need terminal log. you can see in this url.
> > >http://www.deneloper.com/django-error/index.html
>
> > > please tell me, what is the problem :(
>
> > what's the content of the directory
> > /Users/onurozkan/Documents/django/bjango/templates?
> > Is there a base.html in that directory?
>
> > adi
--~--~-~--~~~---~--~~
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: Introducing django-cms

2008-09-09 Thread Antoni Aloy
2008/9/8 Thomas Steinacher <[EMAIL PROTECTED]>

Hi Thomas!

>
> @Antoni Aloy:
> What do you mean by integration? Like integrating other applications
> (e.g. a gallery) into the CMS? We're still looking for a good solution
> to do that (e.g. by providing an API which allows to write a CMS
> plugin which would allow to integrate a third-party app directly into
> the CMS).
>
> I divide CMS in applications in two groups, one are just APIs, so you can
create an application and the CMS just provides the content, but in that
kind of applications textual content  is not the goal. So, they are easy to
integrate with your applications but they don't provide much functionallity.
Django-cms would be that kind.

The other group are CMS applications. That is, the CMS *is *the application.
They are very usefull when your site is content based. Usually this kind of
cms applications don't fit when creating applications that need a CMS. The
user interface for the CMS and the fucntionallity are much better than the
prevoious one.

I don't know yet where to classify it. In fact I'll be very happy if I could
have a powerfull CMS like yours being able to create applications using it
as a way to manage multilanguage content.

My english is not as good as I like but this is what I'd tried to say with
"integration".

-- 
Antoni Aloy López
Blog: http://trespams.com
Site: http://apsl.net

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Creating an Archive

2008-09-09 Thread djandrow

Hello, I currently have a website which I am trying to add an archive
to, i currently have the following date based URLs:

(r'^$', 'django.views.generic.date_based.archive_index',
archive_info),
(r'^(?P\d{4})/$',
'django.views.generic.date_based.archive_year', archive_info),
(r'^(?P\d{4})/(?P[a-z]{3})/$',
'django.views.generic.date_based.archive_month', archive_info),
(r'^(?P\d{4})/(?P[a-z]{3})/(?P\w{1,2})/(?
P[-\w]+)/$',
 'django.views.generic.date_based.object_detail',
archive_info),

my archive info dict contains the following:

archive_info = {
'queryset' : Entry.objects.all(),
'date_field' : 'entry_date',
'template_name' : 'blog/archive.html',
}

Now I have 2 questions about this:

1. I understand that to get your standard archive you use links on
your home you use 'django.views.generic.
date_based.archive_index', however if i use:

{% for dates in date_list %} {{ dates.date }} {% endfor %}

I just get 2008-01-01, i guess thats cos I only have entries in 2008
and the date is formatted wrongly, so my question is how can i get a
list of months, like you find on any archive links; September 2008,
October 2008 etc.

2. At the moment i've just been testing the generic view in a template
which does nothing else apart from show archive links, how can I
incorporate this with my main template (the index page I already have)
which uses views?

I would be grateful for any help or advice.

Andrew
--~--~-~--~~~---~--~~
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: Introducing django-cms

2008-09-09 Thread Erik Allik

How does it integrate with other/custom django apps?

Erik

On 08.09.2008, at 17:15, Thomas Steinacher wrote:

>
> Hello Djangonauts!
>
> I would like to introduce django-cms, a free, BSD-licensed content
> management system based on Django. It is seamlessly integrated with
> Django's admin interface and supports a hierarchical page structure,
> internationalization and much more.
>
> You can find the project page on http://django-cms.org/. There is also
> a demo site set up which allows you to play around with the admin
> interface.
>
> The software is still in development and we would appreciate any
> feedback and contributions.
>
> Greetings from Switzerland,
>
> Thomas Steinacher
> djangohosting.ch
>
> >


--~--~-~--~~~---~--~~
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: weird osx problem (templates path)

2008-09-09 Thread Yousef Ourabi
Could you post a snippet of the view that is loading/rendering the template?



On Tue, Sep 9, 2008 at 1:07 PM, Adi J. Sieker <[EMAIL PROTECTED]> wrote:

>
> Hi,
>
> On Tue, 09 Sep 2008 21:56:24 +0200, Anakin <[EMAIL PROTECTED]> wrote:
>
> > im using 10.5.2 osx Leopard. and im working with django 1.0 final
> > release.
> >
> > i have some screenshots about this error, settings - traceback and if
> > you need terminal log. you can see in this url.
> > http://www.deneloper.com/django-error/index.html
> >
> > please tell me, what is the problem :(
>
> what's the content of the directory
> /Users/onurozkan/Documents/django/bjango/templates?
> Is there a base.html in that directory?
>
> adi
>
> >
>

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



lighttpd matters - startup

2008-09-09 Thread wishi

Hi mates ;)

These days I thought working myself into Django - to get some new
skills. I could need some start-up help to configure my environment,
which isn't the "Apatschi" with mod_python. I'm using a lighttpd in my
Debian server environment, that's going to be configured:

Therefore I added mod_rewrite and mod_fastcgi as described in this
Howto documentation here:
http://sam.bluwiki.com/blog/labels/linux.php

server.modules  = (
"mod_access",
"mod_alias",
"mod_rewrite",
"mod_fastcgi",
"mod_accesslog",
"mod_redirect",
"mod_status",
#   "mod_evhost",
"mod_compress",
"mod_usertrack",
#   "mod_rrdtool",
#   "mod_webdav",
[...]

I configured the fastcgi stuff:

fastcgi.server = (
".php" => ((
"bin-path" => "/usr/bin/php5-cgi",
"socket" => "/tmp/php.socket"
)),
"django.fcgi" => (
"main" => (
"host" => "127.0.0.1",
"port" => 9090, #set the port numbers to what-eva you
want
),
 ),
"admin.fcgi" => (
"admin" =>
(
"host" => "127.0.0.1", "port" => 9091, )
)
)

And the rewrite stuff:

url.rewrite-once = (
"^(/media.*)$" => "$1",
"^(/static.*)$" => "$1",
"^/favicon\.ico$" => "/media/favicon.ico",
"^(/admin/.*)$" => "/admin.fcgi$1", "^(/.*)$" => "/django.fcgi
$1"
)


And sweet as, that's it. Django is working... was just apt-get install
blabla.

% django-admin --version
0.95.1


% ls /var/django/testproject
__init__.py  manage.py  settings.py  urls.py

No modifications jet, the basic django-test-webserver works fine.

% python manage.py runfcgi method=prefork host=127.0.0.1 port=9090
pidfile=django.pid
[no error]


Nevertheless - the httpd starts without any error, and django-admin
works, too - I get an internal server error 500. Does anybody know
what's wrong or which steps may be needed for further debugging? Could
be very helpful. The general documentation stuff focuses on Apache,
which I completely dislike and don't want to have on my system.

Thanks for help,
Marius

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Newbie question Can not set up project using Cygwin on Windows Vista

2008-09-09 Thread Karthik Krishnan

Hi,

I am sure that this issue has come up before but I could not find in
the forum mailing list.

When I try to run chmod +x django-admin.py , I get the following
error.

chmod: changing permissions of `django-admin.py': Permission denied

Is there something I am doing wrong? Any help would be appreciated.

Thanks,

Karthik

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Can not set up project with Django-admin.py

2008-09-09 Thread Karthik Krishnan

Hi,

When I try to use django-admin.py to set up my project,

this is the error that I get

chmod:  changing permissions of 'django-admin.py' Permissions denied

In addition, I can not set up a project that I want.

I am running django on Windows Vista with a Cygwin shell.

Is there anything I can do to resolve it?

Thanks,

Karthik

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Iowa Python Users Group - First Meeting

2008-09-09 Thread Mike Driscoll

Hi all,

I'm not sure how many people on this list are Iowans, but I thought
you guys (and girls) would like to know the following:

The first meeting date for the Iowa Python Users Group has been
decided. Here are the details:



Time / Date:  Wednesday, Sept. 24 from 7-9 p.m.

Location:
Marshall County Sheriff's Office, 3rd floor
2369 Jessup Ave
Marshalltown, IA 50158

Unofficial website: http://www.ipug.pythonlibrary.org



Don't know how to get there? Check out maps.yahoo.com or
maps.google.com. The Sheriff's Office is not actually in Marshalltown.
If you take Highway 30 East, towards Marshalltown you'll see it on
your left. There's a large water tower there and the building is a
rusty red color. There are some signs for a Tractor convention there
as well. If you're coming from the other direction, then skip ALL the
exits and keep driving until the lanes go from 4 lanes to 2. It should
be the second right after that.

I am still developing the agenda for our first meeting, but here are
some of the things we're going to discuss:

- What day really works best for meeting? (if you can't make the first
one, you can email me your votes!)
- Figure out what domain name our group should have
- Decide on what Python web framework to use to create said site
(which will be a group project)
- Try to come up with what format we want our meetings to take.

Plone and Zope users are welcome. In fact, anyone who is interested in
Python (regardless of their experience with it) is welcome to come.
Let your Iowan Python friends know.

Questions or ideas? Send them to me. Thanks!

---
Mike Driscoll

email: mike (at) pythonlibrary (dot) org
Blog:   http://blog.pythonlibrary.org
Python Extension Building Network: http://www.pythonlibrary.org
--~--~-~--~~~---~--~~
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: weird osx problem (templates path)

2008-09-09 Thread Adi J. Sieker

Hi,

On Tue, 09 Sep 2008 21:56:24 +0200, Anakin <[EMAIL PROTECTED]> wrote:

> im using 10.5.2 osx Leopard. and im working with django 1.0 final
> release.
>
> i have some screenshots about this error, settings - traceback and if
> you need terminal log. you can see in this url.
> http://www.deneloper.com/django-error/index.html
>
> please tell me, what is the problem :(

what's the content of the directory  
/Users/onurozkan/Documents/django/bjango/templates?
Is there a base.html in that directory?

adi

--~--~-~--~~~---~--~~
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: Stupid noob question - admin link

2008-09-09 Thread Peter Bailey

Hi Daniel.

I think this is way more complex than what I want.
I have a main page (e..g. the default page in my web root). It is
really just a title page with several links, one of which is to my
admin site to add/update objects. I just want a straight link back on
the admin page to the page in my root where I came from, so the user
can navigate there after completing whatever they were doing in admin.

On Sep 9, 3:42 pm, Daniel Roseman <[EMAIL PROTECTED]>
wrote:
> On Sep 9, 7:16 pm, Peter Bailey <[EMAIL PROTECTED]> wrote:
>
> > Hi all, starting to think there is so much stuff in django and python
> > that I will never learn it all. I am building a site that used the
> > admin piece for most of the CRUD and a few other pages for the rest of
> > my requirements. I link to the admin from my main app page, and would
> > like to be able to link back the other way. Don't see an obvious way
> > to do this. Can anyone tell me a easy way to add a hyperlink from the
> > main admin page to somewhere else outside the admin app.
>
> > Thanks, and sorry for the dumb question.
>
> > Peter
>
> If you define a get_absolute_url() method on your model, you'll get an
> automatic 'view on site' link from the editing page in the admin which
> goes to the view defined by that method - 
> seehttp://docs.djangoproject.com/en/dev/ref/models/instances/#get-absolu...
> . Is that what you want?
> --
> DR
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



weird osx problem (templates path)

2008-09-09 Thread Anakin

im using 10.5.2 osx Leopard. and im working with django 1.0 final
release.

i have some screenshots about this error, settings - traceback and if
you need terminal log. you can see in this url.
http://www.deneloper.com/django-error/index.html

please tell me, what is the problem :(

thanx for support.
--~--~-~--~~~---~--~~
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: what's wrong with my django comments?

2008-09-09 Thread Jarek Zgoda

Not necessarily. I had this problem after updating to new comments  
framework without removing stale .pyc files. After removing completely  
the directory /usr/lib/python2.5/site-packages/django/contrib/comments  
and installing Django back again, everything started working.

Wiadomość napisana w dniu 2008-09-09, o godz. 20:59, przez begray:

>
> It looks like error occurs when django tries to find matching url for
> view: django.contrib.comments.views.comments.post_comment
> Likely there's something wrong in your urls.py, eg. you've got admin
> urls in old style.
>
> please read the following
> http://docs.djangoproject.com/en/dev/ref/contrib/admin/#ref-contrib-admin
> and check your urls.py
>
> On 3 сент, 19:14, nonight <[EMAIL PROTECTED]> wrote:
>> I have add (r'^comments/', include('django.contrib.comments.urls'))  
>> in
>> the urls.py
>>
>> the codes in the template:
>> {% load comments %}
>> {% render_comment_form for user %}
>>
>> the error was :
>> Caught an exception while rendering: No module named urls
>>
>> Original Traceback (most recent call last):
>>   File "/usr/local/lib/python2.4/site-packages/django/template/
>> debug.py", line 71, in render_node
>> result = node.render(context)
>>   File "/usr/local/lib/python2.4/site-packages/django/template/
>> __init__.py", line 888, in render
>> return func(*resolved_vars)
>>   File "/usr/local/lib/python2.4/site-packages/django/contrib/ 
>> comments/
>> templatetags/comments.py", line 246, in comment_form_target
>> return comments.get_form_target()
>>   File "/usr/local/lib/python2.4/site-packages/django/contrib/ 
>> comments/
>> __init__.py", line 50, in get_form_target
>> return
>> urlresolvers 
>> .reverse("django.contrib.comments.views.comments.post_comment")
>>   File "/usr/local/lib/python2.4/site-packages/django/core/
>> urlresolvers.py", line 251, in reverse
>> return iri_to_uri(u'%s%s' % (prefix,
>> get_resolver(urlconf).reverse(viewname,
>>   File "/usr/local/lib/python2.4/site-packages/django/core/
>> urlresolvers.py", line 226, in reverse
>> possibilities, pattern = self.reverse_dict.get(lookup_view, [(),
>> ()])
>>   File "/usr/local/lib/python2.4/site-packages/django/core/
>> urlresolvers.py", line 160, in _get_reverse_dict
>> for name, (matches, pat) in pattern.reverse_dict.iteritems():
>>   File "/usr/local/lib/python2.4/site-packages/django/core/
>> urlresolvers.py", line 153, in _get_reverse_dict
>> if not self._reverse_dict and hasattr(self.urlconf_module,
>> 'urlpatterns'):
>>   File "/usr/local/lib/python2.4/site-packages/django/core/
>> urlresolvers.py", line 197, in _get_urlconf_module
>> self._urlconf_module = __import__(self.urlconf_name, {}, {},  
>> [''])
>> ImportError: No module named urls
>> Template error
>>
>> In template /usr/local/lib/python2.4/site-packages/django/contrib/
>> comments/templates/comments/form.html, error at line 2
>> Caught an exception while rendering: No module named urls
>> 1   {% load comments %}
>> 2   
>> 3 {% for field in form %}
>> 4   {% if field.is_hidden %}
>> 5 {{ field }}
>> 6   {% else %}
>> 7 > 8   {% if field.errors %} class="error"{% endif %}
>> 9   {% ifequal field.name "honeypot" %}  
>> style="display:none;"{%
>> endifequal %}>
>> 10  {% if field.errors %}{{ field.errors }}{% endif %}
>> 11  {{ field.label_tag }} {{ field }}
>> 12
>>
>> I don't know how to do ,who can help me ?
>
> >

-- 
We read Knuth so you don't have to. - Tim Peters

Jarek Zgoda, R, Redefine
[EMAIL PROTECTED]


--~--~-~--~~~---~--~~
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: Stupid noob question - admin link

2008-09-09 Thread Denis Frère

On Sep 9, 8:16 pm, Peter Bailey <[EMAIL PROTECTED]> wrote:
> Can anyone tell me a easy way to add a hyperlink from the
> main admin page to somewhere else outside the admin app.

You should probably read :
http://docs.djangoproject.com/en/dev/ref/contrib/admin/#overriding-admin-templates

Summary : You could simply copy the file base_site.html from admin
templates to a directory called "admin" in your own template directory
and add a link to your own pages in {% block branding %} so you would
have access to the link on every admin page.

Have fun with Django.

Denis
--~--~-~--~~~---~--~~
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: Stupid noob question - admin link

2008-09-09 Thread Daniel Roseman

On Sep 9, 7:16 pm, Peter Bailey <[EMAIL PROTECTED]> wrote:
> Hi all, starting to think there is so much stuff in django and python
> that I will never learn it all. I am building a site that used the
> admin piece for most of the CRUD and a few other pages for the rest of
> my requirements. I link to the admin from my main app page, and would
> like to be able to link back the other way. Don't see an obvious way
> to do this. Can anyone tell me a easy way to add a hyperlink from the
> main admin page to somewhere else outside the admin app.
>
> Thanks, and sorry for the dumb question.
>
> Peter

If you define a get_absolute_url() method on your model, you'll get an
automatic 'view on site' link from the editing page in the admin which
goes to the view defined by that method - see
http://docs.djangoproject.com/en/dev/ref/models/instances/#get-absolute-url
. Is that what you want?
--
DR
--~--~-~--~~~---~--~~
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: Apache httpd conf with mod_python

2008-09-09 Thread Denis Frère

On Sep 9, 8:33 pm, [EMAIL PROTECTED] wrote:
> guys, fixed it. apparently the issue was having it in /home/chris/
> I moved it to var/www/ and now it's working :) i knew it'd be
> something as simple as that.

I'm glad for you if everything works as you intended, but the problem
was certainly not having your project in your home directory.
I think it was a permission problem somewhere (e.g. www-data not being
able to read your home directory or something like that).

Anyway, have fun with Django.

Denis

--~--~-~--~~~---~--~~
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: Tests catch Errors

2008-09-09 Thread Sven Richter

On Tue, 2008-09-09 at 20:25 +0200, Sven Richter wrote:

> i was playing around with unittests and found the
> failUnlessRaises(excClass, callableObj) Method.
> If i understand it right the Method catches Exceptions
> that are thrown by django.
> 
> I tried to send a post to a register form with:
> res = Client().post('/register/', {data}) which
> works so far.
> 
> Now i want to catch an Error, in this special case
> the error that is thrown if i forget a field,
> f.e. the password field.
> So i want to catch the "forgot-password-field-error".
> 
> Now my question is, where can i find the exceptions
> i can catch? Meaning where are they described?

I was looking around the net cause i am afraid i cannot
sleep if i dont solve it tonight :D

At least i am more confused now.
I found an example for a unittest which uses
failUnlessRaises():



def raises_error(*args, **kwds):
print args, kwds
raise ValueError('Invalid value: ' + str(args) + str(kwds))

class ExceptionTest(unittest.TestCase):
def testFailUnlessRaises(self):
self.failUnlessRaises(ValueError, raises_error, 'a', b='c')

If i understand that right i have to  submit the values
to the method raises_error from my testmethod which i want to check.

I am more confused now. How can i submit a post request with
given data to a method? In this case the raises_error method?

And how can i catch the error that a form field has to be
filled with some data?

At least i am questioning myself if failUnlessRaises
is available in django the way i want to use it.

So i am wondering how i can achieve to test
a form to throw an error?


Greetings
Sv


--~--~-~--~~~---~--~~
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: Error Accessing User objects from Admin

2008-09-09 Thread dbee

Thanks Karen. Got it :-)
--~--~-~--~~~---~--~~
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: what's wrong with my django comments?

2008-09-09 Thread begray

It looks like error occurs when django tries to find matching url for
view: django.contrib.comments.views.comments.post_comment
Likely there's something wrong in your urls.py, eg. you've got admin
urls in old style.

please read the following
http://docs.djangoproject.com/en/dev/ref/contrib/admin/#ref-contrib-admin
and check your urls.py

On 3 сент, 19:14, nonight <[EMAIL PROTECTED]> wrote:
> I have add (r'^comments/', include('django.contrib.comments.urls')) in
> the urls.py
>
> the codes in the template:
> {% load comments %}
> {% render_comment_form for user %}
>
> the error was :
> Caught an exception while rendering: No module named urls
>
> Original Traceback (most recent call last):
>   File "/usr/local/lib/python2.4/site-packages/django/template/
> debug.py", line 71, in render_node
>     result = node.render(context)
>   File "/usr/local/lib/python2.4/site-packages/django/template/
> __init__.py", line 888, in render
>     return func(*resolved_vars)
>   File "/usr/local/lib/python2.4/site-packages/django/contrib/comments/
> templatetags/comments.py", line 246, in comment_form_target
>     return comments.get_form_target()
>   File "/usr/local/lib/python2.4/site-packages/django/contrib/comments/
> __init__.py", line 50, in get_form_target
>     return
> urlresolvers.reverse("django.contrib.comments.views.comments.post_comment")
>   File "/usr/local/lib/python2.4/site-packages/django/core/
> urlresolvers.py", line 251, in reverse
>     return iri_to_uri(u'%s%s' % (prefix,
> get_resolver(urlconf).reverse(viewname,
>   File "/usr/local/lib/python2.4/site-packages/django/core/
> urlresolvers.py", line 226, in reverse
>     possibilities, pattern = self.reverse_dict.get(lookup_view, [(),
> ()])
>   File "/usr/local/lib/python2.4/site-packages/django/core/
> urlresolvers.py", line 160, in _get_reverse_dict
>     for name, (matches, pat) in pattern.reverse_dict.iteritems():
>   File "/usr/local/lib/python2.4/site-packages/django/core/
> urlresolvers.py", line 153, in _get_reverse_dict
>     if not self._reverse_dict and hasattr(self.urlconf_module,
> 'urlpatterns'):
>   File "/usr/local/lib/python2.4/site-packages/django/core/
> urlresolvers.py", line 197, in _get_urlconf_module
>     self._urlconf_module = __import__(self.urlconf_name, {}, {}, [''])
> ImportError: No module named urls
> Template error
>
> In template /usr/local/lib/python2.4/site-packages/django/contrib/
> comments/templates/comments/form.html, error at line 2
> Caught an exception while rendering: No module named urls
> 1       {% load comments %}
> 2       
> 3         {% for field in form %}
> 4           {% if field.is_hidden %}
> 5             {{ field }}
> 6           {% else %}
> 7              8               {% if field.errors %} class="error"{% endif %}
> 9               {% ifequal field.name "honeypot" %} style="display:none;"{%
> endifequal %}>
> 10              {% if field.errors %}{{ field.errors }}{% endif %}
> 11              {{ field.label_tag }} {{ field }}
> 12            
>
> I don't know how to do ,who can help me ?

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Tests catch Errors

2008-09-09 Thread Sven Richter

Hi,

i was playing around with unittests and found the
failUnlessRaises(excClass, callableObj) Method.
If i understand it right the Method catches Exceptions
that are thrown by django.

I tried to send a post to a register form with:
res = Client().post('/register/', {data}) which
works so far.

Now i want to catch an Error, in this special case
the error that is thrown if i forget a field,
f.e. the password field.
So i want to catch the "forgot-password-field-error".

Now my question is, where can i find the exceptions
i can catch? Meaning where are they described?


Greetings
Sven


--~--~-~--~~~---~--~~
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: always rollback decorator

2008-09-09 Thread Malcolm Tredinnick


On Tue, 2008-09-09 at 10:35 +0200, Thomas Guettler wrote:
[...]
> I use Postgres supports nested transaction by using savepoints.
> 
> Unfortunately I can't get it working: I try to use savepoints, but they 
> get lost
> as soon is the commit_on_success decorator sends COMMIT.

That's how savepoints work, yes. They're not exactly the same as nested
transactions, since the transaction overrides everything. Savepoints
give you saved points within a transaction, but not more than that.

> I guess I need to convert all commit_on_success decorators to
> a new commit_on_success_unless_inside_transaction decorator.
> 
> Any idea how to solve this?

Write a new database backend that inherits pretty much everything from
the postgresql backend, but overrides the _commit and _rollback methods
of the BaseDatabaseOperations class. Then use that backend for your
tests.

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 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: Apache httpd conf with mod_python

2008-09-09 Thread mccomas . chris

guys, fixed it. apparently the issue was having it in /home/chris/ i
moved it to var/www/ and now it's working :) i knew it'd be something
as simple as that.

On Sep 9, 1:12 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote:
> On Tue, Sep 9, 2008 at 11:53 AM, <[EMAIL PROTECTED]> wrote:
>
> > i'm really at a loss.
>
> > mod_python and django are both installed under python2.4. SELinux is
> > disabled. the standard permissions for the django_projects folder is
> > 775. everything validates. i can run python at the command line and
> > import the settings, etc.
>
> What about the permissions on the directory containing django_projects?  And
> (though you asked this in a different note I can't find at the moment)
> moving the code to someplace you are sure Apache has read access to may fix
> the problem.  If it does, then you know that the problem is Apache's ability
> to read the files, for whatever mysterious reason.
>
> (Personally I put my 'production' code level someplace outside my home
> directory.  That way I don't break the 'real' server by anything I do in my
> home directory, and updates to what Apache is running have to be done by me
> with full consciousness that I'm updating the production site.  So moving
> what Apache runs out of your home directory may not be a bad idea in
> general, but that's just how I operate.)
>
> Karen
--~--~-~--~~~---~--~~
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: Error Accessing User objects from Admin

2008-09-09 Thread Karen Tracey
On Tue, Sep 9, 2008 at 12:24 PM, dbee <[EMAIL PROTECTED]> wrote:

>
> I seem to get an error everytime i try to access a user object on the
> admin panel. It's really annoying ...
>
> The pastebin is here ...
>
> http://pastebin.com/m71119d2d
>
> Any help is greatly appreciated,
>

Traceback seems to indicate you have a Model with a Field that has specified
a validator_list as something that is not subscriptable.  At somewhere
around the level of code you are running the User model (in
django/contrib/auth/models.py) has a validator_list for its username field:

username = models.CharField(_('username'), max_length=30, unique=True,
validator_list=[validators.isAlphaNumeric], help_text=_("Required. 30
characters or fewer. Alphanumeric characters only (letters, digits and
underscores)."))

That's subscriptable since the validator_list is in fact a list.

Have you changed that line of code at all?  If not, what changed between the
time this was working (I assume it was working at some point?) and when it
started breaking?  Have you specified anything to be edited inline with
Users?  If so, does the inline-edited model specify any validator_lists?

Karen

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Stupid noob question - admin link

2008-09-09 Thread Peter Bailey

Hi all, starting to think there is so much stuff in django and python
that I will never learn it all. I am building a site that used the
admin piece for most of the CRUD and a few other pages for the rest of
my requirements. I link to the admin from my main app page, and would
like to be able to link back the other way. Don't see an obvious way
to do this. Can anyone tell me a easy way to add a hyperlink from the
main admin page to somewhere else outside the admin app.

Thanks, and sorry for the dumb question.

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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Forms

2008-09-09 Thread David

duh! apologies - misspelt 'FORM' (Jesus)


On Sep 9, 6:34 pm, David <[EMAIL PROTECTED]> wrote:
> Hey, I seem to be doing something wrong as when I click on the button
> on the page the message does not change?
>
> --- 
> --
>
> {% block title %}Person Form{% endblock %}
> {% block content %}
> {{ message }}
>
> 
> 
> {{ pForm }}
> 
> 
> 
> {% endblock %}
>
> --- 
> --

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Forms

2008-09-09 Thread David

Hey, I seem to be doing something wrong as when I click on the button
on the page the message does not change?

-

{% block title %}Person Form{% endblock %}
{% block content %}
{{ message }}



{{ pForm }}



{% endblock %}

-

class PersonForm(ModelForm):
class Meta:
  model = Person

def person_form(request, pID='0'):
f = PersonForm()
message= 'Unknown Request'
p = get_object_or_404(Person,pk=pID)

if request.method == 'GET':
f = PersonForm(instance=p)
message = 'Editing person %s ' % p.name

if request.method == 'POST':
if request.POST['submit'] == 'update':
message = 'Update Request for %s ' % p.name

return render_to_response('People/person_form.html', {'pForm':
f,'message': message})


--~--~-~--~~~---~--~~
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: Apache httpd conf with mod_python

2008-09-09 Thread Karen Tracey
On Tue, Sep 9, 2008 at 11:53 AM, <[EMAIL PROTECTED]> wrote:

>
> i'm really at a loss.
>
> mod_python and django are both installed under python2.4. SELinux is
> disabled. the standard permissions for the django_projects folder is
> 775. everything validates. i can run python at the command line and
> import the settings, etc.
>
>
What about the permissions on the directory containing django_projects?  And
(though you asked this in a different note I can't find at the moment)
moving the code to someplace you are sure Apache has read access to may fix
the problem.  If it does, then you know that the problem is Apache's ability
to read the files, for whatever mysterious reason.

(Personally I put my 'production' code level someplace outside my home
directory.  That way I don't break the 'real' server by anything I do in my
home directory, and updates to what Apache is running have to be done by me
with full consciousness that I'm updating the production site.  So moving
what Apache runs out of your home directory may not be a bad idea in
general, but that's just how I operate.)

Karen

--~--~-~--~~~---~--~~
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: Apache httpd conf with mod_python

2008-09-09 Thread mccomas . chris

I think I'm going to start over...

I'm running RHEL 5, so I'll have our network admin remove Apache2,
then reinstall it and try this all over again.



On Sep 9, 1:00 pm, [EMAIL PROTECTED] wrote:
> Steve, no dice.
>
> ImportError: Could not import settings 'settings' (Is it on sys.path?
> Does it have syntax errors?): No module named settings
>
> i'm just so friggin confused now :) you think this would work...
>
> On Sep 9, 12:53 pm, Steve Holden <[EMAIL PROTECTED]> wrote:
>
> > [EMAIL PROTECTED] wrote:
> > > At first I didn't keep all of the original stuff in the httpd.conf,
> > > but then I went back and put up the copy that I backed up and added
> > > the Django stuff to it.
>
> > > i have the django stuff in /home/chris/web/
>
> > > should it be in /var/www ?
>
> > Nope, that should not make any difference.
>
> > The only real difference I see between your setup and the one I'm using
> > live on holdenweb.com is that I use a PythonPath entry that refers to my
> > project and then use "settings" as the name of the setting module. I
> > don't know whether that will make a difference, but you could try
>
> > 
> >     SetHandler python-program
> >     PythonPath "['/home/chris/web/django_project/ucwv'] + sys.path"
> >     PythonHandler django.core.handlers.modpython
> >     SetEnv DJANGO_SETTINGS_MODULE settings
> >     PythonDebug On
> > 
>
> > regards
> >  Steve
> > --
> > Steve Holden        +1 571 484 6266   +1 800 494 3119
> > Holden Web LLC              http://www.holdenweb.com/
--~--~-~--~~~---~--~~
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: Apache httpd conf with mod_python

2008-09-09 Thread mccomas . chris

Steve, no dice.

ImportError: Could not import settings 'settings' (Is it on sys.path?
Does it have syntax errors?): No module named settings

i'm just so friggin confused now :) you think this would work...

On Sep 9, 12:53 pm, Steve Holden <[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] wrote:
> > At first I didn't keep all of the original stuff in the httpd.conf,
> > but then I went back and put up the copy that I backed up and added
> > the Django stuff to it.
>
> > i have the django stuff in /home/chris/web/
>
> > should it be in /var/www ?
>
> Nope, that should not make any difference.
>
> The only real difference I see between your setup and the one I'm using
> live on holdenweb.com is that I use a PythonPath entry that refers to my
> project and then use "settings" as the name of the setting module. I
> don't know whether that will make a difference, but you could try
>
> 
>     SetHandler python-program
>     PythonPath "['/home/chris/web/django_project/ucwv'] + sys.path"
>     PythonHandler django.core.handlers.modpython
>     SetEnv DJANGO_SETTINGS_MODULE settings
>     PythonDebug On
> 
>
> regards
>  Steve
> --
> Steve Holden        +1 571 484 6266   +1 800 494 3119
> Holden Web LLC              http://www.holdenweb.com/
--~--~-~--~~~---~--~~
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: Apache httpd conf with mod_python

2008-09-09 Thread Steve Holden

[EMAIL PROTECTED] wrote:
> At first I didn't keep all of the original stuff in the httpd.conf,
> but then I went back and put up the copy that I backed up and added
> the Django stuff to it.
> 
> i have the django stuff in /home/chris/web/
> 
> should it be in /var/www ?
> 
Nope, that should not make any difference.

The only real difference I see between your setup and the one I'm using
live on holdenweb.com is that I use a PythonPath entry that refers to my
project and then use "settings" as the name of the setting module. I
don't know whether that will make a difference, but you could try


SetHandler python-program
PythonPath "['/home/chris/web/django_project/ucwv'] + sys.path"
PythonHandler django.core.handlers.modpython
SetEnv DJANGO_SETTINGS_MODULE settings
PythonDebug On


regards
 Steve
-- 
Steve Holden+1 571 484 6266   +1 800 494 3119
Holden Web LLC  http://www.holdenweb.com/

--~--~-~--~~~---~--~~
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: Apache httpd conf with mod_python

2008-09-09 Thread mccomas . chris

At first I didn't keep all of the original stuff in the httpd.conf,
but then I went back and put up the copy that I backed up and added
the Django stuff to it.

i have the django stuff in /home/chris/web/

should it be in /var/www ?

On Sep 9, 12:19 pm, Steve Holden <[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] wrote:
> > i'm really at a loss.
>
> > mod_python and django are both installed under python2.4. SELinux is
> > disabled. the standard permissions for the django_projects folder is
> > 775. everything validates. i can run python at the command line and
> > import the settings, etc.
>
> You *did* retain all the stuff from the rest of the original Apache conf
> file, right?
>
> And you have checked the permissions on the individual files as well as
> the directories?
>
> regards
>  Steve
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Error Accessing User objects from Admin

2008-09-09 Thread dbee

I seem to get an error everytime i try to access a user object on the
admin panel. It's really annoying ...

The pastebin is here ...

http://pastebin.com/m71119d2d

Any help is greatly appreciated,

Thanks
--~--~-~--~~~---~--~~
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: Apache httpd conf with mod_python

2008-09-09 Thread Steve Holden

[EMAIL PROTECTED] wrote:
> i'm really at a loss.
>
> mod_python and django are both installed under python2.4. SELinux is
> disabled. the standard permissions for the django_projects folder is
> 775. everything validates. i can run python at the command line and
> import the settings, etc.
>   
You *did* retain all the stuff from the rest of the original Apache conf
file, right?

And you have checked the permissions on the individual files as well as
the directories?

regards
 Steve


--~--~-~--~~~---~--~~
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: Internal server error upgarding from 0.97 to 1.0

2008-09-09 Thread Karen Tracey
On Tue, Sep 9, 2008 at 11:39 AM, Haku <[EMAIL PROTECTED]> wrote:

>
> Hello, i'm quite frustrated by this problem.
> Today i had the  idea to update my svn from the old 0.97 to the 1.0
> release, and now nothing is working anymore.
>

0.97 was never an official release.  So, you were running some revision
pulled from SVN.  Before upgrading it would have been helpful if you noted
the specific revision reported by 'svn info'.  That would have given you the
ability to svn up -r back to that revision in case of any migration
difficulties.


> I always get an anonymous "Internal Server Error"
> Maybe because my project included mptt, but the fact is that i cant
> figure out why it is crashing. Seems like it's the slug fields but i
> don't really know.
>

The error is not so anonymous.  You include the traceback below.  For easier
debug on the upgrade, you might want to consider setting DEBUG to True until
you complete the migration  to 1.0.  That way you will get pretty debug
pages instead of the basic Internal Error page with the actual traceback
hidden in a logfile.


>
> Is there a solution? Or maybe, how can i return to my loved 0.97
> version?


You need to update your code to account for the backwards-incompatible
changes made between whatever version you had and the 1.0 code.  You
probably want to read:

http://docs.djangoproject.com/en/dev/releases/1.0-porting-guide

as a start.


> [snip]

[Tue Sep 09 19:35:43 2008] [error] [client 192.168.0.101]
> PythonHandler django.core.handlers.modpython: TypeError: __init__()
> got an unexpected keyword argument 'prepopulate_from'
>

For this particular error, search for 'prepopulate_from' on that page I
pointed to above and you'll see this is related to the new admin in 1.0.
There are going to be other things you will need to change as well to get
admin working on 1.0, follow the porting guide though and you should be able
to get things running again with relatively little pain.

Karen

--~--~-~--~~~---~--~~
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: Internal server error upgarding from 0.97 to 1.0

2008-09-09 Thread David Zhou

On Sep 9, 2008, at 11:39 AM, Haku wrote:

>
> Hello, i'm quite frustrated by this problem.
> Today i had the  idea to update my svn from the old 0.97 to the 1.0
> release, and now nothing is working anymore.
>
> I always get an anonymous "Internal Server Error"
> Maybe because my project included mptt, but the fact is that i cant
> figure out why it is crashing. Seems like it's the slug fields but i
> don't really know.
>
> Is there a solution? Or maybe, how can i return to my loved 0.97
> version?

Looks like it's because of newforms-admin.

> [Tue Sep 09 19:35:43 2008] [error] [client 192.168.0.101]
> PythonHandler django.core.handlers.modpython: TypeError: __init__()
> got an unexpected keyword argument 'prepopulate_from'


See:

http://code.djangoproject.com/wiki/BackwardsIncompatibleChanges#Mergednewforms-adminintotrunk

Specifically, the "Changed prepopulate_from to be defined in the Admin  
class, not database field classes" section.

---
David Zhou
[EMAIL PROTECTED]




--~--~-~--~~~---~--~~
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: verbose_name_plural not working in the admin?

2008-09-09 Thread Karen Tracey
On Tue, Sep 9, 2008 at 11:32 AM, Paolo Corti <[EMAIL PROTECTED]> wrote:

>
> Hi
>
> here is a sample class:
>
> class TipoMisura(models.Model):
>nome = models.CharField('nome', max_length=255, null=True)
>
>class Meta:
>verbose_name = "Tipo di Misura"
>verbose_name_plural = "Tipo di Misure"
>
> In the admin interface, the link to the change page is displayed as
> "Tipo di Misuras".
> Is it a bug or am i missing something?
>
>
If I cut and paste your model definition into a test project, syncdb and
bring up the admin index page, the link to the change list for this model is
displayed as "Tipo di Misure".  So, there must be something outside of what
you've shared with us here that is affecting what is happening in your
case.  I have no idea what, though.

Karen

--~--~-~--~~~---~--~~
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: Apache httpd conf with mod_python

2008-09-09 Thread mccomas . chris

i'm really at a loss.

mod_python and django are both installed under python2.4. SELinux is
disabled. the standard permissions for the django_projects folder is
775. everything validates. i can run python at the command line and
import the settings, etc.

On Sep 9, 11:02 am, [EMAIL PROTECTED] wrote:
> thnx. i did test it with the development server and it is working,
> i've also tried putting up the generic settings.py that is created
> when you first start a project.
>
> On Sep 9, 10:02 am, "Karen Tracey" <[EMAIL PROTECTED]> wrote:
>
> > On Tue, Sep 9, 2008 at 9:21 AM, <[EMAIL PROTECTED]> wrote:
>
> > > Karen,
>
> > > There is a SELinux kernel, but it is set to disabled.
>
> > All I can say is the error you are getting, combined with the config you
> > have shown, means that either Apache cannot read the file:
>
> > /home/chris/web/django_project/ucwv/settings.py
>
> > or is getting an error tying to import it.  Since I'd guess you've tested
> > outside of the Apache environment to ensure that settings.py has no syntax
> > errors, I'd suspect Apache cannot read the file.  Fix that and I believe
> > things will start working.
>
> > Karen
>
> > > On Sep 9, 8:50 am, "Karen Tracey" <[EMAIL PROTECTED]> wrote:
> > > > On Tue, Sep 9, 2008 at 8:44 AM, <[EMAIL PROTECTED]> wrote:
>
> > > > > Karen,
>
> > > > > the permissions for the main directory web, and all of the
> > > > > subdirectories is 775.
>
> > > > And you're not running on some system with an SELinux (e.g.) kernel that
> > > > uses an access rights structure outside of the basic permissions bits?
>
> > > > Karen
>
> > > > > On Sep 9, 8:29 am, "Karen Tracey" <[EMAIL PROTECTED]> wrote:
> > > > > > On Tue, Sep 9, 2008 at 8:05 AM, <[EMAIL PROTECTED]> wrote:
>
> > > > > > > thnx, i've figured it out. the issue i'm having now is with my
> > > django
> > > > > > > requirements in it:
>
> > > > > > > 
> > > > > > >    SetHandler python-program
> > > > > > >    PythonPath "['/home/chris/web/django_project'] + sys.path"
> > > > > > >    PythonHandler django.core.handlers.modpython
> > > > > > >    SetEnv DJANGO_SETTINGS_MODULE ucwv.settings
> > > > > > >    PythonDebug On
> > > > > > > 
>
> > > > > > > 
> > > > > > >    SetHandler None
> > > > > > > 
>
> > > > > > > 
> > > > > > >    SetHandler None
> > > > > > > 
>
> > > > > > > in /django_project/ is my project ucwv. i'm getting this error:
>
> > > > > > > Mod_python error: "PythonHandler django.core.handlers.modpython"
>
> > > > > > > Traceback (most recent call last):
>
> > > > > > > [snipped]
> > > > > > > ImportError: Could not import settings 'ucwv.settings' (Is it on
> > > > > > > sys.path? Does it have syntax errors?): No module named
> > > ucwv.settings
>
> > > > > > Does the user Apache is running as have read access to
> > > > > > '/home/chris/web/django_project' and your project directories
> > > underneath
> > > > > > there?
>
> > > > > > Karen
--~--~-~--~~~---~--~~
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 do I befriend a user in the User class?

2008-09-09 Thread bruno desthuilliers



On 9 sep, 14:56, coan <[EMAIL PROTECTED]> wrote:
> I want to add a recursive relationship to the built-in User model - to
> store relationships between users. Are there any (non-hairy) ways to
> do this?

# friends/models.py
from django.db import models
from django.contribs.auth.models import User

class Friendship(models.Model):
user1 = models.ForeignKey(User)
user2 = models.ForeignKey(User)

Adding a unique_together(user1, user2) constraint might be usefull, as
well as some validation code in save() to avoid user1 == user2.


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Internal server error upgarding from 0.97 to 1.0

2008-09-09 Thread Haku

Hello, i'm quite frustrated by this problem.
Today i had the  idea to update my svn from the old 0.97 to the 1.0
release, and now nothing is working anymore.

I always get an anonymous "Internal Server Error"
Maybe because my project included mptt, but the fact is that i cant
figure out why it is crashing. Seems like it's the slug fields but i
don't really know.

Is there a solution? Or maybe, how can i return to my loved 0.97
version?

Sorry for the dumb questions and the bad english!

--- IF THIS CAN HELP, THIS IS THE ERRORS I GET FROM THE LOG FILE
[Tue Sep 09 19:35:43 2008] [error] [client 192.168.0.101]
PythonHandler django.core.handlers.modpython: Traceback (most recent
call last):
[Tue Sep 09 19:35:43 2008] [error] [client 192.168.0.101]
PythonHandler django.core.handlers.modpython:   File "/usr/lib/
python2.4/site-packages/mod_python/apache.py", line 299, in
HandlerDispatch\nresult = object(req)
[Tue Sep 09 19:35:43 2008] [error] [client 192.168.0.101]
PythonHandler django.core.handlers.modpython:   File "/usr/lib/
python2.4/site-packages/django/core/handlers/modpython.py", line 222,
in handler\nreturn ModPythonHandler()(req)
[Tue Sep 09 19:35:43 2008] [error] [client 192.168.0.101]
PythonHandler django.core.handlers.modpython:   File "/usr/lib/
python2.4/site-packages/django/core/handlers/modpython.py", line 195,
in __call__\nresponse = self.get_response(request)
[Tue Sep 09 19:35:43 2008] [error] [client 192.168.0.101]
PythonHandler django.core.handlers.modpython:   File "/usr/lib/
python2.4/site-packages/django/core/handlers/base.py", line 67, in
get_response\nresponse = middleware_method(request)
[Tue Sep 09 19:35:43 2008] [error] [client 192.168.0.101]
PythonHandler django.core.handlers.modpython:   File "/home/django/
intranet_pini/../intranet_pini/middleware/threadlocals.py", line 12,
in process_request\n_thread_locals.user = getattr(request, 'user',
None)
[Tue Sep 09 19:35:43 2008] [error] [client 192.168.0.101]
PythonHandler django.core.handlers.modpython:   File "/usr/lib/
python2.4/site-packages/django/contrib/auth/middleware.py", line 5, in
__get__\nrequest._cached_user = get_user(request)
[Tue Sep 09 19:35:43 2008] [error] [client 192.168.0.101]
PythonHandler django.core.handlers.modpython:   File "/usr/lib/
python2.4/site-packages/django/contrib/auth/__init__.py", line 83, in
get_user\nuser_id = request.session[SESSION_KEY]
[Tue Sep 09 19:35:43 2008] [error] [client 192.168.0.101]
PythonHandler django.core.handlers.modpython:   File "/usr/lib/
python2.4/site-packages/django/contrib/sessions/backends/base.py",
line 46, in __getitem__\nreturn self._session[key]
[Tue Sep 09 19:35:43 2008] [error] [client 192.168.0.101]
PythonHandler django.core.handlers.modpython:   File "/usr/lib/
python2.4/site-packages/django/contrib/sessions/backends/base.py",
line 172, in _get_session\nself._session_cache = self.load()
[Tue Sep 09 19:35:43 2008] [error] [client 192.168.0.101]
PythonHandler django.core.handlers.modpython:   File "/usr/lib/
python2.4/site-packages/django/contrib/sessions/backends/db.py", line
16, in load\nexpire_date__gt=datetime.datetime.now()
[Tue Sep 09 19:35:43 2008] [error] [client 192.168.0.101]
PythonHandler django.core.handlers.modpython:   File "/usr/lib/
python2.4/site-packages/django/db/models/manager.py", line 93, in get
\nreturn self.get_query_set().get(*args, **kwargs)
[Tue Sep 09 19:35:43 2008] [error] [client 192.168.0.101]
PythonHandler django.core.handlers.modpython:   File "/usr/lib/
python2.4/site-packages/django/db/models/query.py", line 297, in get
\nclone = self.filter(*args, **kwargs)
[Tue Sep 09 19:35:43 2008] [error] [client 192.168.0.101]
PythonHandler django.core.handlers.modpython:   File "/usr/lib/
python2.4/site-packages/django/db/models/query.py", line 483, in filter
\nreturn self._filter_or_exclude(False, *args, **kwargs)
[Tue Sep 09 19:35:43 2008] [error] [client 192.168.0.101]
PythonHandler django.core.handlers.modpython:   File "/usr/lib/
python2.4/site-packages/django/db/models/query.py", line 501, in
_filter_or_exclude\nclone.query.add_q(Q(*args, **kwargs))
[Tue Sep 09 19:35:43 2008] [error] [client 192.168.0.101]
PythonHandler django.core.handlers.modpython:   File "/usr/lib/
python2.4/site-packages/django/db/models/sql/query.py", line 1224, in
add_q\ncan_reuse=used_aliases)
[Tue Sep 09 19:35:43 2008] [error] [client 192.168.0.101]
PythonHandler django.core.handlers.modpython:   File "/usr/lib/
python2.4/site-packages/django/db/models/sql/query.py", line 1099, in
add_filter\nnegate=negate, process_extras=process_extras)
[Tue Sep 09 19:35:43 2008] [error] [client 192.168.0.101]
PythonHandler django.core.handlers.modpython:   File "/usr/lib/
python2.4/site-packages/django/db/models/sql/query.py", line 1275, in
setup_joins\nfield, model, direct, m2m =
opts.get_field_by_name(name)
[Tue Sep 09 19:35:43 2008] [error] [client 192.168.0.101]
PythonHandler django.core.handlers.modpython: 

verbose_name_plural not working in the admin?

2008-09-09 Thread Paolo Corti

Hi

here is a sample class:

class TipoMisura(models.Model):
nome = models.CharField('nome', max_length=255, null=True)

class Meta:
verbose_name = "Tipo di Misura"
verbose_name_plural = "Tipo di Misure"

In the admin interface, the link to the change page is displayed as
"Tipo di Misuras".
Is it a bug or am i missing something?

thanks in advance
Paolo

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



How to initialize data into an extra form of a formset_factory?

2008-09-09 Thread bhunter

I'd like to pre-populate one of the data elements of the extra_form of
a formset factory with a string, and it's not clear to me how to do
this from the documentation, since formset_factory does not take
initial as an argument.

Here's an example:

class FavoriteSearch(models.Model):
   search= models.CharField(max_length=128)
   user  = models.ForeignKey(Employee)

from django.forms.models import inlineformset_factory
SomeFormset =inlineformset_factory(User, FavoriteSearch, extra=1)
...
formset = SomeFormset(instance=some_user)

Having done this, I can access the extra form with this:
formset.extra_forms[0]

And I can access the BoundField in the widget created for the search
field like this:
formset.extra_forms[0]['search']

But how can I populate that with some initial data for the user?

Thanks for your help!

--~--~-~--~~~---~--~~
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: Apache httpd conf with mod_python

2008-09-09 Thread mccomas . chris

thnx. i did test it with the development server and it is working,
i've also tried putting up the generic settings.py that is created
when you first start a project.

On Sep 9, 10:02 am, "Karen Tracey" <[EMAIL PROTECTED]> wrote:
> On Tue, Sep 9, 2008 at 9:21 AM, <[EMAIL PROTECTED]> wrote:
>
> > Karen,
>
> > There is a SELinux kernel, but it is set to disabled.
>
> All I can say is the error you are getting, combined with the config you
> have shown, means that either Apache cannot read the file:
>
> /home/chris/web/django_project/ucwv/settings.py
>
> or is getting an error tying to import it.  Since I'd guess you've tested
> outside of the Apache environment to ensure that settings.py has no syntax
> errors, I'd suspect Apache cannot read the file.  Fix that and I believe
> things will start working.
>
> Karen
>
>
>
> > On Sep 9, 8:50 am, "Karen Tracey" <[EMAIL PROTECTED]> wrote:
> > > On Tue, Sep 9, 2008 at 8:44 AM, <[EMAIL PROTECTED]> wrote:
>
> > > > Karen,
>
> > > > the permissions for the main directory web, and all of the
> > > > subdirectories is 775.
>
> > > And you're not running on some system with an SELinux (e.g.) kernel that
> > > uses an access rights structure outside of the basic permissions bits?
>
> > > Karen
>
> > > > On Sep 9, 8:29 am, "Karen Tracey" <[EMAIL PROTECTED]> wrote:
> > > > > On Tue, Sep 9, 2008 at 8:05 AM, <[EMAIL PROTECTED]> wrote:
>
> > > > > > thnx, i've figured it out. the issue i'm having now is with my
> > django
> > > > > > requirements in it:
>
> > > > > > 
> > > > > >    SetHandler python-program
> > > > > >    PythonPath "['/home/chris/web/django_project'] + sys.path"
> > > > > >    PythonHandler django.core.handlers.modpython
> > > > > >    SetEnv DJANGO_SETTINGS_MODULE ucwv.settings
> > > > > >    PythonDebug On
> > > > > > 
>
> > > > > > 
> > > > > >    SetHandler None
> > > > > > 
>
> > > > > > 
> > > > > >    SetHandler None
> > > > > > 
>
> > > > > > in /django_project/ is my project ucwv. i'm getting this error:
>
> > > > > > Mod_python error: "PythonHandler django.core.handlers.modpython"
>
> > > > > > Traceback (most recent call last):
>
> > > > > > [snipped]
> > > > > > ImportError: Could not import settings 'ucwv.settings' (Is it on
> > > > > > sys.path? Does it have syntax errors?): No module named
> > ucwv.settings
>
> > > > > Does the user Apache is running as have read access to
> > > > > '/home/chris/web/django_project' and your project directories
> > underneath
> > > > > there?
>
> > > > > Karen
--~--~-~--~~~---~--~~
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 Evolution

2008-09-09 Thread Russell Keith-Magee

On Tue, Sep 9, 2008 at 6:25 PM, Greig Rapley <[EMAIL PROTECTED]> wrote:
>
> After upgrading to Django 1.0 I am having trouble getting django
> evolution (svn) to work.  I have looked on their site, and applied one
> of the patches made available (for ImageField), but still no luck.  I
> found a post dated September 2 from Keith saying he would update the
> project within a week, so I understand things will be upgraded
> shortly.

Firstly, I presume you're talking about me - Russell. I have no idea
who Keith is.

Secondly, this is probably a question better suited to the Django
Evolution mailing list.

However, that said:

I have updated Django Evolution to be compatible with Django v1.0.
However, as you have noted, there is a problem with ImageField (and
FileField) migrations if you have a project that was using Django
Evolution prior to r8244, updating Django Evolution will cause some
problems.

Ticket #72 on the Django Evolution repository [1] contains a patch
that can be used as a workaround. This should get you over the hump
you are currently stuck on.

I haven't applied this patch because I am trying to avoid hard coding
the eccentricities of individual Django revisions into the Evolution
core itself; however, in conversations I had with Christian Hammond
during Djangocon, it became apparent that this may not be an
achievable goal.

The longer term goal is to provide a baked-in way to overcome these
changes in Django itself.

> My question is, can I remove django_evolution from settings.py, apply
> the change I need right now manually, and then when django evolution
> is running happily against 1.0, somehow baseline and start again ?
> Should I delete the django_evolution table from the database before re-
> enabling django_evolution in settings.py ?  I don't mind losing the
> migration history and starting again, I just want to know that if I go
> manual updates for now, I can somehow re-baseline or start again,
> because I find it very useful.

The re-baseline command is the subject of ticket #65 [2]. It is fairly
high on my list of Django Evolution priorities; I just need to get
some downtime to work on it (or, alternatively, if it is important to
you, submit a patch and it will get priority inclusion).

I haven't tried your 'manual rebaselining' approaches, but my gut
reaction is that it should work. Dropping the tables themselves means
that any historical signatures (such as the signature that is
currently causing difficulty) will also be removed. If you don't care
about losing history, simply dropping the existing evolution tables
should be sufficient to reset the evolution chains using new
signatures. At the time you run syncdb, all the historical stored
evolutions will be marked as applied.

[1] http://code.google.com/p/django-evolution/issues/detail?id=72
[2] http://code.google.com/p/django-evolution/issues/detail?id=65

Yours,
Russ Magee %-)

--~--~-~--~~~---~--~~
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: reverse not working with (r'^comments/(.*)', include('django.contrib.comments.urls')),

2008-09-09 Thread felix


ah, got it. thanks malcolm !

just to think it out further :

now I understand that

(r'^something/(?P[-\w]+)/', include('some.where.urls')),

would pass the captured param to to all the urls in the included
urls.py

I think I was copying from this:
# Uncomment the next line for to enable the admin:
(r'^admin/(.*)', admin.site.root),

and in that case the rest of the url is passed into the AdminSite.root
function :

def root(self, request, url):


I've had the most hold-ups so far due to configuring the urls.
named urls has helped significantly.



On Sep 8, 7:23 pm, Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:
> On Sun, 2008-09-07 at 06:18 -0700, felix wrote:
> > This should be dirt simple, but isn't working:
>
> > main urls.py :
> >  (r'^comments/(.*)', include('django.contrib.comments.urls')),
>
> This pattern says you want to *capture* anything after the "comments/"
> piece. So calling reverse with no parameters won't match this (you must
> pass the correct parameters for the capturing groups). Maybe you don't
> really want to capture that, in which case you could write either
>
>         ^comments/.*
>
> or
>
>         ^comments/(?:.*)
>
> The former would be obviously shorter.
>
> 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 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: When can you call urlresolvers.reverse()?

2008-09-09 Thread Thomas Guettler

Hi,

current reverse() should not be called during import time. AFAIK since
this results into recursive imports:

http://code.djangoproject.com/ticket/5925

The ticket contains a way around this problem:
{{{

# file lazy.py
from django.core import urlresolvers

class lazy_string(object):
def __init__(self, function, *args, **kwargs):
self.function=function
self.args=args
self.kwargs=kwargs

def __str__(self):
if not hasattr(self, 'str'):
self.str=self.function(*self.args, **self.kwargs)
return self.str

def reverse(*args, **kwargs):
return lazy_string(urlresolvers.reverse, *args, **kwargs)


}}}

from lazy import reverse

instead of

from django.core.urlresovlers import reverse

HTH,
  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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: ANN: Updated Django Cheat Sheet

2008-09-09 Thread dusans

Tnx, make a black/white version :)

On Sep 4, 12:09 pm, Fraser Nevett <[EMAIL PROTECTED]> wrote:
> With the release of Django 1.0, we're pleased to announce the release
> of a completely updated version of our highly popular Django Cheat
> Sheet which is crammed with a whole host of useful Django information:
>
> http://www.mercurytide.co.uk/whitepapers/django-cheat-sheet/
>
> We welcome any ideas for improvements, corrections, or any other
> feedback.
>
> On behalf of everyone here at Mercurytide, I'd like to offer our
> sincere thanks to all those who have contributed to Django, and
> especially to the core devs for all their effort. It's been a long
> time coming, but everyone's hard work has made Django a truly awesome
> framework.
>
> Fraser

--~--~-~--~~~---~--~~
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: Apache httpd conf with mod_python

2008-09-09 Thread Karen Tracey
On Tue, Sep 9, 2008 at 9:21 AM, <[EMAIL PROTECTED]> wrote:

>
> Karen,
>
> There is a SELinux kernel, but it is set to disabled.
>

All I can say is the error you are getting, combined with the config you
have shown, means that either Apache cannot read the file:

/home/chris/web/django_project/ucwv/settings.py

or is getting an error tying to import it.  Since I'd guess you've tested
outside of the Apache environment to ensure that settings.py has no syntax
errors, I'd suspect Apache cannot read the file.  Fix that and I believe
things will start working.

Karen


>
> On Sep 9, 8:50 am, "Karen Tracey" <[EMAIL PROTECTED]> wrote:
> > On Tue, Sep 9, 2008 at 8:44 AM, <[EMAIL PROTECTED]> wrote:
> >
> > > Karen,
> >
> > > the permissions for the main directory web, and all of the
> > > subdirectories is 775.
> >
> > And you're not running on some system with an SELinux (e.g.) kernel that
> > uses an access rights structure outside of the basic permissions bits?
> >
> > Karen
> >
> >
> >
> > > On Sep 9, 8:29 am, "Karen Tracey" <[EMAIL PROTECTED]> wrote:
> > > > On Tue, Sep 9, 2008 at 8:05 AM, <[EMAIL PROTECTED]> wrote:
> >
> > > > > thnx, i've figured it out. the issue i'm having now is with my
> django
> > > > > requirements in it:
> >
> > > > > 
> > > > >SetHandler python-program
> > > > >PythonPath "['/home/chris/web/django_project'] + sys.path"
> > > > >PythonHandler django.core.handlers.modpython
> > > > >SetEnv DJANGO_SETTINGS_MODULE ucwv.settings
> > > > >PythonDebug On
> > > > > 
> >
> > > > > 
> > > > >SetHandler None
> > > > > 
> >
> > > > > 
> > > > >SetHandler None
> > > > > 
> >
> > > > > in /django_project/ is my project ucwv. i'm getting this error:
> >
> > > > > Mod_python error: "PythonHandler django.core.handlers.modpython"
> >
> > > > > Traceback (most recent call last):
> >
> > > > > [snipped]
> > > > > ImportError: Could not import settings 'ucwv.settings' (Is it on
> > > > > sys.path? Does it have syntax errors?): No module named
> ucwv.settings
> >
> > > > Does the user Apache is running as have read access to
> > > > '/home/chris/web/django_project' and your project directories
> underneath
> > > > there?
> >
> > > > Karen
> >
>

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Validating ImageField width and height in admin site

2008-09-09 Thread Nick

Hi,

I'm looking to validate my ImageField images in the admin site.  If
they are a specific size, then the whole record will save - if they
are not, then the user will be returned to the form with a validation
error message.

I've seen get_image_dimensions, but I'm not sure how this would be
used within the save method to prevent the record from saving if the
image size were incorrect.

Any help would be very much appreciated :)

Thanks,
Nick
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



When can you call urlresolvers.reverse()?

2008-09-09 Thread Gremmie

I ran into a problem this weekend, and I think I sort of understand
why it was happening, but I would like some experts to check my
reasoning :-).

I wanted to add some help_text to a form field that included a link to
another page of mine. I had something like this (from memory):

class RegisterForm(forms.Form):
   agree_tos = forms.BooleanField(required = True, label = 'I agree to
the Terms of Service',
  help_text = 'Please see our TOS')

This produced a nice help text link that worked, but unfortunately it
had the side effect of the django development server not being able to
find an unrelated view, but only sporadically. What would happen was I
would make a code change somewhere else, then visit a page, and I
would get some kind of django error about an unrelated view not being
found. I would shrug, and hit reload on the browser, and it would
work. Then it would come up again later. Reload, and it would work.

Eventually (!!!) I narrowed the problem down to that help_text line of
code, and I removed it. All was stable again.

I am new to Python, but now I am starting to have a hunch that because
that code is where it is, it may be executing before all of the URL
resolution magic has finished. I'm coming from the C++ world, and I
used to think of that code in the class body as a "kind of"
constructor, but really it is not. It runs when the class definition
is being processed, unrelated to object instance creation. Perhaps if
I had put that "agree_tos = ... " code inside an __init__ function for
the form, it would run when a form instance was being created, and by
then all the URL magic had been processed.

Run this python script to see what I mean:

class Test:
   print "Test"   # this is analogous to where I was calling reverse()

   def __init__(self):
  print "Test __init__"

print "hello"
x = Test()

The output is:

Test
hello
Test __init__

It was very revealing (to me) to see "Test" come out before hello. I
went back to some Python books and learned that this was the correct
expected behavior.

Is this related to the issue I was having? By running reverse() inside
the class like that, was that catching django in a not completely
initialized state? Would creating the agree_tos Boolean field
attribute in an __init__ function have worked? Thanks for any insights.
--~--~-~--~~~---~--~~
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: What do you use as a build tool (like Ant or make)

2008-09-09 Thread Adam Stein

I'm not doing unit tests at the moment, but for build and release I use
Waf (http://code.google.com/p/waf/), which happens to be written in
Python (including the configuration files).


On Tue, 2008-09-09 at 01:14 -0700, ristretto.rb wrote:
> Hello,
> 
> What do you use to build a Django project?  By build I mean,
> 
> *  run unit tests
> *  copy files to a distribution set based on a target (production,
> staging, clustered, etc.)
>   * include config files specific to the target, and not including
> source control files and other development
> time artifacts.
> *  transfer distribution
> 
> Perhaps you just hand build python scripts to do it.  Or do you use
> Ant or make?  I'm coming over from Java, and used to use Ant, but I'm
> migrating over to Python and would like to use what is generally
> considered the Pythonic way.
> 
> cheers
> 
> -- 
Adam Stein @ Xerox Corporation   Email: [EMAIL PROTECTED]

Disclaimer: Any/All views expressed
here have been proven to be my own.  [http://www.csh.rit.edu/~adam/]


--~--~-~--~~~---~--~~
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: Apache httpd conf with mod_python

2008-09-09 Thread mccomas . chris

Karen,

There is a SELinux kernel, but it is set to disabled.

On Sep 9, 8:50 am, "Karen Tracey" <[EMAIL PROTECTED]> wrote:
> On Tue, Sep 9, 2008 at 8:44 AM, <[EMAIL PROTECTED]> wrote:
>
> > Karen,
>
> > the permissions for the main directory web, and all of the
> > subdirectories is 775.
>
> And you're not running on some system with an SELinux (e.g.) kernel that
> uses an access rights structure outside of the basic permissions bits?
>
> Karen
>
>
>
> > On Sep 9, 8:29 am, "Karen Tracey" <[EMAIL PROTECTED]> wrote:
> > > On Tue, Sep 9, 2008 at 8:05 AM, <[EMAIL PROTECTED]> wrote:
>
> > > > thnx, i've figured it out. the issue i'm having now is with my django
> > > > requirements in it:
>
> > > > 
> > > >    SetHandler python-program
> > > >    PythonPath "['/home/chris/web/django_project'] + sys.path"
> > > >    PythonHandler django.core.handlers.modpython
> > > >    SetEnv DJANGO_SETTINGS_MODULE ucwv.settings
> > > >    PythonDebug On
> > > > 
>
> > > > 
> > > >    SetHandler None
> > > > 
>
> > > > 
> > > >    SetHandler None
> > > > 
>
> > > > in /django_project/ is my project ucwv. i'm getting this error:
>
> > > > Mod_python error: "PythonHandler django.core.handlers.modpython"
>
> > > > Traceback (most recent call last):
>
> > > > [snipped]
> > > > ImportError: Could not import settings 'ucwv.settings' (Is it on
> > > > sys.path? Does it have syntax errors?): No module named ucwv.settings
>
> > > Does the user Apache is running as have read access to
> > > '/home/chris/web/django_project' and your project directories underneath
> > > there?
>
> > > Karen
--~--~-~--~~~---~--~~
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: Unicode decode errors with Admin and Postgres

2008-09-09 Thread Paolo Corti



On 1 Set, 18:48, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote:
> On Mon, 2008-09-01 at 08:37 -0700, PaoloCortiwrote:
> > Hi all
>
> > I am a beginner using Django from the trunk and Postgres 8.2
>
> > I have this issue with utf8, you can replicate it this way (it is
> > something similiar to this with MySql i guess:
> >http://groups.google.com/group/django-users/browse_frm/thread/d7dd214...)
>
> > 1) create a postgres db like this:
>
> > CREATE DATABASE test2
> >   WITH ENCODING='UTF8'
> >        OWNER=test;
>
> > 2) create a django project
>
> > django-admin.py startproject testutf
>
> > 3) configure the settings.py file for the database access and enable
> > the admin application
>
> > 4) create a test application
>
> > python manage.py startapp apptestutf
>
> > 5) create this simple model
>
> > from django.db import models
>
> > class Person(models.Model):
> >    name = models.CharField('name', max_length=100)
>
> >    def __str__(self):
> >            return '%s' % self.name
>
> So as soon as you see UnicodeDecodeError, you should immediately think
> "where am I passing a unicode object to something that can only handle
> bytestrings." The __str__ method is certainly one of those cases.
>
> Best to follow the Django documentation here and write a __unicode__
> method for your model (not a __str__ method). Refer to the first two
> sections here (or the /unicode documentation) for 
> details:http://www.djangoproject.com/documentation/model-api/#str
>
> And, yes, those sections are arguably backwards, since it explains
> __str__ and then effectively says "don't bother doing that" in a
> confusing fashion. That will be fixed at some point.
>
> Regards,
> Malcolm

Thanks Malcolm
it makes sense and is working now

Paolo

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



How do I befriend a user in the User class?

2008-09-09 Thread coan


I want to add a recursive relationship to the built-in User model - to
store relationships between users. Are there any (non-hairy) ways to
do this?
--~--~-~--~~~---~--~~
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: Apache httpd conf with mod_python

2008-09-09 Thread Karen Tracey
On Tue, Sep 9, 2008 at 8:44 AM, <[EMAIL PROTECTED]> wrote:

>
> Karen,
>
> the permissions for the main directory web, and all of the
> subdirectories is 775.
>

And you're not running on some system with an SELinux (e.g.) kernel that
uses an access rights structure outside of the basic permissions bits?

Karen


>
> On Sep 9, 8:29 am, "Karen Tracey" <[EMAIL PROTECTED]> wrote:
> > On Tue, Sep 9, 2008 at 8:05 AM, <[EMAIL PROTECTED]> wrote:
> >
> > > thnx, i've figured it out. the issue i'm having now is with my django
> > > requirements in it:
> >
> > > 
> > >SetHandler python-program
> > >PythonPath "['/home/chris/web/django_project'] + sys.path"
> > >PythonHandler django.core.handlers.modpython
> > >SetEnv DJANGO_SETTINGS_MODULE ucwv.settings
> > >PythonDebug On
> > > 
> >
> > > 
> > >SetHandler None
> > > 
> >
> > > 
> > >SetHandler None
> > > 
> >
> > > in /django_project/ is my project ucwv. i'm getting this error:
> >
> > > Mod_python error: "PythonHandler django.core.handlers.modpython"
> >
> > > Traceback (most recent call last):
> >
> > > [snipped]
> > > ImportError: Could not import settings 'ucwv.settings' (Is it on
> > > sys.path? Does it have syntax errors?): No module named ucwv.settings
> >
> > Does the user Apache is running as have read access to
> > '/home/chris/web/django_project' and your project directories underneath
> > there?
> >
> > Karen
> >
>

--~--~-~--~~~---~--~~
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: Apache httpd conf with mod_python

2008-09-09 Thread mccomas . chris

Karen,

the permissions for the main directory web, and all of the
subdirectories is 775.

On Sep 9, 8:29 am, "Karen Tracey" <[EMAIL PROTECTED]> wrote:
> On Tue, Sep 9, 2008 at 8:05 AM, <[EMAIL PROTECTED]> wrote:
>
> > thnx, i've figured it out. the issue i'm having now is with my django
> > requirements in it:
>
> > 
> >    SetHandler python-program
> >    PythonPath "['/home/chris/web/django_project'] + sys.path"
> >    PythonHandler django.core.handlers.modpython
> >    SetEnv DJANGO_SETTINGS_MODULE ucwv.settings
> >    PythonDebug On
> > 
>
> > 
> >    SetHandler None
> > 
>
> > 
> >    SetHandler None
> > 
>
> > in /django_project/ is my project ucwv. i'm getting this error:
>
> > Mod_python error: "PythonHandler django.core.handlers.modpython"
>
> > Traceback (most recent call last):
>
> > [snipped]
> > ImportError: Could not import settings 'ucwv.settings' (Is it on
> > sys.path? Does it have syntax errors?): No module named ucwv.settings
>
> Does the user Apache is running as have read access to
> '/home/chris/web/django_project' and your project directories underneath
> there?
>
> Karen
--~--~-~--~~~---~--~~
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: Apache httpd conf with mod_python

2008-09-09 Thread mccomas . chris

it wasn't plural, i changed it to plural and then changed it in the
httpd.conf, restarted apache, and still no luck.

yes, ucwv is at /home/chris/web/django_projects/ucwv



On Sep 9, 8:35 am, [EMAIL PROTECTED] wrote:
> Ok, it could be that your PythonPath is wrong?
> /home/chris/web/django_project's' rather than the singular project.
> Does your ucwv sit @ /home/chris/web/django_projects/ucwv?
>
> Regards,
>
> Andy
>
> Karen Tracey wrote:
> > On Tue, Sep 9, 2008 at 8:05 AM, <[EMAIL PROTECTED]
> > > wrote:
>
> >     thnx, i've figured it out. the issue i'm having now is with my django
> >     requirements in it:
>
> >     
> >        SetHandler python-program
> >        PythonPath "['/home/chris/web/django_project'] + sys.path"
> >        PythonHandler django.core.handlers.modpython
> >        SetEnv DJANGO_SETTINGS_MODULE ucwv.settings
> >        PythonDebug On
> >     
>
> >     
> >        SetHandler None
> >     
>
> >     
> >        SetHandler None
> >     
>
> >     in /django_project/ is my project ucwv. i'm getting this error:
>
> >     Mod_python error: "PythonHandler django.core.handlers.modpython"
>
> >     Traceback (most recent call last):
>
> >     [snipped]
> >     ImportError: Could not import settings 'ucwv.settings' (Is it on
> >     sys.path? Does it have syntax errors?): No module named ucwv.settings
>
> > Does the user Apache is running as have read access to
> > '/home/chris/web/django_
> > project' and your project directories underneath there?
>
> > Karen
--~--~-~--~~~---~--~~
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: Apache httpd conf with mod_python

2008-09-09 Thread andylockran

Ok, it could be that your PythonPath is wrong? 
/home/chris/web/django_project's' rather than the singular project. 
Does your ucwv sit @ /home/chris/web/django_projects/ucwv?

Regards,

Andy

Karen Tracey wrote:
> On Tue, Sep 9, 2008 at 8:05 AM, <[EMAIL PROTECTED] 
> > wrote:
> 
> 
> thnx, i've figured it out. the issue i'm having now is with my django
> requirements in it:
> 
> 
>SetHandler python-program
>PythonPath "['/home/chris/web/django_project'] + sys.path"
>PythonHandler django.core.handlers.modpython
>SetEnv DJANGO_SETTINGS_MODULE ucwv.settings
>PythonDebug On
> 
> 
> 
>SetHandler None
> 
> 
> 
>SetHandler None
> 
> 
> in /django_project/ is my project ucwv. i'm getting this error:
> 
> Mod_python error: "PythonHandler django.core.handlers.modpython"
> 
> Traceback (most recent call last):
> 
> [snipped]
> ImportError: Could not import settings 'ucwv.settings' (Is it on
> sys.path? Does it have syntax errors?): No module named ucwv.settings
> 
> 
> Does the user Apache is running as have read access to 
> '/home/chris/web/django_
> project' and your project directories underneath there?
> 
> Karen
> 
> 
> > 


--~--~-~--~~~---~--~~
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: Apache httpd conf with mod_python

2008-09-09 Thread Karen Tracey
On Tue, Sep 9, 2008 at 8:05 AM, <[EMAIL PROTECTED]> wrote:

>
> thnx, i've figured it out. the issue i'm having now is with my django
> requirements in it:
>
> 
>SetHandler python-program
>PythonPath "['/home/chris/web/django_project'] + sys.path"
>PythonHandler django.core.handlers.modpython
>SetEnv DJANGO_SETTINGS_MODULE ucwv.settings
>PythonDebug On
> 
>
> 
>SetHandler None
> 
>
> 
>SetHandler None
> 
>
> in /django_project/ is my project ucwv. i'm getting this error:
>
> Mod_python error: "PythonHandler django.core.handlers.modpython"
>
> Traceback (most recent call last):
>
> [snipped]
> ImportError: Could not import settings 'ucwv.settings' (Is it on
> sys.path? Does it have syntax errors?): No module named ucwv.settings
>
>
Does the user Apache is running as have read access to
'/home/chris/web/django_project' and your project directories underneath
there?

Karen

--~--~-~--~~~---~--~~
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: Apache httpd conf with mod_python

2008-09-09 Thread mccomas . chris

thnx, i've figured it out. the issue i'm having now is with my django
requirements in it:


SetHandler python-program
PythonPath "['/home/chris/web/django_project'] + sys.path"
PythonHandler django.core.handlers.modpython
SetEnv DJANGO_SETTINGS_MODULE ucwv.settings
PythonDebug On



SetHandler None



SetHandler None


in /django_project/ is my project ucwv. i'm getting this error:

Mod_python error: "PythonHandler django.core.handlers.modpython"

Traceback (most recent call last):

  File "/usr/lib/python2.4/site-packages/mod_python/apache.py", line
299, in HandlerDispatch
result = object(req)

  File "/usr/lib/python2.4/site-packages/django/core/handlers/
modpython.py", line 222, in handler
return ModPythonHandler()(req)

  File "/usr/lib/python2.4/site-packages/django/core/handlers/
modpython.py", line 185, in __call__
self.load_middleware()

  File "/usr/lib/python2.4/site-packages/django/core/handlers/
base.py", line 31, in load_middleware
for middleware_path in settings.MIDDLEWARE_CLASSES:

  File "/usr/lib/python2.4/site-packages/django/conf/__init__.py",
line 28, in __getattr__
self._import_settings()

  File "/usr/lib/python2.4/site-packages/django/conf/__init__.py",
line 59, in _import_settings
self._target = Settings(settings_module)

  File "/usr/lib/python2.4/site-packages/django/conf/__init__.py",
line 94, in __init__
raise ImportError, "Could not import settings '%s' (Is it on
sys.path? Does it have syntax errors?): %s" % (self.SETTINGS_MODULE,
e)

ImportError: Could not import settings 'ucwv.settings' (Is it on
sys.path? Does it have syntax errors?): No module named ucwv.settings




On Sep 8, 5:48 pm, "Norman Harman" <[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] wrote:
> > Setting our Apache server at work, got everything installed. In the
> > httpd.conf there's quite a bit of content, do I need that content, or
> > should I just replace it with what I need for Django?
>
> You probably don't need all of it.  But I doubt anything will work if
> you get rid of all of it.  You need to add what Django requires.
>
> But, it sounds like you don't know/understand Apache conf files which
> you probably should.
>
> --
> Norman J. Harman Jr.
> Senior Web Specialist, Austin American-Statesman
> ___
> Get off the sidelines and huddle up with the Statesman all season long
> for complete high school, college and pro coverage in print and online!
--~--~-~--~~~---~--~~
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: Hierarchical Tagging

2008-09-09 Thread Nikolay Panov

You may check the following:
http://code.djangoproject.com/wiki/CookBookCategoryDataModel
http://code.google.com/p/django-categories/

Have a nice day,
   Nikolay.



On Tue, Sep 9, 2008 at 13:40, Thomas Guettler <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> django-tagging looks nice, but I need to have hierarchical tags:
>
>   animal / bird / eagle
>
> Any idea: Hack/Update django-tagging, create own, use 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: ANN: Updated Django Cheat Sheet

2008-09-09 Thread Vinay Sajip



On Sep 4, 6:46 pm, Fraser Nevett <[EMAIL PROTECTED]> wrote:
> Thanks for all the feedback both on list and via email.
>
> Our plan is to wait a day or two to see if there are any further
> corrections required and then to release an updated edition early next
> week. At this time we'll also produce a alternative version which will
> be more suited for non-colour printing.
>

Nice cheat sheet. Hope it's not too late to offer a suggestion - it
would be useful to have the forloop special variables in the cheat
sheet. Not sure where you'll find room, though ;-)

Regards,

Vinay Sajip
--~--~-~--~~~---~--~~
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 Evolution

2008-09-09 Thread Greig Rapley

After upgrading to Django 1.0 I am having trouble getting django
evolution (svn) to work.  I have looked on their site, and applied one
of the patches made available (for ImageField), but still no luck.  I
found a post dated September 2 from Keith saying he would update the
project within a week, so I understand things will be upgraded
shortly.

My question is, can I remove django_evolution from settings.py, apply
the change I need right now manually, and then when django evolution
is running happily against 1.0, somehow baseline and start again ?
Should I delete the django_evolution table from the database before re-
enabling django_evolution in settings.py ?  I don't mind losing the
migration history and starting again, I just want to know that if I go
manual updates for now, I can somehow re-baseline or start again,
because I find it very useful.

Thanks,
Greig


--~--~-~--~~~---~--~~
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: help me.... mysqld error

2008-09-09 Thread Funky

your /tmp is mounted as noexec,nosuid and so you get that error.
remount your /tmp as rw to fix the issue.

On Aug 3, 5:07 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> I use mod_python
> apache conf:
> 
>         ServerNamewww.test.cn
>         DocumentRoot /home/omanga/webroot
>         SetHandler python-program
>         PythonHandler django.core.handlers.modpython
>         PythonPath "['/home/project'] + sys.path"
>         SetEnv DJANGO_SETTINGS_MODULE test.settings
>         SetEnv PYTHON_EGG_CACHE /tmp
>         PythonDebug On
> 
> ~
>
>   File "/usr/local/lib/python2.5/site-packages/mod_python/
> importer.py", line 1128, in _execute_target
>     result = object(arg)
>
>   File "/usr/local/lib/python2.5/site-packages/django/core/handlers/
> modpython.py", line 177, in handler
>     return ModPythonHandler()(req)
>
>   File "/usr/local/lib/python2.5/site-packages/django/core/handlers/
> modpython.py", line 145, in __call__
>     self.load_middleware()
>
>   File "/usr/local/lib/python2.5/site-packages/django/core/handlers/
> base.py", line 29, in load_middleware
>     mod = __import__(mw_module, {}, {}, [''])
>
>   File "/usr/local/lib/python2.5/site-packages/django/contrib/sessions/
> middleware.py", line 2, in 
>     from django.contrib.sessions.models import Session
>
>   File "/usr/local/lib/python2.5/site-packages/django/contrib/sessions/
> models.py", line 3, in 
>     from django.db import models
>
>   File "/usr/local/lib/python2.5/site-packages/django/db/__init__.py",
> line 11, in 
>     backend = __import__('django.db.backends.%s.base' %
> settings.DATABASE_ENGINE, {}, {}, [''])
>
>   File "/usr/local/lib/python2.5/site-packages/django/db/backends/
> mysql/base.py", line 12, in 
>     raise ImproperlyConfigured, "Error loading MySQLdb module: %s" % e
>
> ImproperlyConfigured: Error loading MySQLdb module: /tmp/
> MySQL_python-1.2.2-py2.5-linux-i686.egg-tmp/_mysql.so: failed to map
> segment from shared object: Operation not permitted

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Hierarchical Tagging

2008-09-09 Thread Thomas Guettler

Hi,

django-tagging looks nice, but I need to have hierarchical tags:

   animal / bird / eagle

Any idea: Hack/Update django-tagging, create own, use 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: What do you use as a build tool (like Ant or make)

2008-09-09 Thread Christian Hoeppner

I've heard rumours about fabric (ask google, sorry can't remember url  
now).

~Chris

On 09/09/2008, at 9:14, ristretto.rb wrote:

>
> Hello,
>
> What do you use to build a Django project?  By build I mean,
>
> *  run unit tests
> *  copy files to a distribution set based on a target (production,
> staging, clustered, etc.)
>  * include config files specific to the target, and not including
> source control files and other development
> time artifacts.
> *  transfer distribution
>
> Perhaps you just hand build python scripts to do it.  Or do you use
> Ant or make?  I'm coming over from Java, and used to use Ant, but I'm
> migrating over to Python and would like to use what is generally
> considered the Pythonic way.
>
> cheers
>
> >


--~--~-~--~~~---~--~~
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: possible bug in django-admin

2008-09-09 Thread James Bennett

On Tue, Sep 9, 2008 at 4:15 AM, Benedict Verheyen
<[EMAIL PROTECTED]> wrote:
> i tried to do a django-admin startproject  and it
> said that startproject wasn't a valid command.
> Weird. django-admin help indeed didn't show the startproject command.

This is currently intended behavior and I believe it's now documented
as well; the "startproject" command is disabled when django-admin.py
detects that you already have and are working with an existing
project, because "startproject" doesn't really make sense in those
cases. Generally speaking, if you've set DJANGO_SETTINGS_MODULE or
pass the "--settings" argument, the command will be disabled.


-- 
"Bureaucrat Conrad, you are technically correct -- the best kind of correct."

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



possible bug in django-admin

2008-09-09 Thread Benedict Verheyen

Hi,

i tried to do a django-admin startproject  and it
said that startproject wasn't a valid command.
Weird. django-admin help indeed didn't show the startproject command.

Checked
/usr/lib/python2.4/site-packages/django/core/management/__init__.py

And in the get_commands function, there is a del statement now that
removes the startproject command.
...
if project_directory:
# Remove the "startproject" command from self.commands, because
# that's a django-admin.py command, not a manage.py command.
del _commands['startproject']
...
However, deleting the command makes it unavailable via django-admin.py

Regards,
Benedict


--~--~-~--~~~---~--~~
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: What do you use as a build tool (like Ant or make)

2008-09-09 Thread V

Hi,

there was a thread on the bazaar mailing list about continuous
integration systems for bazaar, it's not just a build tool, and not
django related, but it might worth a look:
https://lists.ubuntu.com/archives/bazaar/2008q3/046352.html

V

On Sep 9, 10:23 am, Jarek Zgoda <[EMAIL PROTECTED]> wrote:
> We use Paver (http://www.blueskyonmars.com/projects/paver/), but I am  
> far from being happy with it. Sometimes I just stick with Ant.
>
> Wiadomość napisana w dniu 2008-09-09, o godz. 10:14, przez ristretto.rb:
>
>
>
>
>
> > Hello,
>
> > What do you use to build a Django project?  By build I mean,
>
> > *  run unit tests
> > *  copy files to a distribution set based on a target (production,
> > staging, clustered, etc.)
> >  * include config files specific to the target, and not including
> > source control files and other development
> > time artifacts.
> > *  transfer distribution
>
> > Perhaps you just hand build python scripts to do it.  Or do you use
> > Ant or make?  I'm coming over from Java, and used to use Ant, but I'm
> > migrating over to Python and would like to use what is generally
> > considered the Pythonic way.
>
> > cheers
>
> --
> We read Knuth so you don't have to. - Tim Peters
>
> Jarek Zgoda, R, Redefine
> [EMAIL PROTECTED]
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



always rollback decorator

2008-09-09 Thread Thomas Guettler
Hi,

I try to write an always_rollback decorator like the commit_on_success 
one. I want
to use it to test a live system without changing it.

I use Postgres supports nested transaction by using savepoints.

Unfortunately I can't get it working: I try to use savepoints, but they 
get lost
as soon is the commit_on_success decorator sends COMMIT.

I guess I need to convert all commit_on_success decorators to
a new commit_on_success_unless_inside_transaction decorator.

Any idea how to solve this?

 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---

try:
from functools import wraps
except ImportError:
from django.utils.functional import wraps  # Python 2.3, 2.4 fallback.

# Django
from django.contrib.auth.models import User
from django.db import transaction

magic='this value should not persist'

def always_rollback(func):
"""
Based on commit_on_success of django
"""
def _always_rollback(*args, **kw):
try:
transaction.enter_transaction_management()
transaction.managed(True)
sid=transaction.savepoint()
try:
res = func(*args, **kw)
finally:
transaction.savepoint_rollback(sid)
transaction.rollback()
return res
finally:
transaction.leave_transaction_management()
return wraps(func)(_always_rollback)

@transaction.commit_on_success
def set_something():
user=User.objects.get(id=1)
user.first_name='this value should not persist'
user.save()

@always_rollback
def pretend_to_set():
set_something()

def main():
user=User.objects.get(id=1)
user.first_name='start'
user.save()
pretend_to_set()
user=User.objects.get(id=1)
if user.first_name=='start':
print 'always rollback succeeded'
elif user.first_name==magic:
print 'always rollback failed'
else:
raise Exception()

if __name__=='__main__':
main()






Re: What do you use as a build tool (like Ant or make)

2008-09-09 Thread Jarek Zgoda

We use Paver (http://www.blueskyonmars.com/projects/paver/), but I am  
far from being happy with it. Sometimes I just stick with Ant.

Wiadomość napisana w dniu 2008-09-09, o godz. 10:14, przez ristretto.rb:

>
> Hello,
>
> What do you use to build a Django project?  By build I mean,
>
> *  run unit tests
> *  copy files to a distribution set based on a target (production,
> staging, clustered, etc.)
>  * include config files specific to the target, and not including
> source control files and other development
> time artifacts.
> *  transfer distribution
>
> Perhaps you just hand build python scripts to do it.  Or do you use
> Ant or make?  I'm coming over from Java, and used to use Ant, but I'm
> migrating over to Python and would like to use what is generally
> considered the Pythonic way.
>
> cheers
>
> >

-- 
We read Knuth so you don't have to. - Tim Peters

Jarek Zgoda, R, Redefine
[EMAIL PROTECTED]


--~--~-~--~~~---~--~~
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: i18N with templates in separate directory

2008-09-09 Thread timc3

 > Shouldn't you run it from the mysite/ directory? Even further, now
that I think
> about it, you should can simplify things by simply manually
> creating the mysite/locale directory  and then doing
>
> mysite $ python manage.py makemesages -l se
>
> (just tested it and it works)

It works for me, but it doesn't use the templates. It just creates for
all the views, none of my templates have been seen.

> (manage.py is functionally equivalent to django-admin.py but
> it knows it should use the settings.py file located in the
> same directory).

Shouldn't it pick up the fact that I have configured:

LOCALE_PATHS = (
'/Volumes/Development/code/mysitetemplates',
)

> > And the django.po file has longer paths to everything.
>
> The paths in the PO file comments have no effect.
>

Ok I didn't know that.

Do I have to upgrade manage.py?
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



What do you use as a build tool (like Ant or make)

2008-09-09 Thread ristretto.rb

Hello,

What do you use to build a Django project?  By build I mean,

*  run unit tests
*  copy files to a distribution set based on a target (production,
staging, clustered, etc.)
  * include config files specific to the target, and not including
source control files and other development
time artifacts.
*  transfer distribution

Perhaps you just hand build python scripts to do it.  Or do you use
Ant or make?  I'm coming over from Java, and used to use Ant, but I'm
migrating over to Python and would like to use what is generally
considered the Pythonic way.

cheers

--~--~-~--~~~---~--~~
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: CRUD with forms from models usin ModelForm?

2008-09-09 Thread Daniel Roseman

On Sep 9, 4:47 am, "Efrain Valles" <[EMAIL PROTECTED]> wrote:
> Hello all,
>
> I have a basic question, I am currently adding new items using a form
> that is generated using ModelForms, I have html for the form I need
> using {{ form.as_table }} in the html. Now I am trying to do CRUD for
> data update and I was wondering if I could use the same form generated
> with ModelForms adding the values for the fields of a specific item.
> or do I have to do the form defining the class again and write the
> corresponding html code ?
>
> thanks in advance
>
> Efrain Valles

Just pass the model instance when instantiating the form to
prepopulate it with the values:
myinstance = MyModel.objects.get(pk=val)
form = MyModelForm(instance=myinstance)

and when you're saving the result:
form = MyModelForm(data=request.POST, instance=myinstance)
form.save()

See here:
http://docs.djangoproject.com/en/dev/topics/forms/modelforms/#the-save-method

--
DR.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---