Re: Unit testing in django without using test client

2010-09-16 Thread girish shabadimath
hi Paul,

thanks for d reply,,,but im new to python n django,,,dint do ne python unit
testing before,,can u plz give me some links or hints to start with...

On Thu, Sep 16, 2010 at 8:09 PM, Paul Winkler  wrote:

> On Sep 16, 10:11 am, girish shabadimath 
> wrote:
> > thanks for reply,
> > actually i used unit test to test urls and other view functions,,,there
> is a
> > module called Client() in django which acts as a browser to test urls,,,
> >
> > my problem is ,i want to test other methods in my project,,, how to do
> > so, without making use of django's test client..?..
>
> Exactly the same way you test any other python code. What's the
> problem?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>


-- 
Girish M S

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: how to replace "Congratulations on your first Django-powered page." with my home page

2010-09-16 Thread Justin Myers
It already tells you why it's showing that page. You need to add some
entries to urls.py, at the very least. The tutorial Sithembewena
linked you to is a good start.
-Justin

On Sep 16, 12:25 am, perfecthills  wrote:
> Have a website build on django, i desire to transfer the website to a
> new domain, i already created the application and even website at
> webfaction, i have even copied the entire code of the previous site to
> the ftp of the new website iwant. well being new, all i get is
>
> It worked!
> Congratulations on your first Django-powered page.
>
> Of course, you haven't actually done any work yet. Here's what to do
> next:
>
>     * If you plan to use a database, edit the DATABASES setting in
> myproject/settings.py.
>     * Start your first app by running python myproject/manage.py
> startapp [appname].
>
> You're seeing this message because you have DEBUG = True in your
> Django settings file and you haven't configured any URLs. Get to work!
>
> can someone suggest what else i need to do.
> thanx

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: How to clear wrong form data (e.g password field), but still show error?

2010-09-16 Thread Evgeny
perfect, Thanks!

On Sep 16, 7:55 pm, Brian Neal  wrote:
> On Sep 16, 7:37 pm, Karen Tracey  wrote:
>
> > Use this widget for the field:
>
> >http://docs.djangoproject.com/en/1.2/ref/forms/widgets/#django.forms
>
> > with render_value=False
>
> Note that the docs indicate the default value for render_value is True
> but in the code it is False:
>
> http://code.djangoproject.com/browser/django/trunk/django/forms/widge...

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: How to clear wrong form data (e.g password field), but still show error?

2010-09-16 Thread Brian Neal
On Sep 16, 9:55 pm, Brian Neal  wrote:
> On Sep 16, 7:37 pm, Karen Tracey  wrote:
>
> > Use this widget for the field:
>
> >http://docs.djangoproject.com/en/1.2/ref/forms/widgets/#django.forms
>
> > with render_value=False
>
> Note that the docs indicate the default value for render_value is True
> but in the code it is False:
>
> http://code.djangoproject.com/browser/django/trunk/django/forms/widgets.py#L232

Oh sorry, the documentation is correct in the development docs:

http://docs.djangoproject.com/en/dev/ref/forms/widgets/#django.forms.PasswordInput

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: How to clear wrong form data (e.g password field), but still show error?

2010-09-16 Thread Brian Neal
On Sep 16, 7:37 pm, Karen Tracey  wrote:
>
> Use this widget for the field:
>
> http://docs.djangoproject.com/en/1.2/ref/forms/widgets/#django.forms
>
> with render_value=False
>
Note that the docs indicate the default value for render_value is True
but in the code it is False:

http://code.djangoproject.com/browser/django/trunk/django/forms/widgets.py#L232

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Mudar Senha de um usuário

2010-09-16 Thread Giovanna Ronzé
Dado que um usuário está logado e quer mudar sua senha, como eu faço
para o django mudar a senha daquele user sem que seja preciso que ele
preencha esse campo (do nick)?

Bem, para resolver esse problema, primeiro eu fiz de uma forma que
necessitava do user dizer o nick.
Pesquisando, eu vi que tinha uma classe PasswordChangeForm e tentei
usar. Olha, se alguém me ensinar como se usa de fato (tanto no
urls.py, no html e no views.py se possível ^.^) tudo bem. Mas eu
realmente não consegui aplicar essa classe.

Diante disso, voltei para ideia inicial de construir minha própria
função. O problema voltou a ser o tal do campo user. Já que o usuário
está logado, como eu 'pego' seu campo de username pelo views.py?

Aí está a tentativa dessa função e os trechos de código relativos:

[views.py]

@login_required
def mudar_senha (request):
return render_to_response('matematica/mudar_senha.html')

@login_required
def mudar_senha_dados (request):
erro = False
nome = request.POST['username']
user = User.objects.get(username=nome)

if request.POST['password'] == '':
erro = True
return render_to_response('matematica/mudar_senha.html', 
{'erro':
erro})
else:
user.set_password(request.POST['new_password'])
user.save()
return HttpResponseRedirect('/')

[mudar_senha.html]



Nova senha 

{{ form.new_password }}






[urls.py]

(r'^mudar_senha/', 'projeto.matematica.views.mudar_senha'),
(r'^mudar_senha_dados/',
'projeto.matematica.views.mudar_senha_dados'),

Bem. Desde já agradeço a atenção.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Preventing code from running during user tests

2010-09-16 Thread Jim D.
Thanks Russ, that's helpful.

I would think signals would ideally be a solution for this, no? E.g.,
a setup and teardown signal that fired in setup_test_environment() and
teardown_test_environment(), respectfully. I was actually hoping to
find this already implemented when I checked the documentation for
signals.

On Sep 16, 5:13 pm, Russell Keith-Magee 
wrote:
> On Fri, Sep 17, 2010 at 6:15 AM, Jim D.  wrote:
> > I have some code that calls a third-party API in a Django application
> > I'm working on, which could be triggered at various points throughout
> > a project. I would like to ensure that the API itself doesn't actually
> > get called at all during test mode, much the same way that Django
> > itself swaps out the email backend during test mode to ensure emails
> > don't actually get sent during testing.
>
> > The key point here is I need to ensure the real library isn't being
> > called anywhere during the tests being run throughout the suite, not
> > just in the test code I'm writing specifically for the application
> > itself.
>
> > Is there a clean way to do this? I notice that Django disables the
> > email and a few other settings in the setup_test_environment()
> > function. I'd like to do something similar, but the only idea I've
> > come up with so far is to create a custom test runner that extends the
> > default setup_test_environment() method and adds a few items of my
> > own. While this would work, it would depend on the project using a
> > custom test runner.
>
> > Other ideas include a crazy hack like this guy has proposed:
> >http://www.thebitguru.com/blog/view/246-Using%20custom%20settings%20i...
>
> > Surely others of you have had to ensure a given library isn't called
> > during testing or development (e.g. if you were implementing a payment
> > processor API, you wouldn't want to actually call that library during
> > tests). Am I just missing a totally obvious way to accomplish this?
>
> A custom test runner would be the usual way to accomplish this, and as
> of Django 1.2, it's a lot easier to write one because the test runner
> is class based. On a smaller scale, you could also accomplish this
> using a setUp()/tearDown() pair in individual test cases.
>
> The "if TEST" approach advocated by 'thebitguru' will certainly work,
> but it's not a pattern that I'd like to see take hold in Django
> itself. This approach essentially introduces branches into your main
> codebase, so now you need to be testing whether or not your code is
> hitting the right branches -- in theory, it is possible that your
> production code could activate the "if TEST' branch, so you need to
> test that this won't happen.
>
> If you have a suggestion of a better way to provide setup/teardown
> hooks, I'd be happy to hear it.
>
> 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-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: How to clear wrong form data (e.g password field), but still show error?

2010-09-16 Thread Karen Tracey
On Thu, Sep 16, 2010 at 7:20 PM, Evgeny  wrote:

> Hello,
>
> I know that this has been asked before, and the answer seemed to be
> - display the wrong data back to the user along with the error
> message.
>
> However, this does not really work with password fields, because there
> is nothing really to display.
> Let's say the entered password was too short or two passwords did not
> match - all you'll see is the equal number of asterisks.
>
> In this situation I'd like to clear the fields, but display the error
> message,
> otherwise user has to clear the field himself/herself, which I think
> is an unnecessary extra step.
>
>
Use this widget for the field:

http://docs.djangoproject.com/en/1.2/ref/forms/widgets/#django.forms.PasswordInput

with render_value=False

Karen
-- 
http://tracey.org/kmt/

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Preventing code from running during user tests

2010-09-16 Thread Russell Keith-Magee
On Fri, Sep 17, 2010 at 6:15 AM, Jim D.  wrote:
> I have some code that calls a third-party API in a Django application
> I'm working on, which could be triggered at various points throughout
> a project. I would like to ensure that the API itself doesn't actually
> get called at all during test mode, much the same way that Django
> itself swaps out the email backend during test mode to ensure emails
> don't actually get sent during testing.
>
> The key point here is I need to ensure the real library isn't being
> called anywhere during the tests being run throughout the suite, not
> just in the test code I'm writing specifically for the application
> itself.
>
> Is there a clean way to do this? I notice that Django disables the
> email and a few other settings in the setup_test_environment()
> function. I'd like to do something similar, but the only idea I've
> come up with so far is to create a custom test runner that extends the
> default setup_test_environment() method and adds a few items of my
> own. While this would work, it would depend on the project using a
> custom test runner.
>
> Other ideas include a crazy hack like this guy has proposed:
> http://www.thebitguru.com/blog/view/246-Using%20custom%20settings%20in%20django%20tests
>
> Surely others of you have had to ensure a given library isn't called
> during testing or development (e.g. if you were implementing a payment
> processor API, you wouldn't want to actually call that library during
> tests). Am I just missing a totally obvious way to accomplish this?

A custom test runner would be the usual way to accomplish this, and as
of Django 1.2, it's a lot easier to write one because the test runner
is class based. On a smaller scale, you could also accomplish this
using a setUp()/tearDown() pair in individual test cases.

The "if TEST" approach advocated by 'thebitguru' will certainly work,
but it's not a pattern that I'd like to see take hold in Django
itself. This approach essentially introduces branches into your main
codebase, so now you need to be testing whether or not your code is
hitting the right branches -- in theory, it is possible that your
production code could activate the "if TEST' branch, so you need to
test that this won't happen.

If you have a suggestion of a better way to provide setup/teardown
hooks, I'd be happy to hear it.

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-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



validation in fields with custom forms

2010-09-16 Thread msoulier
I have a custom field with takes an ipv4/v6 address or an fqdn, or a
list of
same, comma-separated. I'm using it in a form where I then have a
custom
validator for that field.

ie.

class SipTrunkForm(forms.Form):
remote_addr = twcustomfields.SockaddrListField()
remote_port = forms.IntegerField(min_value=1,
 max_value=65535)

So, SockaddrListField has a clean() method, which seems to work fine.

Meanwhile, in the SipTrunkForm I have a clean_remote_addr() validator
to
further validate the address and the port together.

The problem is, when clean_remote_addr is called, the port value
doesn't seem
to be in cleaned_data yet. It appears soon after, as the view sees it
and
saves it just fine, but it doesn't appear in the validator for the
form.

This seems like a bug to me...

Or am I doing this wrong somehow? When I validate remote_port instead
by
renaming clean_remote_addr to clean_remote_port, it all works fine.

Mike

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: named admin url w filter

2010-09-16 Thread Russell Keith-Magee
On Fri, Sep 17, 2010 at 12:24 AM, Carl Karsten  wrote:
> Is there a better way to do:
>
> {% url admin:main_episode_changelist %}?show__id__exact={{show.id}}

Django doesn't include the GET arguments as part of the URL dispatch
process, so the {% url %} tag matches the body of the URL; if you want
to pass in GET arguments, you then need to provide them as additional
URL info in your template.

You're asking for a 'better' way, but you haven't said why the
existing way isn't acceptable. AFAICT, it should work as you describe
-- what exactly is the nature of your objection?

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-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: testing app with multi db's one of which is read-only

2010-09-16 Thread Russell Keith-Magee
On Thu, Sep 16, 2010 at 11:18 PM, keith  wrote:
> I have an app that accesses two different databases which are defined
> in settings.py
> one of them is read-only and its models all have managed=False, when i
> run 'manage.py test', unsurprisingly i guess, i get an insufficient
> privileges error when trying to create/destroy
> the testing database on the read-only database.
>
> is this a bug or and rfe?

RFE. Django doesn't currently have a concept of a "read only"
database; when you run a test, it tries to create a test version of
any database that is defined in DATABASES so that the test environment
is isolated from production.

It's an interesting idea though -- the concept of a truly 'external'
data source that can be reliably used in testing isn't something that
was considered as part of the multi-db design process.

There have been requests in the past to be able to control whether the
test setup is responsible for creating and destroying the test
database. If we introduced such an option, it might be possible to use
the TEST_NAME setting to point the test framework at your 'read-only'
database. However, there are other details that would need to be
finessed -- e.g., how does the test transaction rollback process work
on a database that can't be written to?

As a workaround for now, you should be able to write a custom database
backend for your readonly database -- extend the Django builtin
backend, but override the _create_test_db() and _destroy_test_db()
functions on the creation module to be no-ops. Use this backend for
your readonly database, and you will be able to use the TEST_NAME
trick right now.

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-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



How to clear wrong form data (e.g password field), but still show error?

2010-09-16 Thread Evgeny
Hello,

I know that this has been asked before, and the answer seemed to be
- display the wrong data back to the user along with the error
message.

However, this does not really work with password fields, because there
is nothing really to display.
Let's say the entered password was too short or two passwords did not
match - all you'll see is the equal number of asterisks.

In this situation I'd like to clear the fields, but display the error
message,
otherwise user has to clear the field himself/herself, which I think
is an unnecessary extra step.

Why not just allow :

form.clear_field_data('somefield')

Thanks.

Evgeny.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Preventing code from running during user tests

2010-09-16 Thread Jim D.
I have some code that calls a third-party API in a Django application
I'm working on, which could be triggered at various points throughout
a project. I would like to ensure that the API itself doesn't actually
get called at all during test mode, much the same way that Django
itself swaps out the email backend during test mode to ensure emails
don't actually get sent during testing.

The key point here is I need to ensure the real library isn't being
called anywhere during the tests being run throughout the suite, not
just in the test code I'm writing specifically for the application
itself.

Is there a clean way to do this? I notice that Django disables the
email and a few other settings in the setup_test_environment()
function. I'd like to do something similar, but the only idea I've
come up with so far is to create a custom test runner that extends the
default setup_test_environment() method and adds a few items of my
own. While this would work, it would depend on the project using a
custom test runner.

Other ideas include a crazy hack like this guy has proposed:
http://www.thebitguru.com/blog/view/246-Using%20custom%20settings%20in%20django%20tests

Surely others of you have had to ensure a given library isn't called
during testing or development (e.g. if you were implementing a payment
processor API, you wouldn't want to actually call that library during
tests). Am I just missing a totally obvious way to accomplish 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-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Admin not using verbose_name on required fields

2010-09-16 Thread Daniel Roseman


On Sep 16, 7:26 pm, geraldcor  wrote:
> Hello all,
>
> I am using the admin and fieldsets to display a change form as usual.
> Some fields' labels, even with blank=True are being given the class
> required and are not using the verbose_name argument either given via
> keyword or positional usage. All fields that really are required
> (blank=False) have this same problem. This brings up a few good
> questions. Why are certain fields being called required when they are
> not required and why are fields with the class required not using the
> verbose_name?
>
> http://dpaste.com/hold/244531/
>
> Model snippet and full Admin for the model.
>
> Thanks for any help.

Because you're overriding all the attributes in your
formfield_for_dbfield function.

--
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-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django Chat App?

2010-09-16 Thread Rod Hamby
 This might not be any help since I know nothing of VOIP, but for the
> chat portion take a look in to Ape ( a comet server written in C ).
>
> On Sep 16, 9:41 am, Sithembewena Lloyd Dube  wrote:
>> Indeed it is, but the media server isn't :).
>>
>> On Thu, Sep 16, 2010 at 5:35 PM, esatterwh...@wi.rr.com <
>>
>>
>>
>> esatterwh...@wi.rr.com> wrote:
>> > The Flex Framework is open source.
>>
>> > On Sep 16, 6:19 am, Sithembewena Lloyd Dube  wrote:
>> > > Thanks Shamail! I should have mentioned that I actually need
>> something
>> > > open-source :)
>>
>> > > On Thu, Sep 16, 2010 at 12:16 PM, Shamail Tayyab
>> > > >wrote:
>>
>> > > > On Thursday 16 September 2010 03:40 PM, Sithembewena Lloyd Dube
>> wrote:
>>
>> > > >> Hi all,
>>
>> > > >> I will soon be working on a Django site that will incorporate a
>> > heavily
>> > > >> customised chat app. The client wants voip capability.
>>
>> > > >> I've had a look at the Twisted framework, but I need to know
>> whether
>> > or
>> > > >> not there is anything else out there - perhaps tailored for use
>> with
>> > Django?
>>
>> > > >> --
>> > > >> Regards,
>> > > >> Sithembewena Lloyd Dube
>> > > >>http://www.lloyddube.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-us...@googlegroups.com.
>> > > >> To unsubscribe from this group, send email to
>> > > >> django-users+unsubscr...@googlegroups.com
>> > 
>> > > >> .
>> > > >> For more options, visit this group at
>> > > >>http://groups.google.com/group/django-users?hl=en.
>>
>> > > > If its VoIP, your best bet would be to use flash, accompanied
>> along
>> > with a
>> > > > media server, your chat can also work.
>> > > > Reason: You need live streaming.
>> > > > Wowza media server/Adobe FMS is what you should consider once.
>>
>> > > > Regards
>>
>> > > > --
>> > > > Shamail Tayyab
>> > > > Blog:http://shamail.in/blog
>>
>> > > > --
>> > > > You received this message because you are subscribed to the Google
>> > Groups
>> > > > "Django users" group.
>> > > > To post to this group, send email to
>> django-us...@googlegroups.com.
>> > > > To unsubscribe from this group, send email to
>> > > > django-users+unsubscr...@googlegroups.com
>> > 
>> > > > .
>> > > > For more options, visit this group at
>> > > >http://groups.google.com/group/django-users?hl=en.
>>
>> > > --
>> > > Regards,
>> > > Sithembewena Lloyd Dubehttp://www.lloyddube.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-us...@googlegroups.com.
>> > To unsubscribe from this group, send email to
>> > django-users+unsubscr...@googlegroups.com
>> > .
>> > For more options, visit this group at
>> >http://groups.google.com/group/django-users?hl=en.
>>
>> --
>> Regards,
>> Sithembewena Lloyd Dubehttp://www.lloyddube.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-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>


Rod Hamby  Sales Analyst
p:619 573 4231 X100
c:619 922 8895

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Multi-table + Abstract Model Inheritance

2010-09-16 Thread ringemup
Is it possible for a model to inherit from an abstract model, which in
turn inherits from a non-abstract model?

Here's an example.  In this case, the reason for using multi-table
inheritance rather than an explicit one-to-one relation would be that
the office addresses would be editable via office child model inlines
from the Business model's admin screen (i.e. not requiring the
currently-impossible nested inlines.)

Would this work, or blow up in my face (in subtle-or-not ways)?

class Address(models.Model):
  line_1 = models.Char_field(max_length=128)
  ...

class Business(models.Model):
  name = models.CharField(max_length=50)
  ...

class Office(Address):
  business = models.ForeignKey(Business, related_name='')
  phone = models.CharField(max_length=30)
  ...
  class Meta:
abstract = True

class DataCenter(Office):
  bandwidth = models.PositiveIntegerField()
  ...

class CorporateOffice(Office):
  office_manager = models.ForeignKey('Employee')
  ...

class Employee(models.Model):
  employer = models.ForeignKey(Business)
  home_address = models.ForeignKey(Address)

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Admin not using verbose_name on required fields

2010-09-16 Thread geraldcor
Hello all,

I am using the admin and fieldsets to display a change form as usual.
Some fields' labels, even with blank=True are being given the class
required and are not using the verbose_name argument either given via
keyword or positional usage. All fields that really are required
(blank=False) have this same problem. This brings up a few good
questions. Why are certain fields being called required when they are
not required and why are fields with the class required not using the
verbose_name?

http://dpaste.com/hold/244531/

Model snippet and full Admin for the model.

Thanks for any 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-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: virtualenv used with mod_wsgi

2010-09-16 Thread Jagdeep Singh Malhi


On Sep 16, 1:51 pm, Graham Dumpleton 
wrote:
> Then that directory isn't where it is installed, or the permissions on
> your directories are such that user that Apache runs as can't read
> that directory. Post a 'ls -las' directory listing of your site-
> packages directory and check that from that directory up to your home
> directory is readable to others.

my site-packages and /home/jagdeep/djangocms  are readable by other.

my Django is works fine but, me face problem with MySQLdb
error is : Error loading MySQLdb module: No module named MySQLdb

but its MySQLdb is already installed in my PC
i face  this problem, when i use  Virtual Python Environment
builder(virtualenv 1.5)

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-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Deply with mod_wsgi

2010-09-16 Thread Waléria Antunes David
Nuno...

Thank you very much. My problem was resolved.
Thanks again :)

Waléria.

On Thu, Sep 16, 2010 at 2:12 PM, Nuno Maltez  wrote:

> Well, my guess is that you should change the template responsible for
> the page in your second picture and fix the  tag that displays
> the graphic so that the source points to /simuladores/grafico/ instead
> of /grafico/
>
> Nuno
>
> On Thu, Sep 16, 2010 at 6:05 PM, Waléria Antunes David
>  wrote:
> > Yes, my graph is generated dynamically. Where do I change my code for
> this
> > error doesn't occur and my image appears?
> >
> > On Thu, Sep 16, 2010 at 1:56 PM, Nuno Maltez 
> wrote:
> >>
> >> At a glance: is your graphic dynamically generated and served by
> >> Django? If so, shouldn't the the src of the img tag point
> >> to /simuladores/grafico/ - or something under /simuladores where the
> >> wsgi script can catch it - instead of /grafico ?
> >>
> >> If your code is writing the image to the filesystem, is it writing it
> >> to /var/www/django/grafico ?
> >>
> >> hth,
> >> Nuno
> >>
> >>
> >> On Thu, Sep 16, 2010 at 12:30 PM, Waléria Antunes David
> >>  wrote:
> >> > Hi all,
> >> >
> >> > I need to put my project on the web server. I installed the Python,
> >> > Django,
> >> > mod_wsgi and configured the VirtualHost file:
> >> > http://pastebin.com/Xe7SqhM1
> >> > and created the script for the WSGI: http://pastebin.com/jgLHipnB
> >> > Attached below two images of my project in the browser. My problem is,
> >> > in
> >> > the first image i  pass values end click on make curve to generate a
> >> > graph
> >> > but an error is written in log_error: http://pastebin.com/ZPzdC5c8
> and
> >> > a
> >> > graphic is not displayed. See second image.
> >> >
> >> > What would be?
> >> >
> >> > 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-us...@googlegroups.com.
> >> > To unsubscribe from this group, send email to
> >> > django-users+unsubscr...@googlegroups.com
> .
> >> > For more options, visit this group at
> >> > http://groups.google.com/group/django-users?hl=en.
> >> >
> >>
> >> --
> >> You received this message because you are subscribed to the Google
> Groups
> >> "Django users" group.
> >> To post to this group, send email to django-us...@googlegroups.com.
> >> To unsubscribe from this group, send email to
> >> django-users+unsubscr...@googlegroups.com
> .
> >> For more options, visit this group at
> >> http://groups.google.com/group/django-users?hl=en.
> >>
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Django users" group.
> > To post to this group, send email to django-us...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > django-users+unsubscr...@googlegroups.com
> .
> > For more options, visit this group at
> > http://groups.google.com/group/django-users?hl=en.
> >
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django Chat App?

2010-09-16 Thread Yo-Yo Ma
This might not be any help since I know nothing of VOIP, but for the
chat portion take a look in to Ape ( a comet server written in C ).

On Sep 16, 9:41 am, Sithembewena Lloyd Dube  wrote:
> Indeed it is, but the media server isn't :).
>
> On Thu, Sep 16, 2010 at 5:35 PM, esatterwh...@wi.rr.com <
>
>
>
> esatterwh...@wi.rr.com> wrote:
> > The Flex Framework is open source.
>
> > On Sep 16, 6:19 am, Sithembewena Lloyd Dube  wrote:
> > > Thanks Shamail! I should have mentioned that I actually need something
> > > open-source :)
>
> > > On Thu, Sep 16, 2010 at 12:16 PM, Shamail Tayyab  > >wrote:
>
> > > > On Thursday 16 September 2010 03:40 PM, Sithembewena Lloyd Dube wrote:
>
> > > >> Hi all,
>
> > > >> I will soon be working on a Django site that will incorporate a
> > heavily
> > > >> customised chat app. The client wants voip capability.
>
> > > >> I've had a look at the Twisted framework, but I need to know whether
> > or
> > > >> not there is anything else out there - perhaps tailored for use with
> > Django?
>
> > > >> --
> > > >> Regards,
> > > >> Sithembewena Lloyd Dube
> > > >>http://www.lloyddube.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-us...@googlegroups.com.
> > > >> To unsubscribe from this group, send email to
> > > >> django-users+unsubscr...@googlegroups.com
> > 
> > > >> .
> > > >> For more options, visit this group at
> > > >>http://groups.google.com/group/django-users?hl=en.
>
> > > > If its VoIP, your best bet would be to use flash, accompanied along
> > with a
> > > > media server, your chat can also work.
> > > > Reason: You need live streaming.
> > > > Wowza media server/Adobe FMS is what you should consider once.
>
> > > > Regards
>
> > > > --
> > > > Shamail Tayyab
> > > > Blog:http://shamail.in/blog
>
> > > > --
> > > > You received this message because you are subscribed to the Google
> > Groups
> > > > "Django users" group.
> > > > To post to this group, send email to django-us...@googlegroups.com.
> > > > To unsubscribe from this group, send email to
> > > > django-users+unsubscr...@googlegroups.com
> > 
> > > > .
> > > > For more options, visit this group at
> > > >http://groups.google.com/group/django-users?hl=en.
>
> > > --
> > > Regards,
> > > Sithembewena Lloyd Dubehttp://www.lloyddube.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-us...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > django-users+unsubscr...@googlegroups.com
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/django-users?hl=en.
>
> --
> Regards,
> Sithembewena Lloyd Dubehttp://www.lloyddube.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-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Deply with mod_wsgi

2010-09-16 Thread Nuno Maltez
Well, my guess is that you should change the template responsible for
the page in your second picture and fix the  tag that displays
the graphic so that the source points to /simuladores/grafico/ instead
of /grafico/

Nuno

On Thu, Sep 16, 2010 at 6:05 PM, Waléria Antunes David
 wrote:
> Yes, my graph is generated dynamically. Where do I change my code for this
> error doesn't occur and my image appears?
>
> On Thu, Sep 16, 2010 at 1:56 PM, Nuno Maltez  wrote:
>>
>> At a glance: is your graphic dynamically generated and served by
>> Django? If so, shouldn't the the src of the img tag point
>> to /simuladores/grafico/ - or something under /simuladores where the
>> wsgi script can catch it - instead of /grafico ?
>>
>> If your code is writing the image to the filesystem, is it writing it
>> to /var/www/django/grafico ?
>>
>> hth,
>> Nuno
>>
>>
>> On Thu, Sep 16, 2010 at 12:30 PM, Waléria Antunes David
>>  wrote:
>> > Hi all,
>> >
>> > I need to put my project on the web server. I installed the Python,
>> > Django,
>> > mod_wsgi and configured the VirtualHost file:
>> > http://pastebin.com/Xe7SqhM1
>> > and created the script for the WSGI: http://pastebin.com/jgLHipnB
>> > Attached below two images of my project in the browser. My problem is,
>> > in
>> > the first image i  pass values end click on make curve to generate a
>> > graph
>> > but an error is written in log_error: http://pastebin.com/ZPzdC5c8  and
>> > a
>> > graphic is not displayed. See second image.
>> >
>> > What would be?
>> >
>> > 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-us...@googlegroups.com.
>> > To unsubscribe from this group, send email to
>> > django-users+unsubscr...@googlegroups.com.
>> > For more options, visit this group at
>> > http://groups.google.com/group/django-users?hl=en.
>> >
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To post to this group, send email to django-us...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Deply with mod_wsgi

2010-09-16 Thread Waléria Antunes David
Yes, my graph is generated dynamically. Where do I change my code for this
error doesn't occur and my image appears?

On Thu, Sep 16, 2010 at 1:56 PM, Nuno Maltez  wrote:

> At a glance: is your graphic dynamically generated and served by
> Django? If so, shouldn't the the src of the img tag point
> to /simuladores/grafico/ - or something under /simuladores where the
> wsgi script can catch it - instead of /grafico ?
>
> If your code is writing the image to the filesystem, is it writing it
> to /var/www/django/grafico ?
>
> hth,
> Nuno
>
>
> On Thu, Sep 16, 2010 at 12:30 PM, Waléria Antunes David
>  wrote:
> > Hi all,
> >
> > I need to put my project on the web server. I installed the Python,
> Django,
> > mod_wsgi and configured the VirtualHost file:
> http://pastebin.com/Xe7SqhM1
> > and created the script for the WSGI: http://pastebin.com/jgLHipnB
> > Attached below two images of my project in the browser. My problem is, in
> > the first image i  pass values end click on make curve to generate a
> graph
> > but an error is written in log_error: http://pastebin.com/ZPzdC5c8  and
> a
> > graphic is not displayed. See second image.
> >
> > What would be?
> >
> > 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-us...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > django-users+unsubscr...@googlegroups.com
> .
> > For more options, visit this group at
> > http://groups.google.com/group/django-users?hl=en.
> >
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Deply with mod_wsgi

2010-09-16 Thread Nuno Maltez
At a glance: is your graphic dynamically generated and served by
Django? If so, shouldn't the the src of the img tag point
to /simuladores/grafico/ - or something under /simuladores where the
wsgi script can catch it - instead of /grafico ?

If your code is writing the image to the filesystem, is it writing it
to /var/www/django/grafico ?

hth,
Nuno


On Thu, Sep 16, 2010 at 12:30 PM, Waléria Antunes David
 wrote:
> Hi all,
>
> I need to put my project on the web server. I installed the Python, Django,
> mod_wsgi and configured the VirtualHost file: http://pastebin.com/Xe7SqhM1
> and created the script for the WSGI: http://pastebin.com/jgLHipnB
> Attached below two images of my project in the browser. My problem is, in
> the first image i  pass values end click on make curve to generate a graph
> but an error is written in log_error: http://pastebin.com/ZPzdC5c8  and a
> graphic is not displayed. See second image.
>
> What would be?
>
> 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-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



named admin url w filter

2010-09-16 Thread Carl Karsten
Is there a better way to do:

{% url admin:main_episode_changelist %}?show__id__exact={{show.id}}

I tried:
{% url admin:main_episode_changelist show__id__exact=show.id %}
Caught NoReverseMatch while rendering: Reverse for
'main_episode_changelist' with arguments '()' and keyword arguments
'{'show__id__exact': 6}' not found.

-- 
Carl K

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: How do I troubleshoot mod_wsgi 404 admin issues

2010-09-16 Thread Bill Freeman
Well, you have to hope that behavior under the development server
gives you a clue where to put the prints, or breakpoints.  You might
find yourself patching a piece of middleware to look for the
troublesome path and only doing a set_trace() for it.  Then you can
single step your way into the url decoding code (another place to
potentially put the set_trace() for your case) until you are surprised
by the result.

Note that since this involves patching django itself, you may want to
do this in a virtualenv.

On Thu, Sep 16, 2010 at 11:58 AM, dclaar  wrote:
> Actually, DEBUG *is* on in the production instance. And yet, all I get
> is the "No Testbeds match..." message, which was a bit surprising to
> me. Without DEBUG, I just get a 404 not found. I'll try the clone
> idea. The problem I have is: Where do I put the print statements? The
> admin stuff is automagically generated from admin.py and models.py, so
> I don't know where to hook.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



What is `sys.path` supposed to be?

2010-09-16 Thread cool-RR
Hello!

There's something that's bothering me:

When developing a Django application, what is `sys.path` supposed to
contain? The directory which contains the project, or the directory of
the project, or both?

What led me to this question is a failure when using
`urlresolvers.reverse`. It's giving me a `NoReverseMatch` error, and
it seems that the reason is that there are two different versions of
my view function; One with a `__module__` of `my_app.views` and one
with a `__module__` of `my_project.my_app.views`. Because of Python
weirdness, these two different versions of the same function are not
considered identical to each other:

http://bugs.python.org/issue9872


Please help...


Ram.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: How do I get rid of the "Something object" text in inlines?

2010-09-16 Thread hejsan
Thanks a bunch

On Sep 16, 2:39 pm, Daniel Roseman  wrote:
> On Sep 16, 3:06 pm, hejsan  wrote:
>
> > When adding an inline object, there is always the text "Something
> > object" displayed above the first column.
> > (Replace "Something" with the classname of the inline object)
>
> > How do I get rid of that? Please don't tell me I have to override the
> > template..
>
> > Thanks
>
> To get rid of it, yes you do. To replace it with something useful,
> just define the __unicode__ method on the related model.
> --
> 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-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: How do I get rid of the "Something object" text in inlines?

2010-09-16 Thread hejsan
Thanks a bunch.

On Sep 16, 2:39 pm, Daniel Roseman  wrote:
> On Sep 16, 3:06 pm, hejsan  wrote:
>
> > When adding an inline object, there is always the text "Something
> > object" displayed above the first column.
> > (Replace "Something" with the classname of the inline object)
>
> > How do I get rid of that? Please don't tell me I have to override the
> > template..
>
> > Thanks
>
> To get rid of it, yes you do. To replace it with something useful,
> just define the __unicode__ method on the related model.
> --
> 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-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: How do I troubleshoot mod_wsgi 404 admin issues

2010-09-16 Thread dclaar
Actually, DEBUG *is* on in the production instance. And yet, all I get
is the "No Testbeds match..." message, which was a bit surprising to
me. Without DEBUG, I just get a 404 not found. I'll try the clone
idea. The problem I have is: Where do I put the print statements? The
admin stuff is automagically generated from admin.py and models.py, so
I don't know where to hook.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django Chat App?

2010-09-16 Thread Sithembewena Lloyd Dube
Indeed it is, but the media server isn't :).

On Thu, Sep 16, 2010 at 5:35 PM, esatterwh...@wi.rr.com <
esatterwh...@wi.rr.com> wrote:

> The Flex Framework is open source.
>
> On Sep 16, 6:19 am, Sithembewena Lloyd Dube  wrote:
> > Thanks Shamail! I should have mentioned that I actually need something
> > open-source :)
> >
> > On Thu, Sep 16, 2010 at 12:16 PM, Shamail Tayyab  >wrote:
> >
> >
> >
> >
> >
> > > On Thursday 16 September 2010 03:40 PM, Sithembewena Lloyd Dube wrote:
> >
> > >> Hi all,
> >
> > >> I will soon be working on a Django site that will incorporate a
> heavily
> > >> customised chat app. The client wants voip capability.
> >
> > >> I've had a look at the Twisted framework, but I need to know whether
> or
> > >> not there is anything else out there - perhaps tailored for use with
> Django?
> >
> > >> --
> > >> Regards,
> > >> Sithembewena Lloyd Dube
> > >>http://www.lloyddube.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-us...@googlegroups.com.
> > >> To unsubscribe from this group, send email to
> > >> django-users+unsubscr...@googlegroups.com
> 
> > >> .
> > >> For more options, visit this group at
> > >>http://groups.google.com/group/django-users?hl=en.
> >
> > > If its VoIP, your best bet would be to use flash, accompanied along
> with a
> > > media server, your chat can also work.
> > > Reason: You need live streaming.
> > > Wowza media server/Adobe FMS is what you should consider once.
> >
> > > Regards
> >
> > > --
> > > Shamail Tayyab
> > > Blog:http://shamail.in/blog
> >
> > > --
> > > You received this message because you are subscribed to the Google
> Groups
> > > "Django users" group.
> > > To post to this group, send email to django-us...@googlegroups.com.
> > > To unsubscribe from this group, send email to
> > > django-users+unsubscr...@googlegroups.com
> 
> > > .
> > > For more options, visit this group at
> > >http://groups.google.com/group/django-users?hl=en.
> >
> > --
> > Regards,
> > Sithembewena Lloyd Dubehttp://www.lloyddube.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-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>


-- 
Regards,
Sithembewena Lloyd Dube
http://www.lloyddube.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-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: unit testing and not creating database for read only database

2010-09-16 Thread keith
created http://code.djangoproject.com/ticket/14296

On Sep 16, 4:22 pm, keith  wrote:
> I have the same problem, have you logged a ticket for 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-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django Chat App?

2010-09-16 Thread esatterwh...@wi.rr.com
The Flex Framework is open source.

On Sep 16, 6:19 am, Sithembewena Lloyd Dube  wrote:
> Thanks Shamail! I should have mentioned that I actually need something
> open-source :)
>
> On Thu, Sep 16, 2010 at 12:16 PM, Shamail Tayyab wrote:
>
>
>
>
>
> > On Thursday 16 September 2010 03:40 PM, Sithembewena Lloyd Dube wrote:
>
> >> Hi all,
>
> >> I will soon be working on a Django site that will incorporate a heavily
> >> customised chat app. The client wants voip capability.
>
> >> I've had a look at the Twisted framework, but I need to know whether or
> >> not there is anything else out there - perhaps tailored for use with 
> >> Django?
>
> >> --
> >> Regards,
> >> Sithembewena Lloyd Dube
> >>http://www.lloyddube.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-us...@googlegroups.com.
> >> To unsubscribe from this group, send email to
> >> django-users+unsubscr...@googlegroups.com >>  groups.com>
> >> .
> >> For more options, visit this group at
> >>http://groups.google.com/group/django-users?hl=en.
>
> > If its VoIP, your best bet would be to use flash, accompanied along with a
> > media server, your chat can also work.
> > Reason: You need live streaming.
> > Wowza media server/Adobe FMS is what you should consider once.
>
> > Regards
>
> > --
> > Shamail Tayyab
> > Blog:http://shamail.in/blog
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Django users" group.
> > To post to this group, send email to django-us...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > django-users+unsubscr...@googlegroups.com > groups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/django-users?hl=en.
>
> --
> Regards,
> Sithembewena Lloyd Dubehttp://www.lloyddube.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-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: unit testing and not creating database for read only database

2010-09-16 Thread keith
I have the same problem, have you logged a ticket for 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-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



testing app with multi db's one of which is read-only

2010-09-16 Thread keith
I have an app that accesses two different databases which are defined
in settings.py
one of them is read-only and its models all have managed=False, when i
run 'manage.py test', unsurprisingly i guess, i get an insufficient
privileges error when trying to create/destroy
the testing database on the read-only database.

is this a bug or and rfe?

is there a quick workaround? i'd love to be able to run tests on the
this app.

thx
Keith

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Tools to ease template/ui development

2010-09-16 Thread russellneufeld
PyCharm is incredible.  Django (with template) support.  Integrated
version control with git, svn, and more.  Best debugger out there for
python by far. Can't say enough good things about 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-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Launching Background Processes from a View

2010-09-16 Thread Paul Winkler
On Sep 16, 10:11 am, Heath  wrote:
> My eventual solution was to just rework the way my watcher scripts
> execute. I now use celery and rabbitMQ, and let pyInotify send a new
> job to any available worker. For my application, 20 or so workers is
> fine and this can scale as needed.
>
> I'm still looking for a definitive answer on whether  the built-in
> process
> modules cannot launch and detach a process in the background, (ala
> "nohup   &" ) and return control to the view.

Sure they can. Check the docs for the subprocess module,
specifically the P_NOWAIT example.

- PW

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: How do I get rid of the "Something object" text in inlines?

2010-09-16 Thread Daniel Roseman
On Sep 16, 3:06 pm, hejsan  wrote:
> When adding an inline object, there is always the text "Something
> object" displayed above the first column.
> (Replace "Something" with the classname of the inline object)
>
> How do I get rid of that? Please don't tell me I have to override the
> template..
>
> Thanks

To get rid of it, yes you do. To replace it with something useful,
just define the __unicode__ method on the related model.
--
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-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Launching Background Processes from a View

2010-09-16 Thread Brian Bouterse
Yes, python multiprocessing can spawn background threads.  Just spawn the
thread and don't join() it.  You could also call things linux things like
nohup through the python process module.

On Thu, Sep 16, 2010 at 10:11 AM, Heath  wrote:

> My eventual solution was to just rework the way my watcher scripts
> execute. I now use celery and rabbitMQ, and let pyInotify send a new
> job to any available worker. For my application, 20 or so workers is
> fine and this can scale as needed.
>
> I'm still looking for a definitive answer on whether  the built-in
> process
> modules cannot launch and detach a process in the background, (ala
> "nohup   &" ) and return control to the view.
>
> Thanks for the responses.
>
> -h
>
>
>
>
> On Sep 6, 12:05 pm, kmpm  wrote:
> > I have been using Celery some and from what I got I thought the
> > concurrency/workers in the config controlled how many processes that
> > would be at maximum started from the worker that checks the queue but
> > I could be wrong. Another twist on the celery thing is that you could
> > actually have several machines looking at the same config+queue and
> > spreading the load among them and if the queue grows to big you could
> > start up even more servers/machines dealing with the increased load
> > until things cool down again.
> > This is a blog entry I found talking about some of the advantages of
> > Celery.
> http://ericholscher.com/blog/2010/jun/23/large-problems-django-mostly...
> >
> > /kmpm
> >
> > On Sep 6, 7:20 pm, Heath  wrote:
> >
> > > Thanks! yes,
> >
> > > os.system() will launch the process and return control, but then I'd
> > > have to write a utility to get the PID and other data about the
> > > process.
> >
> > > I guess I'm looking for a definitive answer that the built-in process
> > > modules cannot launch a process in thebackground.
> >
> > > Here are my findings:
> >
> > > subprocess.Popen and multiprocessing offer properties and methods
> > > ideal for my task, but won't return to the view until the process
> > > ends.
> > > Daemonizing these will allow the calling script (django, in this case)
> > > to quit, but still won't return from the view.
> >
> > > celery/gettoq/rabbitMQ allows for the creation of a queue, but you
> > > must specify a predefined (as far as I know) number of workers in the
> > > config. This is great for processor-intensive tasks that may only run
> > > for a short period of time, as the worker pool stays the same size,
> > > and processes new requests when there is a worker available. But, in
> > > my case, the processes are not doing much until there is folder
> > > activity, and I need to add worker instances dynamically.
> >
> > > I feel like I'm just missing something..Launchingsystem processes
> > > must be a common idiom for a web app, no?
> >
> > > I do appreciate the response,
> >
> > > -heath carlisle
> >
> > > On Sep 6, 12:25 am, Aljoša Mohorović 
> > > wrote:
> >
> > > > On Mon, Sep 6, 2010 at 7:19 AM, Heath  wrote:
> > > > > What I require seems simple, just run the requested process in the
> > > > >background. The terminal equivalent would be:
> >
> > > > > "nohup   &" and return control to the view.
> >
> > > > > Any ideas on how to achieve this?
> >
> > > > if this already works in a shell is there some reason why
> > > > "os.system('cmd')" or something similar doesn't work for you?
> >
> > > > Aljosa Mohorovic
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>


-- 
Brian Bouterse
ITng Services

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Unit testing in django without using test client

2010-09-16 Thread Paul Winkler
On Sep 16, 10:11 am, girish shabadimath 
wrote:
> thanks for reply,
> actually i used unit test to test urls and other view functions,,,there is a
> module called Client() in django which acts as a browser to test urls,,,
>
> my problem is ,i want to test other methods in my project,,, how to do
> so, without making use of django's test client..?..

Exactly the same way you test any other python code. What's the
problem?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Unit testing in django without using test client

2010-09-16 Thread girish shabadimath
thanks for reply,
actually i used unit test to test urls and other view functions,,,there is a
module called Client() in django which acts as a browser to test urls,,,

my problem is ,i want to test other methods in my project,,, how to do
so, without making use of django's test client..?..


On Thu, Sep 16, 2010 at 7:27 PM, Shawn Milochik  wrote:

> You can use Python's unittest module to test any Python code (including
> Django code).
>
> What is it about Django's test client or TestCase class that is a problem
> for you?
>
> Shawn
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>


-- 
Girish M S

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Launching Background Processes from a View

2010-09-16 Thread Heath
My eventual solution was to just rework the way my watcher scripts
execute. I now use celery and rabbitMQ, and let pyInotify send a new
job to any available worker. For my application, 20 or so workers is
fine and this can scale as needed.

I'm still looking for a definitive answer on whether  the built-in
process
modules cannot launch and detach a process in the background, (ala
"nohup   &" ) and return control to the view.

Thanks for the responses.

-h




On Sep 6, 12:05 pm, kmpm  wrote:
> I have been using Celery some and from what I got I thought the
> concurrency/workers in the config controlled how many processes that
> would be at maximum started from the worker that checks the queue but
> I could be wrong. Another twist on the celery thing is that you could
> actually have several machines looking at the same config+queue and
> spreading the load among them and if the queue grows to big you could
> start up even more servers/machines dealing with the increased load
> until things cool down again.
> This is a blog entry I found talking about some of the advantages of
> Celery.  
> http://ericholscher.com/blog/2010/jun/23/large-problems-django-mostly...
>
> /kmpm
>
> On Sep 6, 7:20 pm, Heath  wrote:
>
> > Thanks! yes,
>
> > os.system() will launch the process and return control, but then I'd
> > have to write a utility to get the PID and other data about the
> > process.
>
> > I guess I'm looking for a definitive answer that the built-in process
> > modules cannot launch a process in thebackground.
>
> > Here are my findings:
>
> > subprocess.Popen and multiprocessing offer properties and methods
> > ideal for my task, but won't return to the view until the process
> > ends.
> > Daemonizing these will allow the calling script (django, in this case)
> > to quit, but still won't return from the view.
>
> > celery/gettoq/rabbitMQ allows for the creation of a queue, but you
> > must specify a predefined (as far as I know) number of workers in the
> > config. This is great for processor-intensive tasks that may only run
> > for a short period of time, as the worker pool stays the same size,
> > and processes new requests when there is a worker available. But, in
> > my case, the processes are not doing much until there is folder
> > activity, and I need to add worker instances dynamically.
>
> > I feel like I'm just missing something..Launchingsystem processes
> > must be a common idiom for a web app, no?
>
> > I do appreciate the response,
>
> > -heath carlisle
>
> > On Sep 6, 12:25 am, Aljoša Mohorović 
> > wrote:
>
> > > On Mon, Sep 6, 2010 at 7:19 AM, Heath  wrote:
> > > > What I require seems simple, just run the requested process in the
> > > >background. The terminal equivalent would be:
>
> > > > "nohup   &" and return control to the view.
>
> > > > Any ideas on how to achieve this?
>
> > > if this already works in a shell is there some reason why
> > > "os.system('cmd')" or something similar doesn't work for you?
>
> > > Aljosa Mohorovic

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



How do I get rid of the "Something object" text in inlines?

2010-09-16 Thread hejsan
When adding an inline object, there is always the text "Something
object" displayed above the first column.
(Replace "Something" with the classname of the inline object)

How do I get rid of that? Please don't tell me I have to override the
template..

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-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Help :django registration - the account activation gives error messages

2010-09-16 Thread failuch
Hello, all.
I have a problem with django registration v 0.8.
 I use register and activate signals and I indeed got these signals
and my functions worked well, except that account activation produces
an error message.

This error message gets printed if template did not have account
variable.

I really do not understand this, please advice

ThX


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django and third party python apps, best practices for path locations?

2010-09-16 Thread werefr0g

 Hello,

I think you should use virtualenv for lot of reasons:

* it is easy to use
* you can even change you python interpreter according context without 
mixing accidentally libs from previous version, for example
* you can test if upgrading a library, module, app doesn't break your 
project (you can try to upgrade Django for example) non-regression

* you'll know precisely requirements of each project
* you can reproduce live server environment (current and future)

Comparing using or not using virtualenv, you'll spend more energy to 
"manually" manage libraries than using virtualenv each time.


Regards,

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: How do I troubleshoot mod_wsgi 404 admin issues

2010-09-16 Thread Bill Freeman
I think that I'd start by making a clone, on some development box,
run using the development server, but with SUB_SITE='perf/'.
The removes the most glaring difference between your development
and production versions.  If it fails there you have full recourse to
print statements and pdb.

That said, you could also try turning on DEBUG, temporarily, in the
production instance.  This will give you the friendly list of url patterns
tried, and what they were trying to match.  Hopefully.  And it might
just be obvious from there.

Bill

On Wed, Sep 15, 2010 at 6:02 PM, dclaar  wrote:
> I'm having a problem where admin of my models works fine in the
> development server, but fails in production, where I'm using mod_wsgi.
>
> Here's the relevant parts of my urls.py:
>
> from django.conf.urls.defaults import *
> from django.contrib import admin
> admin.autodiscover()
>
> from django.conf import settings
>
> urlpatterns=patterns('',
>    (r'%sadmin/' %settings.SUB_SITE, include(admin.site.urls)),
> )
>
> For production, SUB_SITE='', for development, SUB_SITE = 'perf/'. This
> is part of the whole "make django run in a sub-directory" dance. It
> works for most everything, including things such as perf/admin/sites/
> site/, and it even works for perf/admin/manager/testbeds/, showing all
> of the testbeds in the DB. But if I try to add, or click on one of the
> entries to change it, I get "No TestBed matches the given query" (and
> that's it, even though I have DEBUG turned on) in production. But when
> I try to troubleshoot it with the development server, it works just
> fine! This is frustrating...
>
> So, how do I figure out why these are operating differently, and to
> fix it? I'm not ever sure what query that it is talking about!
>
> 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-us...@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Unit testing in django without using test client

2010-09-16 Thread Shawn Milochik
You can use Python's unittest module to test any Python code (including Django 
code).

What is it about Django's test client or TestCase class that is a problem for 
you?

Shawn

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: how to replace "Congratulations on your first Django-powered page." with my home page

2010-09-16 Thread Sithembewena Lloyd Dube
Start here and work your way through the whole tutorial :
http://docs.djangoproject.com/en/1.2/intro/tutorial01/#intro-tutorial01


On Thu, Sep 16, 2010 at 7:25 AM, perfecthills wrote:

> Have a website build on django, i desire to transfer the website to a
> new domain, i already created the application and even website at
> webfaction, i have even copied the entire code of the previous site to
> the ftp of the new website iwant. well being new, all i get is
>
>
> It worked!
> Congratulations on your first Django-powered page.
>
> Of course, you haven't actually done any work yet. Here's what to do
> next:
>
>* If you plan to use a database, edit the DATABASES setting in
> myproject/settings.py.
>* Start your first app by running python myproject/manage.py
> startapp [appname].
>
> You're seeing this message because you have DEBUG = True in your
> Django settings file and you haven't configured any URLs. Get to work!
>
>
> can someone suggest what else i need to do.
> thanx
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>


-- 
Regards,
Sithembewena Lloyd Dube
http://www.lloyddube.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-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: problem with block tag and autoescaping

2010-09-16 Thread Julian Moritz
Am Donnerstag, den 16.09.2010, 11:18 +0100 schrieb Nuno Maltez:
> On Wed, Sep 15, 2010 at 4:50 PM, Julian  wrote:
> > before returning, all paramaters in the urls are separated by & as
> > they should be. in the template the & occur as &. for example, the
> > url is print'ed in the tag:
> >
> > /go/to/url?
> > utts=-1&utsrc=trackuser&utsig=f6730dc992ee9a23c24ed0adae0eb5f6
> >
> > and in the template it looks like
> >
> > test > a>
> 
> Sorry I can't help you much (never happened to me) but:
> 
> a) are you sure it's not beautifulsoup that's replacing your &?
> 
> b) shouldn't they be really separated by "&"? Using & will cause
> validation errors:
> http://htmlhelp.com/tools/validator/problems.html#amp
> 

Hi there,

I've just realized that it's not a bug but a feature. The browsers
handle it correctly.

Thanks & Regards
Julian

> Nuno
> 


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django Chat App?

2010-09-16 Thread Sithembewena Lloyd Dube
Thanks Shamail! I should have mentioned that I actually need something
open-source :)

On Thu, Sep 16, 2010 at 12:16 PM, Shamail Tayyab wrote:

> On Thursday 16 September 2010 03:40 PM, Sithembewena Lloyd Dube wrote:
>
>> Hi all,
>>
>> I will soon be working on a Django site that will incorporate a heavily
>> customised chat app. The client wants voip capability.
>>
>> I've had a look at the Twisted framework, but I need to know whether or
>> not there is anything else out there - perhaps tailored for use with Django?
>>
>> --
>> Regards,
>> Sithembewena Lloyd Dube
>> http://www.lloyddube.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-us...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+unsubscr...@googlegroups.com
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>
> If its VoIP, your best bet would be to use flash, accompanied along with a
> media server, your chat can also work.
> Reason: You need live streaming.
> Wowza media server/Adobe FMS is what you should consider once.
>
> Regards
>
> --
> Shamail Tayyab
> Blog: http://shamail.in/blog
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>


-- 
Regards,
Sithembewena Lloyd Dube
http://www.lloyddube.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-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Unit testing in django without using test client

2010-09-16 Thread girish shabadimath
hi,,,

i need to do unit testing in one of d django project, is there any other way
to test functions ( or methods ) without using test client..?

-- 
Girish M S

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: have to use older versions of django/python

2010-09-16 Thread Carlton


On Sep 16, 12:00 pm, Carlton Gibson  wrote:

> Here's the links:
> Python Package Index : pip 0.8.1
> virtualenv — virtualenv v1.5 documentation
>
> This I found useful:
> Tools of the Modern Python Hacker: Virtualenv, Fabric and Pip - 
> electronic.habitat : alex.clemesha
> (If you follow this I'd recommend doing `easy_install pip` first and then 
> just using pip after that.)

Right, that broke:

pip: http://pypi.python.org/pypi/pip
virtualenv: http://virtualenv.openplans.org/

blog_post: 
http://www.clemesha.org/blog/modern-python-hacker-tools-virtualenv-fabric-pip

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: have to use older versions of django/python

2010-09-16 Thread Carlton Gibson
HI Wendy, 

On 15 Sep 2010, at 23:10, Wendy wrote:

> I am pretty new to all this though, so if anyone has any tips that
> will save me from tearing my hair out, correct order of doing things,
> etc. I'd really appreciate it.  Any advice would be appreciated.

Once you've got your Python version installed I would then:

1. Install PIP and virtualenv. 
2. Create a virtualenv for your project using the --no-site-packages flag.
3. Use PIP to install everything your project needs beyond that, including your 
Django version.

Here's the links: 
Python Package Index : pip 0.8.1
virtualenv — virtualenv v1.5 documentation

This I found useful: 
Tools of the Modern Python Hacker: Virtualenv, Fabric and Pip - 
electronic.habitat : alex.clemesha
(If you follow this I'd recommend doing `easy_install pip` first and then just 
using pip after that.)

HTH.

Regards,
Carlton

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



how to replace "Congratulations on your first Django-powered page." with my home page

2010-09-16 Thread perfecthills
Have a website build on django, i desire to transfer the website to a
new domain, i already created the application and even website at
webfaction, i have even copied the entire code of the previous site to
the ftp of the new website iwant. well being new, all i get is


It worked!
Congratulations on your first Django-powered page.

Of course, you haven't actually done any work yet. Here's what to do
next:

* If you plan to use a database, edit the DATABASES setting in
myproject/settings.py.
* Start your first app by running python myproject/manage.py
startapp [appname].

You're seeing this message because you have DEBUG = True in your
Django settings file and you haven't configured any URLs. Get to work!


can someone suggest what else i need to do.
thanx

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: have to use older versions of django/python

2010-09-16 Thread Christian Ştefănescu
Hello,

what OS are you using and which version?


On Thursday, September 16, 2010, Wendy  wrote:
> Hello,
> I've just been told that I have to run my project on the server with
> django 1.0, python 2.5, when previously I was told I could use any
> version I wanted, so I've been using python 2.6.1 and django 1.2.
> Ugh, another wrinkle added to deployment.  I think it's possible that
> it'll work, and I've been asked to test it locally. I'm seeing that I
> can use virtualenv to switch my python environment, and I'm pretty
> sure I already have 2.5 installed on my machine, although it's using a
> newer version of django too.
>
> I'm using mostly generic views, it's not a very complicated project
> and I've looked at documentation to see what might have changed, knock
> on wood it looks ok.  I am using django-sorting and django-pagination,
> not sure if these will work with the older version.
>
> I am pretty new to all this though, so if anyone has any tips that
> will save me from tearing my hair out, correct order of doing things,
> etc. I'd really appreciate it.  Any advice would be appreciated.
>
> Thanks,
> Wendy
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
Mit freundlichen Grüßen,
Christian Stefanescu

Kaiserdamm 11, 14057 Berlin, Deutschland, Europa, Erde, Milchstrasse
st.ch...@gmail.com
+49 (0)1578 455 3320

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: problem with block tag and autoescaping

2010-09-16 Thread Nuno Maltez
On Wed, Sep 15, 2010 at 4:50 PM, Julian  wrote:
> before returning, all paramaters in the urls are separated by & as
> they should be. in the template the & occur as &. for example, the
> url is print'ed in the tag:
>
> /go/to/url?
> utts=-1&utsrc=trackuser&utsig=f6730dc992ee9a23c24ed0adae0eb5f6
>
> and in the template it looks like
>
> test a>

Sorry I can't help you much (never happened to me) but:

a) are you sure it's not beautifulsoup that's replacing your &?

b) shouldn't they be really separated by "&"? Using & will cause
validation errors:
http://htmlhelp.com/tools/validator/problems.html#amp

Nuno

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django Chat App?

2010-09-16 Thread Shamail Tayyab

On Thursday 16 September 2010 03:40 PM, Sithembewena Lloyd Dube wrote:

Hi all,

I will soon be working on a Django site that will incorporate a 
heavily customised chat app. The client wants voip capability.


I've had a look at the Twisted framework, but I need to know whether 
or not there is anything else out there - perhaps tailored for use 
with Django?


--
Regards,
Sithembewena Lloyd Dube
http://www.lloyddube.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-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.


If its VoIP, your best bet would be to use flash, accompanied along with 
a media server, your chat can also work.

Reason: You need live streaming.
Wowza media server/Adobe FMS is what you should consider once.

Regards

--
Shamail Tayyab
Blog: http://shamail.in/blog

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Django Chat App?

2010-09-16 Thread Sithembewena Lloyd Dube
Hi all,

I will soon be working on a Django site that will incorporate a heavily
customised chat app. The client wants voip capability.

I've had a look at the Twisted framework, but I need to know whether or not
there is anything else out there - perhaps tailored for use with Django?

-- 
Regards,
Sithembewena Lloyd Dube
http://www.lloyddube.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-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: virtualenv used with mod_wsgi

2010-09-16 Thread Graham Dumpleton

Then that directory isn't where it is installed, or the permissions on
your directories are such that user that Apache runs as can't read
that directory. Post a 'ls -las' directory listing of your site-
packages directory and check that from that directory up to your home
directory is readable to others.

Also move that sys.path.append() to before you import
django.core.handlers.wsgi. This will not solve the problem, but you
are updating it after everything else, which is a bit weird. Only
works because Django only requires it the first time a request
arrives.

Graham

On Sep 16, 5:28 pm, Jagdeep Singh Malhi 
wrote:
> On Sep 16, 2:25 am, Graham Dumpleton 
> wrote:> You need to add it to sys.path in WSGI script file. The PYTHONPATH
> > in .bashrc of your personal account isn't used by Apache/mod_wsgi.
>
> > Graham
>
> i already use sys.path
> my WSGI script file is
> {
> import site
> site.addsitedir('/home/jagdeep/CMS/bin/lib/python2.6/site-packages')
> import os
> import sys
>
> os.environ['DJANGO_SETTINGS_MODULE'] = 'djangocms.settings'
>
> import django.core.handlers.wsgi
> application = django.core.handlers.wsgi.WSGIHandler()
> sys.path.append('/home/jagdeep/')
>
> }
>
> my django project is placed in /home/jagdeep/djangocms   directory

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Protobuff model memcaching

2010-09-16 Thread burg
Hi everybody,
Recently I've been trying to migrate from AppEngine-Patch (with
Appengine models) into django-nonrel.

In the past, I've been using Protobufs serialization for memcache as
suggested by Nick here http://blog.notdot.net/2009/9/Efficient-model-memcaching
- which seemed to be very efficient and stable (unlike json
serializers of django.core)

However Model Protobuf caching in Appengine has some code already
implemented in the AppEngine library. Is there some easy way to pick
Protobuf serialization instead of python Pickle to achieve the same
with Django's native Model ?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Initialize model's fields

2010-09-16 Thread Marco Vicario
Thanks a lot Bruno!!!

2010/9/15 bruno desthuilliers 

> On 15 sep, 18:35, marcovic  wrote:
> > Hi all,
> > i'm trying to do a simple task with Django but evidently it is not so
> > simple...
>
> It is - when you understand how things work.
>
> > I have my model:
> >
> > class Mymodel(models.Model):
> > random_string = models.CharField(max_length=200)
> >
> > def produce_string(self):
> >  a = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "L", "M",
> > "N", "O", "P", "Q", "R", "S", "T", "U", "V", "Z", "0",
> > "1", "2", "3", "4", "5", "6", "7", "8", "9"]
> > num = ""
> > random.shuffle(a)
> > for x in a[:8]:
> > num = num + x
> > self.random_string= num
> >
>
> import string
>
> def random_string():
>a = list(string.uppercase + string.digits)
>random.shuffle(a)
>return "".join(a[:8])
>
>
>
> > What i'd like to do is having a random string stored into my new
> > object as soon as i'll create my object. To do that i've inserted this
> > method into previous code:
> >
> >  def __init__(self,*args, **kwargs):
> > super(Mymodel, self).__init__(*args, **kwargs)
> > self.produce_string()
>
> __init__ is called on the class instanciation. Your model class is
> instanciated each time you load a record from the db.
>
> You could just use a pre_save signal and set the random_string field
> if the "created" flag is True.
>
> def mymodel_pre_save(sender, instance, created, **kw):
>if created:
>instance.random_string = random_string()
>
> pre_save.connect(my_model_pre_save, sender=MyModel)
>
>
> If you need to have this value set on new instances even before the
> instance is saved, you can still set it in the initializer, but then
> you need to test on self.pk before (assuming your using an auto_id)
>
> def __init__(self, *args, **kw):
>super(MyModel, self).__init__(*args, **kw):
>if not self.pk:
>self.random_string = random_string()
>
> HTH
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: virtualenv used with mod_wsgi

2010-09-16 Thread Jagdeep Singh Malhi


On Sep 16, 2:25 am, Graham Dumpleton 
wrote:
> You need to add it to sys.path in WSGI script file. The PYTHONPATH
> in .bashrc of your personal account isn't used by Apache/mod_wsgi.
>
> Graham
i already use sys.path
my WSGI script file is
{
import site
site.addsitedir('/home/jagdeep/CMS/bin/lib/python2.6/site-packages')
import os
import sys

os.environ['DJANGO_SETTINGS_MODULE'] = 'djangocms.settings'

import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
sys.path.append('/home/jagdeep/')
}

my django project is placed in /home/jagdeep/djangocms   directory

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.