Re: differences between runserver and apache

2008-01-20 Thread Graham Dumpleton

Post your Apache configuration snippet where you configure mod_python
for Django.

Post your full urls.py file.

Indicate the path to the directory containing the settings.py file so
we can see if it matches with what it is meant to be.

Graham

On Jan 21, 6:22 pm, Carl Karsten <[EMAIL PROTECTED]> wrote:
> I developed a site using ./mmanage.py runserver for testing.  I try to run it
> under apache and it errors.  I hear runserver adds things to sys.path 
> (installed
> apps) and when you run from apache that doesn't happen.  sure enough, I can 
> fix
> it by adding things to PythonPath.
>
> Now I am having 2 problems with
>      (r'^admin/', include('django.contrib.admin.urls')),
>
> 1. if I browse to mysite.com/admin it misses that and gets caught by
>       (r'', include('ridgemoor.core.urls')),
>
> 2, browse to mysite.com/admin/ get error:
>
> Tried new_message in module ridgemoor.core.views. Error was: 'module' object 
> has
> no attribute 'new_message'
>
> I have a feeling this is more pathing problems, but now it doesn't work from
> runserver either, which makes me think I broke something trying to fix the 
> path
> isues.
>
> So before I go 'fixing' more things, some sort of checklist describing what
> changes I need to make would be nice.  Anything like this exist?
>
> Carl K
>
> ps
>
> http://us.pycon.org/2008/registration/open for business.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



differences between runserver and apache

2008-01-20 Thread Carl Karsten

I developed a site using ./mmanage.py runserver for testing.  I try to run it 
under apache and it errors.  I hear runserver adds things to sys.path 
(installed 
apps) and when you run from apache that doesn't happen.  sure enough, I can fix 
it by adding things to PythonPath.

Now I am having 2 problems with
 (r'^admin/', include('django.contrib.admin.urls')),

1. if I browse to mysite.com/admin it misses that and gets caught by
  (r'', include('ridgemoor.core.urls')),

2, browse to mysite.com/admin/ get error:

Tried new_message in module ridgemoor.core.views. Error was: 'module' object 
has 
no attribute 'new_message'


I have a feeling this is more pathing problems, but now it doesn't work from 
runserver either, which makes me think I broke something trying to fix the path 
isues.

So before I go 'fixing' more things, some sort of checklist describing what 
changes I need to make would be nice.  Anything like this exist?

Carl K

ps

http://us.pycon.org/2008/registration/ open for business.

--~--~-~--~~~---~--~~
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: ImageFile not prepending MEDIA_ROOT onto upload_to folder location

2008-01-20 Thread Kenneth Gonsalves


On 21-Jan-08, at 11:37 AM, oak wrote:

> (upload_to="/albums"

upload_to="albums'  - no '/'

-- 

regards
kg
http://lawgon.livejournal.com
http://nrcfosshelpline.in/web/
Foss Conference for the common man: http://registration.fossconf.in/web/



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



ImageFile not prepending MEDIA_ROOT onto upload_to folder location

2008-01-20 Thread oak

For some reason when I upload files, they are getting put straight
into my c:/ root rather than the MEDIA_ROOT specified in the
setting.py.

ie.

If I have this in my model:

image = models.ImageField(upload_to="/albums",blank=True, null=True)

it will create a directory c:\albums and upload the files to this
directory.

The documentation says that the media root will be added on the front.
I could just do it manually but I want to know if it is a problem with
the code or something I am doing wrong.

If it hasn't become apparent, I am using windows.

Any ideas are appreciated =]


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



Passing form initial values from one view to another?

2008-01-20 Thread Dennis

Hi All,

In my application, I have a form with a choice field which populated
from the model using ModelChoiceField.  On the view I have a link
which takes the user to a view which lets them create a new model
object.  What I'd like to have happen after the successful creation is
redirect back to the original form with that new Model selected in the
ModelChoiceField.  Here's some sample code to give you an idea:

## URLs #
from django.conf.urls.defaults import *

urlpatterns = patterns(''
, (r'^create_context/$',
'django_apps.projApp.views.create_context')
, (r'^process/$', 'django_apps.projApp.views.process_task')
,
)

## TEMPLATE (this is process.html) ###

{{form.context.label_tag}} {{form.context}}



{{form.notes.label_tag}} {{form.notes}}
{{form.due_date.label_tag}} {{form.due_date}}



## VIEW (first the view for the template, above) ###
def process_task(request):
if request.method == 'POST':
form = ProcessForm(request.POST)
if form.is_valid():
# Do form processing here...
# todo: clean_data is legacy, will need to be changed to
cleaned_data in next release.
data = form.clean_data

t = Task.objects.create( context=data['context']
, due_date=data['due_date'] )
return
HttpResponseRedirect( request.META['HTTP_REFERER'] )
else:
form = ProcessForm()
return render_to_response('process.html', {'form': form})

## VIEW (for the create_context)  ###
def create_context( request ):
if request.method == 'POST':
form = CreateContextForm(request.POST)
if form.is_valid():
# Do form processing here...
# todo: clean_data is legacy, will need to be changed to
cleaned_data in next release.
data = form.clean_data

c = Context.objects.create(  name=data['name'] )
# return with defaults selected
processForm = ProcessForm(initial={'context':c.id })
return render_to_response('process.html', {'form':
processForm})
else:
form = CreateContextForm()
return render_to_response('create_projctx.html', {'form':
form})

This works from the standpoint of getting back to the "process.html"
template with the new Context object selected on the original form.
However, since this is using render_to_response instead of a redirect,
the URL on the user's browser still holds the "create_context"
location.  So, when the user hits "submit" on the process.html page,
the form gets sent back to the "create_context" view and things don't
operate as expected (another context gets created rather than
submitting to the "process_task" view)

The ideal way to do this would be to HttpResponseRedirect in place of
the "render_to_response" but this doesn't allow me to pass the form
object or any kind of dictionary representing the initial values.  Is
there a way to do this?  Or am I going about this in the wrong manner?

Thanks in advance for any words of wisdom!!
Lemme know if I can provide any additional code snips to help
highlight what I'm trying to do.
Dennis







--~--~-~--~~~---~--~~
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: Filtering with AND in a list

2008-01-20 Thread ocgstyles

Hi Julien,

The "in" filter translates to an SQL in clause, which in turns
simulates or functionality like you are experiencing.  The type of
clause you are looking for is similar to:

  where x=1 and x=2 and x=3

What I would try to do (and I'm a newbie with all this too) is
dynamically create a bunch of Q objects (http://www.djangoproject.com/
documentation/db-api/#complex-lookups-with-q-objects)

I think this may work haven't tested it.

from django.db.model import Q

def make_Q(the_list):
   q = None
   for x in the_list:
  q = q & Q(codes=x)
   return q

The to retrieve the objects:

Quote.objects.filter(make_Q(code_pk_list))

Hope that helps,

Keith


On Jan 20, 8:03 pm, Julien <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> Sorry if this has been asked before, but I could not find help in the
> search.
>
> Here's my code:
>
> class Code(models.Model):
> name = models.CharField(max_length=100)
>
> class Quote(models.Model):
> content = models.CharField(max_length=100)
> codes = models.ManyToManyField(Code, null=True, blank=True)
>
> I want to filter out a model by testing values in a list. If I use
> "__in" it seems to do a OR filter:
>
> quotes = Quote.objects.filter(codes__in = code_pk_list)
>
> By OR filter I mean that it returns any quote that has a code in the
> list...
>
> Rather I'd like a AND filter, that is something that only returns the
> objects that have at least ALL the values given in the list.
>
> Do you know how to do this?
>
> Many thanks,
>
> Julien
--~--~-~--~~~---~--~~
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 can't connect to postgresql

2008-01-20 Thread Kenneth Gonsalves


On 21-Jan-08, at 4:07 AM, LRP wrote:

> Psycopg2.Operational Error: FATAL Ident authentication failed for user
> 'webuser'

# TYPE  DATABASEUSERCIDR-ADDRESS  METHOD

# "local" is for Unix domain socket connections only
local   all all   trust
# IPv4 local connections:
hostall all 127.0.0.1/32  trust
# IPv6 local connections:
hostall all ::1/128   trust


-- 

regards
kg
http://lawgon.livejournal.com
http://nrcfosshelpline.in/web/
Foss Conference for the common man: http://registration.fossconf.in/web/



--~--~-~--~~~---~--~~
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: best practices for a production site

2008-01-20 Thread Kenneth Gonsalves


On 20-Jan-08, at 2:06 PM, Andrew wrote:

> This also may be a good time to consider a distributed version control
> system (Like bazaar or mercurial)... we're just about to finish
> porting to bazaar after running up to several situations just like
> yours.
>
> One benefit of DVCS is that branching is easier than SVN...making
> feature-level branches easier to intergrate into your workflow.

yes - I had my first experience of branching under svn and it was  
harrowing - some files just refused to get transferred to the branch

-- 

regards
kg
http://lawgon.livejournal.com
http://nrcfosshelpline.in/web/
Foss Conference for the common man: http://registration.fossconf.in/web/



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



Filtering with AND in a list

2008-01-20 Thread Julien

Hi all,

Sorry if this has been asked before, but I could not find help in the
search.

Here's my code:

class Code(models.Model):
name = models.CharField(max_length=100)

class Quote(models.Model):
content = models.CharField(max_length=100)
codes = models.ManyToManyField(Code, null=True, blank=True)

I want to filter out a model by testing values in a list. If I use
"__in" it seems to do a OR filter:

quotes = Quote.objects.filter(codes__in = code_pk_list)

By OR filter I mean that it returns any quote that has a code in the
list...

Rather I'd like a AND filter, that is something that only returns the
objects that have at least ALL the values given in the list.

Do you know how to do this?

Many thanks,

Julien
--~--~-~--~~~---~--~~
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: Another database for unit tests

2008-01-20 Thread Russell Keith-Magee

On Jan 20, 2008 2:13 PM, Jim Crossley <[EMAIL PROTECTED]> wrote:
>
> "James Bennett" <[EMAIL PROTECTED]> writes:
>
> > On Jan 19, 2008 10:24 PM, Jim Crossley <[EMAIL PROTECTED]> wrote:
> >> Yes, I knew I could override the NAME, but I'd like to override the
> >> ENGINE,USER,PASSWORD,HOST, and PORT, too.  Our settings are configured
> >> for mysql/innodb, to match our production environment.  But as our
> >> test suite and initial_data grows, it takes a frustratingly long time
> >> to run the tests.  I'd like to use the faster sqlite, but just for the
> >> tests.  Can you suggest an approach?
> >
> > Yes. Create another settings file, and in it put the following:
> >
> > from your_real_settings import *
> >
> > DATABASE_ENGINE = 'sqlite3'
> > DATABASE_HOST = '/some/filename/'
>
> So then I assume I must do something like this to run my tests?
>
> DJANGO_SETTINGS_MODULE=test.settings ./manage.py test

This would work. Another way would be :

./manage.py --settings=test.settings test

> Do you prefer that to having some kind of global variable indicating
> tests are being run that the normal settings file could query to know
> which db settings to use?  It seems the TEST_DATABASE_NAME goes
> partially in that direction -- why not go all the way?  :-)

There are many answers to this. Amongst them are:

1) Features: Using a test settings file means that you can customize
_everything_ about your test environment, not just your database
settings.

2) Documentation. Every extra setting is one more thing to document,
one more thing to explain, and one more opportunity to confuse a user.
 The TEST_DATABASE_NAME option exists for the simple case to avoid
name clashes when 'test_' + DATABASE_NAME isn't an available option.
Documenting the 'test settings file' option keeps the documentation
shorter, and therefore easier to explain. It is also a generic
solution - it can be used for other problems, not just testing - so we
can explain the general idea once, and then direct mulitple problems
at the single solution.

3) Maintenance. The TEST_* settings you propose would need to mirror
all the core database settings. This means that any modification to
the core settings (say, adding a new option) will need to be mirrored
in the test settings. This is something that could be easily
overlooked, which means you're introducing a point of weakness for
future developments.

4) Testing. Configuration complexity (as in the number of potential
configurations) increases exponentially as you add settings; this
increases the potential for clashing configurations, and therefore
increases the number of configurations that need to be tested.

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: Loading fixtures from views

2008-01-20 Thread Russell Keith-Magee

2008/1/21 Alex Koshelev <[EMAIL PROTECTED]>:
>
> Try this code:
>
> from django.core.management.commands.loaddata import Command
>
> def my_view( request, fixture_label1, fixture_label2 )
> Command().handle( fixture_label1, fixture_label2 )
> #...

While this will probably work, but the generally suggested invocation is:

from django.core import management

management.call_command('loaddata', 'fixture1.json', verbosity=0)

This ensures that any prevalidation on command arguments is performed.
It also means that you can easily invoke multiple Django commands in a
script, and you don't need to know where the command is registered in
order to use that command (which is useful for applications that
register their own management commands, like Django Evolution).

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



IE error when clicking the back button after a POST

2008-01-20 Thread Greg

Hello,
I have a form submission where people can search by properties of my
product (color, size, price, etc...).  We'll when they do a search a
bunch of products are returned.  When they click on a product and then
try to click on the back button.  In IE they receive an error:
'Webpage has expired'.  In looking around it seems that if I used a
GET instead of a POST...my problem should be solved.  Does anybody
have any experience with this problem?  Would there be any problems
with using GET instead of POST?


--~--~-~--~~~---~--~~
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: Email as primary key in users

2008-01-20 Thread J . Pablo Fernández

Hello Sebastjan,

That means I would not be using djanago.contrib.auth.views.login, right?


Sebastjan Trepca wrote:
> Sure,
> 
> you just use email field when authenticating user.
> 
> Like this:
> 
> from django.contrib.auth import authenticate
> user = authenticate(email='[EMAIL PROTECTED]', password='secret')
> if user is not None:
> if user.is_active:
> print "You provided a correct username and password!"
> else:
> print "Your account has been disabled!"
> else:
> print "Your username and password were incorrect."
> 
> Sebastjan
> 
> On 1/20/08, J. Pablo Fern�ndez <[EMAIL PROTECTED]> wrote:
>>
>> Hello,
>> Is it possible to use email instead of username for users. So for logging
>> in I would ask email and password (no username)?
>> Thanks.
>> --
>> J. Pablo Fern�ndez <[EMAIL PROTECTED]> (http://pupeno.com)
>>
>>
>> >
>>
> 
> 
-- 
J. Pablo Fernández <[EMAIL PROTECTED]> (http://pupeno.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
-~--~~~~--~~--~--~---



Django can't connect to postgresql

2008-01-20 Thread LRP

Hello,

I've been making small progress moving into Django 0.96.1-1, but have
hit a snag early on.

I'm able to start a project and bring up the Django blue "It works!"
screen.

Following the instructions in http://glasnost.beeznest.org/articles/218,
I've created a Postgresql database web and user webuser. (Postgresql
8.2.6-1)

I've assigned a Postgresql password to webuser and have added the
line:

hostweb webuser md5

to pg_hba.conf.

User webuser is able to connect to web using the assigned password
via:

psql -h localhost -U webuser -W web

...and is able to execute various db commands.

Now, back to the Django tutorial, I edited settings.py, entering
'postgresql_psycopg2.' 'web,' 'webuser,' and webuser's password in
the appropriate slots.

Now I hit the instruction: python manage.py syncdb and I get:

Psycopg2.Operational Error: FATAL Ident authentication failed for user
'webuser'

I've hacked on this for a good part of the day:

-- deleted and re-added webuser
-- added the line "local web webuser md5" to pg_hba.conf as suggested
in the
breezenet tutorial
-- and a bunch of other stuff

But, so far, no cigar.

I'm not sure if this is a Debian issue, but it has me stopped cold for
the moment.

I welcome any and all suggestions.

Many thanks,

Lloyd

--~--~-~--~~~---~--~~
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 tracking down runaway RAM

2008-01-20 Thread Sebastjan Trepca

I think the problem lies in apps, are you super sure they don't leak?

As a temporary solution you could set Apache to kill a process when it
consumes too much memory.

Sebastjan

On 1/20/08, Matt Davies <[EMAIL PROTECTED]> wrote:
> Peter
>
> Have you tried running the websites with lighttpd FCGI instead of Apache?
>
> If you have the time and the spare resource, try it out, if your still
> having memory problems then you will eliminated apache as the problem.
>
> I doubt very much that it isn't the apache from what you've said though, and
> you might never go back :-)
>
>
> We're running alot of medium traffic sites on django, nginx lighttpd FCGI
> and we've never had any memory problems.
>
>
>
>
>
> On 18/01/2008, Peter Baumgartner <[EMAIL PROTECTED]> wrote:
> > No.
> >
> >
> >
> > On Jan 18, 2008 9:23 AM, James Bennett < [EMAIL PROTECTED]> wrote:
> >
> > >
> > > Do you have "DEBUG = True" in your Django settings file?
> > >
> > >
> > > --
> > > "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
-~--~~~~--~~--~--~---



Re: Email as primary key in users

2008-01-20 Thread Sebastjan Trepca
Sure,

you just use email field when authenticating user.

Like this:

from django.contrib.auth import authenticate
user = authenticate(email='[EMAIL PROTECTED]', password='secret')
if user is not None:
if user.is_active:
print "You provided a correct username and password!"
else:
print "Your account has been disabled!"
else:
print "Your username and password were incorrect."

Sebastjan

On 1/20/08, J. Pablo Fern�ndez <[EMAIL PROTECTED]> wrote:
>
> Hello,
> Is it possible to use email instead of username for users. So for logging in
> I would ask email and password (no username)?
> Thanks.
> --
> J. Pablo Fern�ndez <[EMAIL PROTECTED]> (http://pupeno.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: Inclusion-Tag + Admin

2008-01-20 Thread Christoph Egger
Christoph Egger wrote:
> Christoph Egger wrote:
[..]
> 
> Well sorry for asking to early. These things seem to be solved by
> creating a File templatetags.py in the appropriate app and adding a
> __str__() Function to the models.
> 
> But now there is an
> 
>   AttributeError at /members/details/1/
>   'module' object has no attribute '__path__'
> 
> Which I cant't make any sense of
> 

Solved this in IRC, didn't get the templatetags right ;)

  Christoph



signature.asc
Description: OpenPGP digital signature


Re: admin page seg faults

2008-01-20 Thread Graham Dumpleton

The mod_wsgi package gets affected by a lot of similar issues to
mod_python. The documentation for mod_wsgi covers various shared
library and name space conflicts including that of MySQL, PHP etc in:

  http://code.google.com/p/modwsgi/wiki/ApplicationIssues

Even if using mod_python useful to read the mod_wsgi documentation on
these issues for ideas as to what problems can arise in mod_python.

Graham

On Jan 21, 12:43 am, Heather <[EMAIL PROTECTED]> wrote:
> Well, it looks like the answer is 
> here:http://groups.google.com/group/django-users/browse_thread/thread/7972...
>
> the php module andmod_pythonnot playing nice in Apache.  I commented
> out the php module and the admin page worked.  In case anyone else is
> seeing seg faults, this is addressed in the documentation 
> here:http://www.djangoproject.com/documentation/modpython/#if-you-get-a-se...
>
> On Jan 19, 10:39 am, Heather <[EMAIL PROTECTED]> wrote:
>
> > Has anyone had this problem and fixed it?  This is happening using
> > apache2,mod_python, & mysql on ubuntu.  The rest of the site works
> > just fine.  I have the same exact project on my development machine
> > (os x, apache2,mod_python, mysql) and there is no problem at all w/
> > the admin.  I am at a loss.  The only other reference I have found w/
> > respect to the admin page seg faulting had to do w/ python and apache
> > using different versions of expat but I've checked and this isn't the
> > case.  Ideas?  The only other "weirdness" I can think of w/ this setup
> > is that I am not able to update mysqldb at this moment so I have to
> > use mysql_old in the settings file but not on my development machine.
>
> > Thanks
> > Heather
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Mixins and non-database fields on instances

2008-01-20 Thread Wyley

Hello all,

I'm currently using a mixin class to contribute a few extra fields to
my models, to keep track of some metadata on instances (for example,
an update_mode attribute that specifies whether data should replace
all fields or only non-empty ones in the database when the instance is
saved).

Because of the way inheritance works, I end up having to define
__init__ in each model and call the __init__ methods of my mixin class
and the Django Model class within it, like so:

class Mixin(object):
def __init__(self):
 self.update_mode = 'replace'
 # ...

class Contact(Mixin, models.Model):
def __init__(self, *args, **kwargs):
  super(Mixin, self).__init__()
  super(models.Model, self).__init__(*args, **kwargs)
# ... and similarly for other models

I do need the extra properties to be specified in Mixin.__init__ so
that every new instance gets some initial values.

My question is mostly about style: is this the best way to go about
doing things?  Is there a more 'Djangonic' (and consistently D.R.Y.)
way of tacking this extra information onto my model instances?  Is
anything about this approach likely to break Django's current or
future behavior with models?  All opinions are welcome.

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



Email as primary key in users

2008-01-20 Thread J . Pablo Fernández

Hello,
Is it possible to use email instead of username for users. So for logging in
I would ask email and password (no username)?
Thanks.
-- 
J. Pablo Fernández <[EMAIL PROTECTED]> (http://pupeno.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: Inclusion-Tag + Admin

2008-01-20 Thread Christoph Egger
Christoph Egger wrote:
> Hi
> 
> I've two problems I can't solve with the documentation.
> 
> 1. I was adviced to use Inclusion-Tags for my Menu but I can't work out
>how to load the library. {% load proj.app %} doesn't work nor
>{% load proj.app.mytags %}
> 
>'proj.app.mytags' is not a valid tag library: Could not load template
>library from django.templatetags.mytags, No module named mytags
> 
>Can someone tell me the right way to load the Library or point me to
>the appropriate Resource?
> 
> 2. I use Foreign Keys with classes from the Admin-Backend. Here the
>backend shows »movie object« for all my movies. I looked across the
>models reference but couldn't make up where to set the title that
>should be used for referencing in admin-backend
> 
> Thanks
> 
>   Christoph
> 

Well sorry for asking to early. These things seem to be solved by
creating a File templatetags.py in the appropriate app and adding a
__str__() Function to the models.

But now there is an

  AttributeError at /members/details/1/
  'module' object has no attribute '__path__'

Which I cant't make any sense of



signature.asc
Description: OpenPGP digital signature


Inclusion-Tag + Admin

2008-01-20 Thread Christoph Egger

Hi

I've two problems I can't solve with the documentation.

1. I was adviced to use Inclusion-Tags for my Menu but I can't work out
   how to load the library. {% load proj.app %} doesn't work nor
   {% load proj.app.mytags %}

   'proj.app.mytags' is not a valid tag library: Could not load template
   library from django.templatetags.mytags, No module named mytags

   Can someone tell me the right way to load the Library or point me to
   the appropriate Resource?

2. I use Foreign Keys with classes from the Admin-Backend. Here the
   backend shows »movie object« for all my movies. I looked across the
   models reference but couldn't make up where to set the title that
   should be used for referencing in admin-backend

Thanks

  Christoph



-- 
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! 
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer

--~--~-~--~~~---~--~~
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: Loading fixtures from views

2008-01-20 Thread Alex Koshelev

Try this code:

from django.core.management.commands.loaddata import Command

def my_view( request, fixture_label1, fixture_label2 )
Command().handle( fixture_label1, fixture_label2 )
#...

On 20 янв, 20:04, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> To support testing (using Selenium), I would like to invoke fixtures
> from regular Django views.   More generally, I want to be able to
> perform test setup and teardown operations from Selenium which
> interacts with the application through http.
>
> I know that fixtures are normally part of Django tests (rather than
> Selenium) and are invoked vie the "manage.py" script.  Does anyone
> have an idea about how to invoke fixtures from views?
>
> Thanks,
> Doug
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Loading fixtures from views

2008-01-20 Thread [EMAIL PROTECTED]

To support testing (using Selenium), I would like to invoke fixtures
from regular Django views.   More generally, I want to be able to
perform test setup and teardown operations from Selenium which
interacts with the application through http.

I know that fixtures are normally part of Django tests (rather than
Selenium) and are invoked vie the "manage.py" script.  Does anyone
have an idea about how to invoke fixtures from views?

Thanks,
Doug
--~--~-~--~~~---~--~~
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 with either setting or lack of knowledge of Custom error_class

2008-01-20 Thread Karen Tracey
On Jan 20, 2008 11:38 AM, Roboto <[EMAIL PROTECTED]> wrote:

>
> Yes, right now I'm using 0.96
>
> Is error_class a 0.97 feature?
>

Well, strictly speaking there is no 0.97, since 0.96 is the most recent
"release".  So it's a post-0.06 feature, available if you use an SVN
checkout as opposed to the 0.96 release.


> Thanks Karen.
>
> I can redo my css =P to revert to ul and li it's not that big of an
> issue.
>
> On Jan 20, 11:26 am, "Karen Tracey" <[EMAIL PROTECTED]> wrote:
> > On Jan 20, 2008 10:42 AM, Roboto <[EMAIL PROTECTED]> wrote:
> >
> >
> >
> > > The definition for loginForm can be found at the bottom of this
> > > pastebin
> >
> > >http://pastebin.com/m79fa445e
> >
> > OK, since loginForm doesn't override __init__ then it the error must be
> > coming from Django code.  Are you using 0.96?  It doesn't look like the
> > error_class parameter existed there.  Although I don't see a note in the
> > current doc mentioning that this is new in the development version, it's
> > also not mentioned at all in the 0.96 docs:
> >
> > http://www.djangoproject.com/documentation/0.96/newforms/
> >
> > It looks like you need to either upgrade to an svn checkout of Django or
> > restrict your code to what was available in 0.96.
> >
> > Karen
> >
> >
> >
> > > On Jan 20, 12:39 am, "Karen Tracey" <[EMAIL PROTECTED]> wrote:
> > > > On Jan 20, 2008 12:31 AM, Roboto <[EMAIL PROTECTED]> wrote:
> >
> > > > > whoops - here is the re-edited pastebin
> >
> > > > >http://pastebin.com/m225477f8
> >
> > > > So is loginForm coming from beta.website.forms?  It's the definition
> of
> > > > loginForm that would be most helpful to see.
> >
> > > > Karen
> >
> > > > > On Jan 19, 11:36 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote:
> > > > > > On Jan 19, 2008 2:02 PM, Roboto <[EMAIL PROTECTED]> wrote:
> >
> > > > > > > I've made my own custom error list and the response I continue
> to
> > > get
> > > > > > > is this when I try to use it.
> >
> > > > > > > TypeError at /login/
> > > > > > > __init__() got an unexpected keyword argument 'error_class'
> > > > > > > Request Method: POST
> > > > > > > Request URL:http://beta.ready-ready.org/login/
> > > > > > > Exception Type: TypeError
> > > > > > > Exception Value:__init__() got an unexpected keyword
> > > argument
> > > > > > > 'error_class'
> > > > > > > Exception Location:
> > > /home/advanced/rchan/lib/python/beta/website/
> > > > > > > views.py in viewLogin, line 22
> >
> > > > > > > I can't figure it out... did I code something wrong? or is
> django
> > > not
> > > > > > > being able to recognize the error_class arguement?
> >
> > > > > > > here is my views.py
> > > > > > >http://pastebin.com/m7a1ce7fb
> >
> > > > > > > here is my custom error list from my forms.py
> > > > > > >http://pastebin.com/m6d4c1c03
> >
> > > > > > > any ideas would be greatly appreciated!
> >
> > > > > > The exception is being reported at line 22 but the file at
> pastebin
> > > has
> > > > > only
> > > > > > 19 lines.  Did you chop off the top, like maybe the include's?
>  They
> > > > > would
> > > > > > have been helpful to see, not only because it would have been
> easier
> > > to
> > > > > > identify the line causing the error but because it would have
> > > revealed
> > > > > where
> > > > > > loginForm came from.  Where does it come from?  It's the one
> that
> > > > > doesn't
> > > > > > seem to be expecting error_class as a keyword argument, so its
> code
> > > > > would be
> > > > > > helpful to see.
> >
> > > > > > 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: Help with either setting or lack of knowledge of Custom error_class

2008-01-20 Thread Karen Tracey
On Jan 20, 2008 11:43 AM, Karen Tracey <[EMAIL PROTECTED]> wrote:

> On Jan 20, 2008 11:38 AM, Roboto <[EMAIL PROTECTED]> wrote:
>
> >
> > Yes, right now I'm using 0.96
> >
> > Is error_class a 0.97 feature?
> >
>
> Well, strictly speaking there is no 0.97, since 0.96 is the most recent
> "release".  So it's a post-0.06 feature, available if you use an SVN
> checkout as opposed to the 0.96 release.
>

I meant post-0.96 here, of course.

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: Help with either setting or lack of knowledge of Custom error_class

2008-01-20 Thread Roboto

Yes, right now I'm using 0.96

Is error_class a 0.97 feature?

Thanks Karen.

I can redo my css =P to revert to ul and li it's not that big of an
issue.

On Jan 20, 11:26 am, "Karen Tracey" <[EMAIL PROTECTED]> wrote:
> On Jan 20, 2008 10:42 AM, Roboto <[EMAIL PROTECTED]> wrote:
>
>
>
> > The definition for loginForm can be found at the bottom of this
> > pastebin
>
> >http://pastebin.com/m79fa445e
>
> OK, since loginForm doesn't override __init__ then it the error must be
> coming from Django code.  Are you using 0.96?  It doesn't look like the
> error_class parameter existed there.  Although I don't see a note in the
> current doc mentioning that this is new in the development version, it's
> also not mentioned at all in the 0.96 docs:
>
> http://www.djangoproject.com/documentation/0.96/newforms/
>
> It looks like you need to either upgrade to an svn checkout of Django or
> restrict your code to what was available in 0.96.
>
> Karen
>
>
>
> > On Jan 20, 12:39 am, "Karen Tracey" <[EMAIL PROTECTED]> wrote:
> > > On Jan 20, 2008 12:31 AM, Roboto <[EMAIL PROTECTED]> wrote:
>
> > > > whoops - here is the re-edited pastebin
>
> > > >http://pastebin.com/m225477f8
>
> > > So is loginForm coming from beta.website.forms?  It's the definition of
> > > loginForm that would be most helpful to see.
>
> > > Karen
>
> > > > On Jan 19, 11:36 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote:
> > > > > On Jan 19, 2008 2:02 PM, Roboto <[EMAIL PROTECTED]> wrote:
>
> > > > > > I've made my own custom error list and the response I continue to
> > get
> > > > > > is this when I try to use it.
>
> > > > > > TypeError at /login/
> > > > > > __init__() got an unexpected keyword argument 'error_class'
> > > > > > Request Method: POST
> > > > > > Request URL:http://beta.ready-ready.org/login/
> > > > > > Exception Type: TypeError
> > > > > > Exception Value:__init__() got an unexpected keyword
> > argument
> > > > > > 'error_class'
> > > > > > Exception Location:
> > /home/advanced/rchan/lib/python/beta/website/
> > > > > > views.py in viewLogin, line 22
>
> > > > > > I can't figure it out... did I code something wrong? or is django
> > not
> > > > > > being able to recognize the error_class arguement?
>
> > > > > > here is my views.py
> > > > > >http://pastebin.com/m7a1ce7fb
>
> > > > > > here is my custom error list from my forms.py
> > > > > >http://pastebin.com/m6d4c1c03
>
> > > > > > any ideas would be greatly appreciated!
>
> > > > > The exception is being reported at line 22 but the file at pastebin
> > has
> > > > only
> > > > > 19 lines.  Did you chop off the top, like maybe the include's?  They
> > > > would
> > > > > have been helpful to see, not only because it would have been easier
> > to
> > > > > identify the line causing the error but because it would have
> > revealed
> > > > where
> > > > > loginForm came from.  Where does it come from?  It's the one that
> > > > doesn't
> > > > > seem to be expecting error_class as a keyword argument, so its code
> > > > would be
> > > > > helpful to see.
>
> > > > > 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: Help with either setting or lack of knowledge of Custom error_class

2008-01-20 Thread Karen Tracey
On Jan 20, 2008 10:42 AM, Roboto <[EMAIL PROTECTED]> wrote:

>
> The definition for loginForm can be found at the bottom of this
> pastebin
>
> http://pastebin.com/m79fa445e
>
>
OK, since loginForm doesn't override __init__ then it the error must be
coming from Django code.  Are you using 0.96?  It doesn't look like the
error_class parameter existed there.  Although I don't see a note in the
current doc mentioning that this is new in the development version, it's
also not mentioned at all in the 0.96 docs:

http://www.djangoproject.com/documentation/0.96/newforms/

It looks like you need to either upgrade to an svn checkout of Django or
restrict your code to what was available in 0.96.

Karen


>
> On Jan 20, 12:39 am, "Karen Tracey" <[EMAIL PROTECTED]> wrote:
> > On Jan 20, 2008 12:31 AM, Roboto <[EMAIL PROTECTED]> wrote:
> >
> >
> >
> > > whoops - here is the re-edited pastebin
> >
> > >http://pastebin.com/m225477f8
> >
> > So is loginForm coming from beta.website.forms?  It's the definition of
> > loginForm that would be most helpful to see.
> >
> > Karen
> >
> > > On Jan 19, 11:36 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote:
> > > > On Jan 19, 2008 2:02 PM, Roboto <[EMAIL PROTECTED]> wrote:
> >
> > > > > I've made my own custom error list and the response I continue to
> get
> > > > > is this when I try to use it.
> >
> > > > > TypeError at /login/
> > > > > __init__() got an unexpected keyword argument 'error_class'
> > > > > Request Method: POST
> > > > > Request URL:http://beta.ready-ready.org/login/
> > > > > Exception Type: TypeError
> > > > > Exception Value:__init__() got an unexpected keyword
> argument
> > > > > 'error_class'
> > > > > Exception Location:
> /home/advanced/rchan/lib/python/beta/website/
> > > > > views.py in viewLogin, line 22
> >
> > > > > I can't figure it out... did I code something wrong? or is django
> not
> > > > > being able to recognize the error_class arguement?
> >
> > > > > here is my views.py
> > > > >http://pastebin.com/m7a1ce7fb
> >
> > > > > here is my custom error list from my forms.py
> > > > >http://pastebin.com/m6d4c1c03
> >
> > > > > any ideas would be greatly appreciated!
> >
> > > > The exception is being reported at line 22 but the file at pastebin
> has
> > > only
> > > > 19 lines.  Did you chop off the top, like maybe the include's?  They
> > > would
> > > > have been helpful to see, not only because it would have been easier
> to
> > > > identify the line causing the error but because it would have
> revealed
> > > where
> > > > loginForm came from.  Where does it come from?  It's the one that
> > > doesn't
> > > > seem to be expecting error_class as a keyword argument, so its code
> > > would be
> > > > helpful to see.
> >
> > > > 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
-~--~~~~--~~--~--~---



notmm-0.2.9 (phycocyanine) released

2008-01-20 Thread Etienne Robillard

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


Hello all,

I'm pleased to announce the release of notmm-0.2.9. 

notmm is a heterogenous toolkit which strives at becoming a
multi-purpose swiss knife for Django. 

It is fully unstable, unreviewed, and there's no favicon.ico yet... ;)

The release notes are available here: 
 http://notmm.googlegroups.com/web/RELEASE-NOTES-0.2.9

You may also download the 0.2.9 tarball from here:
 http://pypi.python.org/pypi/notmm/0.2.9

Best regards,
Etienne



-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.4 (FreeBSD)

iEYEARECAAYFAkeTbToACgkQ0H/Gee/mchRZpgCferY5XQdIP3Z2HrvfcBBkrbGH
mPUAnjSC39PNbSI0I8j68OVF2ryDMWjD
=2HK4
-END PGP SIGNATURE-

--~--~-~--~~~---~--~~
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 with either setting or lack of knowledge of Custom error_class

2008-01-20 Thread Roboto

The definition for loginForm can be found at the bottom of this
pastebin

http://pastebin.com/m79fa445e


On Jan 20, 12:39 am, "Karen Tracey" <[EMAIL PROTECTED]> wrote:
> On Jan 20, 2008 12:31 AM, Roboto <[EMAIL PROTECTED]> wrote:
>
>
>
> > whoops - here is the re-edited pastebin
>
> >http://pastebin.com/m225477f8
>
> So is loginForm coming from beta.website.forms?  It's the definition of
> loginForm that would be most helpful to see.
>
> Karen
>
> > On Jan 19, 11:36 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote:
> > > On Jan 19, 2008 2:02 PM, Roboto <[EMAIL PROTECTED]> wrote:
>
> > > > I've made my own custom error list and the response I continue to get
> > > > is this when I try to use it.
>
> > > > TypeError at /login/
> > > > __init__() got an unexpected keyword argument 'error_class'
> > > > Request Method: POST
> > > > Request URL:http://beta.ready-ready.org/login/
> > > > Exception Type: TypeError
> > > > Exception Value:__init__() got an unexpected keyword argument
> > > > 'error_class'
> > > > Exception Location: /home/advanced/rchan/lib/python/beta/website/
> > > > views.py in viewLogin, line 22
>
> > > > I can't figure it out... did I code something wrong? or is django not
> > > > being able to recognize the error_class arguement?
>
> > > > here is my views.py
> > > >http://pastebin.com/m7a1ce7fb
>
> > > > here is my custom error list from my forms.py
> > > >http://pastebin.com/m6d4c1c03
>
> > > > any ideas would be greatly appreciated!
>
> > > The exception is being reported at line 22 but the file at pastebin has
> > only
> > > 19 lines.  Did you chop off the top, like maybe the include's?  They
> > would
> > > have been helpful to see, not only because it would have been easier to
> > > identify the line causing the error but because it would have revealed
> > where
> > > loginForm came from.  Where does it come from?  It's the one that
> > doesn't
> > > seem to be expecting error_class as a keyword argument, so its code
> > would be
> > > helpful to see.
>
> > > 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
-~--~~~~--~~--~--~---



Problems setting mutliple filter for a model

2008-01-20 Thread tximo

Hi,

I have a problem concerning the database api. I'm using a model called
products and these products can have up to five options like 'black',
'high price', 'big'.

When I'm showing an article list, you can set multiple filters for
articles you like to see. The selected filter will be stored in
sessions, so with every step you can specify your selection.

The problem is how to write an elegant lookup to set the filter for
the products?

In raw sql I could write a custum query string with multiple if-
options. But I don't like that.

Does anyone have had a different problem and has a solution to 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: Running django+apache on my macbook

2008-01-20 Thread Anton P. Linevich

Greeting, John!  Fri, Jan 18, 2008 at 11:29:38AM -0800, retireoncsco wrote: 

> 
> Anton, that was sort of my question, how do I complete your second
> idea but w/o the recompile.  The mac already comes with apache 2
> installed and running rather well, how hard would it be to add
> mod_python or mod_wsgi to that environment?

Well, this is not hard, but as many of django-users@ sayed, better use
that already builded and supporting by others. There is mod_cgi module
from the box in MacOS Tiger/Leo. Instructions how to use mod_cgi with
django availiable in django-docs. Good luck!

-- 
 Anton P. Linevich

--~--~-~--~~~---~--~~
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 tracking down runaway RAM

2008-01-20 Thread Matt Davies
Peter
Have you tried running the websites with lighttpd FCGI instead of Apache?

If you have the time and the spare resource, try it out, if your still
having memory problems then you will eliminated apache as the problem.

I doubt very much that it isn't the apache from what you've said though, and
you might never go back :-)

We're running alot of medium traffic sites on django, nginx lighttpd FCGI
and we've never had any memory problems.




On 18/01/2008, Peter Baumgartner <[EMAIL PROTECTED]> wrote:
>
> No.
>
> On Jan 18, 2008 9:23 AM, James Bennett <[EMAIL PROTECTED]> wrote:
>
> >
> > Do you have "DEBUG = True" in your Django settings file?
> >
> >
> > --
> > "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
-~--~~~~--~~--~--~---



Re: admin page seg faults

2008-01-20 Thread Heather

Well, it looks like the answer is here:
http://groups.google.com/group/django-users/browse_thread/thread/797259d0152de507/7855bdc498395f45?lnk=gst=segmentation+fault#7855bdc498395f45

the php module and mod_python not playing nice in Apache.  I commented
out the php module and the admin page worked.  In case anyone else is
seeing seg faults, this is addressed in the documentation here:
http://www.djangoproject.com/documentation/modpython/#if-you-get-a-segmentation-fault


On Jan 19, 10:39 am, Heather <[EMAIL PROTECTED]> wrote:
> Has anyone had this problem and fixed it?  This is happening using
> apache2, mod_python, & mysql on ubuntu.  The rest of the site works
> just fine.  I have the same exact project on my development machine
> (os x, apache2, mod_python, mysql) and there is no problem at all w/
> the admin.  I am at a loss.  The only other reference I have found w/
> respect to the admin page seg faulting had to do w/ python and apache
> using different versions of expat but I've checked and this isn't the
> case.  Ideas?  The only other "weirdness" I can think of w/ this setup
> is that I am not able to update mysqldb at this moment so I have to
> use mysql_old in the settings file but not on my development machine.
>
> Thanks
> Heather
--~--~-~--~~~---~--~~
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: ajax toolkit suggest request

2008-01-20 Thread Steve Bergman



On Jan 20, 6:49 am, Artiom Diomin <[EMAIL PROTECTED]> wrote:
> Seems like you want someone write it for you?
> It costs money :)

It's good that he provided a description of what he wanted to
accomplish.  What he wants does not really require ajax.  A bit of
javascript might make it nicer.

To the OP:

You could do this without ajax if you don't mind a page reload, simply
with an "onchange" attribute on the checkboxes and some extra logic in
the view.  Checking the box would submit the form and redisplay the
whole page with the desired changes.  Or you could have the user check
the box and click submit without the "onchange".

No actual ajax is required, in that there need be asynchronous
conversation between the browser and the server.

If you have not already, go to new.djangobook.com and read chapter 7
on form processing.  Make sure you understand it.  Visit the excellent
newforms reference in the Django doc.  Look at the onchange attribute
for checkboxes to see how to make a form autosubmit on a change to a
field, and I think you will see how to do what you describe in a
straightforward fashion.

If you do want to get into javascript on your sites, I'm far from an
expert, but I have used Mochikit (with TurboGears) and am starting to
learn jquery with DJango.  Jquery seems quite nice.  The interface is
very clean and works in a very straightforward way.  It leverages CSS,
and feels very pythonic to me.  It seems very natural.  There is good
documentation available at http://docs.jquery.com/Main_Page . and I
bought the "Learning Jquery" book, too.


--~--~-~--~~~---~--~~
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: best practices for a production site

2008-01-20 Thread Tim Chase

> This also may be a good time to consider a distributed version control
> system (Like bazaar or mercurial)... we're just about to finish
> porting to bazaar after running up to several situations just like
> yours.

I second this suggestion.  Mercurial is currently at the top of
my pick-list for its speed and mental model.  I like Bazaar for
its mental model and it's focus on correctness, but it's still a
bit slow for my old home machine (once they resolve this, I
suspect I'll shift to Bazaar).  Some folks swear by Git, but I
don't fully grasp the mental model to make the best use of it,
and it's a bit of a second-class citizen on Win32.  For yet
others, it's Darcs but I don't know much about it.

Mercurial and Bazaar also have the added benefit of being written
in Python like Django so if I had to hack a VCS or use its
libraries from within Django, it would be a bit easier.

> One benefit of DVCS is that branching is easier than SVN...making
> feature-level branches easier to intergrate into your workflow.

Bah...branching in SVN is easy...it's the repeatedly merging
those branches back together that becomes a pain :)  (At least
until they add merge-tracking features which are the horizon, but
not yet released).

-tim






--~--~-~--~~~---~--~~
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: ajax toolkit suggest request

2008-01-20 Thread Artiom Diomin

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Seems like you want someone write it for you?
It costs money :)
Vice versa you *need* to "spend time reading all ajax things"

Generally not all, just pick up some javascript framework (jquery,
moo-tools, etc), read how to dial with ajax in django(you easily find
this topic in google), and begin developing you first django-powered
ajax appication.
Good luck.

Oguz Yarimtepe writes:
|
| Hi,
|
| I need some ajax help at my Django application. I haven't used ajax
| before so it will be good if someone suggest me some toolkits so that i
| won't spend time reading all ajax things.
|
| One thing that i want to do is filling a text box by clicking a button.
|   It will be good if another Django form site is opened and after
| choosing the required value (most probably by clicking a check box) and
| submiting , i want to see the selected value at the text area. Maybe
| this is not a related topic with ajax, but i dont know how i will do it
| in Django. It may be a javascript job, i dont know.
|
| Second, i want to update some form parts or part of the site when a form
| elements value is changed.
|
| Any help will be helpful.
| Thanx.
|
|

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iD8DBQFHk0NAHoZOXY8LFOARAqSQAJ9ncc0AYI1EI79QXoTns052DINF0ACdEv10
7lH5C/NMLXNs+KBcm7tkb9A=
=sUWU
-END PGP SIGNATURE-

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



الف شكر

2008-01-20 Thread الهكر الاسود ****
ممكن انتضم ليكم
--~--~-~--~~~---~--~~
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: App naming conflict? - modification of contrib.comments

2008-01-20 Thread MichaelMartinides

ah, found the issue,

I used comment-utils to create a moderator.

After changing the import statement in comment_utils.moderation to
mysite.comments.models import FreeComment it also works in mod_python

Although I still have no understanding for why it first worked with
runserver and not with mod_python I'm happy now.

Cheers,
 >>MM

On Jan 20, 11:44 am, MichaelMartinides <[EMAIL PROTECTED]>
wrote:
> Hi all,
>
> I dont know where to search anymore. I copied django.contrib.comments
> into my project directory and adapted it to my needs (eg email field
> to freecomments, forms, import statements, etc.)
>
> When running the project with python manage runserver everything works
> as it should.
>
> But when running with mod_python in apache2, somehow the
> django.contrib.comments gets loaded instead (e.g. when looking at the
> model documentation in the admin, I dont see my new fields, etc.).
>
> I've tried quite a view things, but I cannot find my mistake.
>
> Glad for any hints,
>>>Michael
--~--~-~--~~~---~--~~
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: got error when use code of djangobook chapter 7 for searching

2008-01-20 Thread birkin

On Jan 19, 3:46 am, Fredrik Lundh <[EMAIL PROTECTED]> wrote:

> indentation matters in Python...
>
> ...the python interpreter does allow tabs for indentation, but assumes that 
> they have the standard size (8 spaces)...
>
> 

To be clear, what matters is *consistency* of indentation -- I use
tabs I've configured in my editor to be 2 spaces.

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



App naming conflict? - modification of contrib.comments

2008-01-20 Thread MichaelMartinides

Hi all,

I dont know where to search anymore. I copied django.contrib.comments
into my project directory and adapted it to my needs (eg email field
to freecomments, forms, import statements, etc.)

When running the project with python manage runserver everything works
as it should.

But when running with mod_python in apache2, somehow the
django.contrib.comments gets loaded instead (e.g. when looking at the
model documentation in the admin, I dont see my new fields, etc.).

I've tried quite a view things, but I cannot find my mistake.

Glad for any hints,
   >>Michael
--~--~-~--~~~---~--~~
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: ImageField Example

2008-01-20 Thread Alex Koshelev

Read the docs
http://www.djangoproject.com/documentation/newforms/#binding-uploaded-files-to-a-form

On 19 янв, 15:32, Darthmahon <[EMAIL PROTECTED]> wrote:
> Hey,
>
> Does anyone have a working example of uploading images using Django?
> I've looked extensively and haven't found anything - any idea how I
> save images using Django? I've put an ImageField in my model with the
> path to where it should save, but how do I tell Django to save it when
> a form is submitted? I'm using NewForms btw.
>
> Cheers,
> Chris
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



ajax toolkit suggest request

2008-01-20 Thread Oguz Yarimtepe


Hi,

I need some ajax help at my Django application. I haven't used ajax 
before so it will be good if someone suggest me some toolkits so that i 
won't spend time reading all ajax things.

One thing that i want to do is filling a text box by clicking a button. 
  It will be good if another Django form site is opened and after 
choosing the required value (most probably by clicking a check box) and 
submiting , i want to see the selected value at the text area. Maybe 
this is not a related topic with ajax, but i dont know how i will do it 
in Django. It may be a javascript job, i dont know.

Second, i want to update some form parts or part of the site when a form 
elements value is changed.

Any help will be helpful.
Thanx.


-- 
Oğuz Yarımtepe
www.yarimtepe.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: best practices for a production site

2008-01-20 Thread Andrew

This also may be a good time to consider a distributed version control
system (Like bazaar or mercurial)... we're just about to finish
porting to bazaar after running up to several situations just like
yours.

One benefit of DVCS is that branching is easier than SVN...making
feature-level branches easier to intergrate into your workflow.

Good luck!

On Jan 17, 11:55 pm, Kenneth Gonsalves <[EMAIL PROTECTED]> wrote:
> hi,
>
> I have a site in production and being developed at the same time - a
> common django usecase I am sure. This is the first time I am
> developing a site with a team comprised of several remote
> contributors also. My previous teams were all in the same lab.
> Currently everyone with commit rights commits code to the repository.
> I test it out on the setup on my local box, and if satisfactory do an
> svn up on the server and restart apache. The problem is that there
> are two types of changes in code - one is new features and the other
> is minor changes. With the current setup, minor changes have to wait
> until the new features are tested out. So even a spelling mistake has
> to wait until whatever is already committed is tested and accepted.
> At the same time, the new features do not really justify setting up
> separate branches. So what would be the best way out of this?
> --
>
> regards
> kghttp://lawgon.livejournal.comhttp://nrcfosshelpline.in/web/
> Foss Conference for the common man:http://registration.fossconf.in/web/
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---