Tuesday, August 31, 2010

Re: Chat application in Django

Hi,

@Jeff, Erlang! Pretty surprised to see that.
@Alexander, doesn't work :( - or might be I am not able to get it..
@David, cool I'll try this, but will this work using mod_python / Apache?
@ebry1,
Imagine 10000 people live chatting, that means 10000 requests per
second, but in real world, only 3000 messages might have been
delivered. (as example). Polling will bring your net throughput of the
server to almost one tenth.

@all,
Can you suggest me the side effects of using Sockets via 1x1px flash
applet embedded on the page? Apart from the fact that flash is
required.

Thanks

On Wed, Sep 1, 2010 at 5:23 AM, ebry1 <stenius@gmail.com> wrote:
> I am interested in this problem too, I need to pass some additional
> data along side chat messages.
>
> Why did you decide to abandon polling?  I was thinking of thinking of
> using it and updating about twice a second.
>
>
>
> On Aug 31, 6:34 am, Shamail Tayyab <pleoma...@gmail.com> wrote:
>> Hi,
>>
>>    I am working on a chat application in Django, how can I ensure that I
>> do not have to poll the server for any chat data.
>>
>> Possible approaches that I've been to:
>>
>> 1. BAD - use polling.
>>
>> 2. Use long polling - bad approach afa browser support is concerned.
>>
>> 3. Using sockets in flash - makes the application flash dependent.
>>
>> Is there some good way to do this? Or if there is something Django
>> specific? Something like HTTPBinding or any 3rd party tested libraries?
>> I am expected to provide support till IE6. :-(
>>
>> Correct me if I am wrong, flash is available on 95% of the systems, this
>> approach looks like safest bet, is it good to go?
>>
>> Btw, how does Gmail and FB chat works?
>>
>> Thanks
>>
>> --
>> 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-users@googlegroups.com.
> To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
>
>

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

Re: PIL on 10.6 = PAIN

You could try ActivePython:

http://www.activestate.com/activepython/downloads

Then

{{{
$ pypm install pil
The following packages will be installed to ~/.local (2.6):
pil-1.1.7-1
Get: [pypm-free.activestate.com] pil 1.1.7-1
Installing pil-1.1.7-1
Fixing script ~/.local/bin/pilconvert.py
Fixing script ~/.local/bin/pildriver.py
Fixing script ~/.local/bin/pilfile.py
Fixing script ~/.local/bin/pilprint.py
[22:17:39 trentm@boa:~/Movies/tech]
$ python
ActivePython 2.6.6.15 (ActiveState Software Inc.) based on
Python 2.6.6 (r266:84292, Aug 24 2010, 16:02:28)
[GCC 4.2.1 (Apple Inc. build 5664)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import _imaging
}}}

Trent

--
Trent Mick

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

Re: Django UserProfile's - the hardest part of the whole framework

(snip 'programming by accident' code)

I'm not sure you really understand what you're doing :-/


> > > Here's my problem, I know you don't get direct access to the user
> > > model,
>
> > Yes you do.
>
> > > so making the user email editable is kind of tricky
>
> > Why so ?
>
> you can't query for a user with request.user

Query what ?

> but I can with user_id as
> above.

Where exactly ?

> > I personnaly don't use a ModelForm for user profiles - since you
> > (usually) have to mix&match data from both the user and profile
> > models, I find it simpler to use a plain forms.Form and handle the
> > fields/models mapping, saving etc by myself
>
> Do you have an example, I keep piecing together stuff from the b-list
> etc.

Yeps, that's what your code looks like - copy/paste without true
undrestanding...

Here's a (shortened and simplified) snippet:

class ProfileForm(forms.Form):
# User fields
first_name = forms.CharField(
label=_("First name"),
max_length=30
)

last_name = forms.CharField(
label=_("Last name"),
max_length=30
)

email = forms.EmailField(
label=_("E-mail"),
max_length=128,
help_text=_(u"ex : prenom@exemple.com")
)

_USER_FIELDS = (
'first_name',
'last_name',
'email'
)

# Profile fields
address1 = forms.CharField(
label=_("Address 1"),
max_length=80
)

address2 = forms.CharField(
label=_("Address 2"),
max_length=80,
required=False
)

postcode = forms.CharField(
label=_("Postcode"),
max_length=10, # should be enough for most cases ? NB : max 8
in current dataset
required=False # no postcode for IR ???
)

town = forms.CharField(
label=_("Town"),
max_length=100
)


#
--------------------------------------------------------------------------
def _from_model(self, name):
if name in self._USER_FIELDS:
return getattr(self.user, name)
else:
return getattr(self.profile, name)

#
--------------------------------------------------------------------------
def _to_model(self, name, value):
if name in self._USER_FIELDS:
setattr(self.user, name, value)
else:
setattr(self.profile, name, value)

#
--------------------------------------------------------------------------
def __init__(self, profile, *args, **kw):
self.prefix = kw.get("prefix", None)
data = kw.pop('data', {}).copy()

self.profile = profile
self.user = user = profile.user

for name in self.base_fields:
data.setdefault(self.add_prefix(name),
self._from_model(name))

kw['data'] = data
super(ProfileForm, self).__init__(*args, **kw)


#
--------------------------------------------------------------------------
def save(self):
if not self.is_valid():
raise ValueError("trying to save an invalid form")

# XXX : handle transaction here ?
self.user.save()
self.profile.save()

return self.profile, self.user

#
------------------------------------------------------------------------------
#
------------------------------------------------------------------------------
@login_required
@csrf_protect
def profile_edit(request, *args, **kw):
user = request.user
profile = user.get_profile()

if request.method == "POST":
profile_form = ProfileForm(profile, data=request.POST)
if profile_form.is_valid():
profile_form.save()
user.message_set.create(message=_("Your profile has been
modified successfully"))
return HttpResponseRedirect(reverse("core_profile_edit"))
else:
profile_form = ProfileForm(profile)

context = dict(
profile=profile,
profile_form=profile_form,
)

return render_to_response(
"core/profile_edit.html",
context,
context_instance=RequestContext(request)
)


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

Re: {% csrf_token %} template tag not outputting the hidden field

Hi Daniel-
Thanks for your response.
No, I wasn't generating the form within django; I had hand coded
a form into the page; because I had intended that this form appear on
every page in the side.
I'll try it as you suggest and report back. This may involve
learning how to write template tags.

thanks,
Erik


On Aug 30, 4:16 pm, Daniel Lathrop <daniel.lath...@gmail.com> wrote:
> I may misunderstand how csrf_token works, but I think it needs to be used in
> conjunction with the forms system, which would require you to pass a form to
> your template. Are you doing that?
>
> Daniel Lathrop
> News Applications Editor
> The Dallas Morning News
> ---------------------------
> Daniel Lathrop
> 206.718.0349 (cell)
>
>
>
> On Mon, Aug 30, 2010 at 11:46 AM, Erik <dyk...@gmail.com> wrote:
> > Hi Django Users-
> >     I'm having trouble with the {% csrf_token %} tag.
> >     On my site I have a regular login view / page / url, which uses
> > the django contrib registration app.  I include the CSRF token in my
> > login template and it works fine.
> >     I'd also like a little login box in the corner of every page,
> > which will either show a login form or a "you're logged in!" message
> > depending on whether the user is logged in.  So, I wrote a little form
> > into my base.html template that other templates inherit from; and I
> > stuck the {% csrf_token %} tag in there as well.
> >     The part I don't understand is, if I load the login url in the
> > browser ( mysite.com/login/ ) both forms work, I can login with them,
> > and when I view the source the CSRF token tag has put a hidden field
> > into my form.
> >     However, when I'm on any other page - for example the front page
> > - the token tag just leaves a blank space and doesn't output anything,
> > but it doesn't give me an error message on loading the page - as it
> > would when I try to use a token tag that doesn't exist - such as {%
> > faketokentag  %}.  Of course, because the csrf token tag doesn't
> > create any output (in the HTML source generated) when the form is
> > submitted the CSRF error occurs.
> >     I'm rendering all such pages with the generic view
> > direct_to_template , which, because it's a generic view, the
> > documentation suggests should just work with CSRF.
> >     Does anyone have any suggestions?
>
> > Thank you,
> > Erik
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Django users" group.
> > To post to this group, send email to django-users@googlegroups.com.
> > To unsubscribe from this group, send email to
> > django-users+unsubscribe@googlegroups.com<django-users%2Bunsubscribe@google groups.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-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Re: PIL on 10.6 = PAIN

To work with PIL and other librairies a little bit weird and difficult
to install the best way is to install Macport and after that:

port install py26-pil

and you'll need to use the python of the macport installation:

$ /opt/local/bin/python2.6

It's the samething on linux, i'm alway using the PIL package from my distro...

On Tue, Aug 31, 2010 at 7:10 PM, Bill Freeman <ke1g.nh@gmail.com> wrote:
> This sounds more like libjpeg isn't on the library load path, a
> system, rather than python, setting.
>
> I haven't done this with a Mac, but PIL has been troublesome on *nix
> servers for us as well.
>
> The common problems for us don't sound like your problem.  [Some
> versions of PIL install as "Imaging" rather than PIL.  If libjpeg
> isn't installed first, including development data (headers, stub
> library (called import library on Windows)) when your packaging system
> separates them, when you first build PIL, you can rebuild it until you
> are blue in the face and it won't pick up libjpeg that you installed
> later - need to totally remove PIL and rebuild]
>
> You seem to have successfully built to use libjpeg, but it isn't
> there.  I can think of three possibilities:
>
> 1. It really isn't there, maybe the reverse problem of installing a
> "development" package but not the main one.
>
> 2. It's there, but it doesn't match the version your _imagning.so was
> built against.
>
> 3. It's there, but the library loader hasn't been told about it.  On
> linux this means findable via ld.conf (or ld.so.conf) and ldconfig has
> been run since.  Package installation scripts usually take care of
> this, but it sometimes needs to be done by hand, if you're just, for
> example, unpacking a tarball.  I don't know the equivalent for osx.
>
> Good luck.
>
> Bill
>
> On Tue, Aug 31, 2010 at 12:41 PM, keynesiandreamer
> <keynesiandream@gmail.com> wrote:
>> Howdy!
>>
>> I have been working with Django/Pinax on a 10.6.4 system with python
>> 2.6.6 and have had no luck getting PIL to work. I have looked through
>> about 10-15 paged including ones listed on this group with no results.
>> Currently the error I am getting is:
>> The _imaging C module is not installed
>>
>> I have verified _imaging.so is in the file system. So it seems like a
>> syspath issue. I tried verifying that in the python prompt:
>>
>>>>> import _imaging
>> dlopen("/opt/local/Library/Frameworks/Python.framework/Versions/2.6/
>> lib/python2.6/site-packages/PIL/_imaging.so", 2);
>> Traceback (most recent call last):
>>  File "<stdin>", line 1, in <module>
>> ImportError: dlopen(/opt/local/Library/Frameworks/Python.framework/
>> Versions/2.6/lib/python2.6/site-packages/PIL/_imaging.so, 2): Symbol
>> not found: _jpeg_resync_to_restart
>>  Referenced from: /opt/local/Library/Frameworks/Python.framework/
>> Versions/2.6/lib/python2.6/site-packages/PIL/_imaging.so
>>  Expected in: flat namespace
>>  in /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/
>> python2.6/site-packages/PIL/_imaging.so
>>
>> Any help would be greatly appreciated, too many hours stuck on this
>> with no results.. :-(
>>
>> --
>> You received this message because you are subscribed to the Google Groups "Django users" group.
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to django-users+unsubscribe@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-users@googlegroups.com.
> To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
>
>

--
Mathieu Leduc-Hamel

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

Re: PIL on 10.6 = PAIN

This sounds more like libjpeg isn't on the library load path, a
system, rather than python, setting.

I haven't done this with a Mac, but PIL has been troublesome on *nix
servers for us as well.

The common problems for us don't sound like your problem. [Some
versions of PIL install as "Imaging" rather than PIL. If libjpeg
isn't installed first, including development data (headers, stub
library (called import library on Windows)) when your packaging system
separates them, when you first build PIL, you can rebuild it until you
are blue in the face and it won't pick up libjpeg that you installed
later - need to totally remove PIL and rebuild]

You seem to have successfully built to use libjpeg, but it isn't
there. I can think of three possibilities:

1. It really isn't there, maybe the reverse problem of installing a
"development" package but not the main one.

2. It's there, but it doesn't match the version your _imagning.so was
built against.

3. It's there, but the library loader hasn't been told about it. On
linux this means findable via ld.conf (or ld.so.conf) and ldconfig has
been run since. Package installation scripts usually take care of
this, but it sometimes needs to be done by hand, if you're just, for
example, unpacking a tarball. I don't know the equivalent for osx.

Good luck.

Bill

On Tue, Aug 31, 2010 at 12:41 PM, keynesiandreamer
<keynesiandream@gmail.com> wrote:
> Howdy!
>
> I have been working with Django/Pinax on a 10.6.4 system with python
> 2.6.6 and have had no luck getting PIL to work. I have looked through
> about 10-15 paged including ones listed on this group with no results.
> Currently the error I am getting is:
> The _imaging C module is not installed
>
> I have verified _imaging.so is in the file system. So it seems like a
> syspath issue. I tried verifying that in the python prompt:
>
>>>> import _imaging
> dlopen("/opt/local/Library/Frameworks/Python.framework/Versions/2.6/
> lib/python2.6/site-packages/PIL/_imaging.so", 2);
> Traceback (most recent call last):
>  File "<stdin>", line 1, in <module>
> ImportError: dlopen(/opt/local/Library/Frameworks/Python.framework/
> Versions/2.6/lib/python2.6/site-packages/PIL/_imaging.so, 2): Symbol
> not found: _jpeg_resync_to_restart
>  Referenced from: /opt/local/Library/Frameworks/Python.framework/
> Versions/2.6/lib/python2.6/site-packages/PIL/_imaging.so
>  Expected in: flat namespace
>  in /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/
> python2.6/site-packages/PIL/_imaging.so
>
> Any help would be greatly appreciated, too many hours stuck on this
> with no results.. :-(
>
> --
> You received this message because you are subscribed to the Google Groups "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to django-users+unsubscribe@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-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Re: Overriding flatpages class meta

Actually, I would *avoid* modifying the flatpages source, but that does raise a good point -- look at the source and copy/paste the Meta defined inside the class, making the overrides you need in your subclass (redefine the Meta).
You'll have to watch for changes if/when you switch django versions, but hey -- if it works, it works.

Owen Nelson



On Tue, Aug 31, 2010 at 12:38 PM, Karim Gorjux <lemieliste@gmail.com> wrote:
Try to modify the flatpages source! You can find it directly in your
django installation.


--
Karim Gojux
www.karimblog.net

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

PIL on 10.6 = PAIN

Howdy!

I have been working with Django/Pinax on a 10.6.4 system with python
2.6.6 and have had no luck getting PIL to work. I have looked through
about 10-15 paged including ones listed on this group with no results.
Currently the error I am getting is:
The _imaging C module is not installed

I have verified _imaging.so is in the file system. So it seems like a
syspath issue. I tried verifying that in the python prompt:

>>> import _imaging
dlopen("/opt/local/Library/Frameworks/Python.framework/Versions/2.6/
lib/python2.6/site-packages/PIL/_imaging.so", 2);
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: dlopen(/opt/local/Library/Frameworks/Python.framework/
Versions/2.6/lib/python2.6/site-packages/PIL/_imaging.so, 2): Symbol
not found: _jpeg_resync_to_restart
Referenced from: /opt/local/Library/Frameworks/Python.framework/
Versions/2.6/lib/python2.6/site-packages/PIL/_imaging.so
Expected in: flat namespace
in /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/
python2.6/site-packages/PIL/_imaging.so

Any help would be greatly appreciated, too many hours stuck on this
with no results.. :-(

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

Re: Overriding flatpages class meta

Try to modify the flatpages source! You can find it directly in your
django installation.


--
Karim Gojux
www.karimblog.net

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

Re: How to create a gerarchical list in admin for flatpages?

On Tue, Aug 31, 2010 at 14:11, Karim Gorjux <lemieliste@gmail.com> wrote:
> I would like to
> realize a easy admin page for my flat pages that in Django-CMS is
> called "site map".

I found what I need. Is here: http://code.google.com/p/django-mptt/

--
Karim Gojux
www.karimblog.net

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

Re: Overriding flatpages class meta

The meta class instance is accessed through ClassName._meta -- not ClassName.meta
I tried this when I got back last night and had (other) issues myself, so this might not be the right approach anyway.

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

Re: Chat application in Django

Funny you should ask --

The basic challenge with any chat application is the long polling bit,
django by default isn't really designed to handle that. Other servers
(Tornado, etc.) are much better at handling the long polling cycle that
typical web chat applications require.

I was just finishing an exploration of Django+Tornado -- building a chat
application -- which I've now pushed up to github.

http://github.com/koblas/django-on-tornado

The only "trick" at the moment is that a response that is returned via
the async Tornado handler isn't passed back up the middleware stack,
pondering good ways to deal with that. But in the mean time, here's a
functional chat application to play with if you're interested.

--koblas

On 8/31/10 4:34 AM, Shamail Tayyab wrote:
> Hi,
>
> I am working on a chat application in Django, how can I ensure that
> I do not have to poll the server for any chat data.
>
> Possible approaches that I've been to:
>
> 1. BAD - use polling.
>
> 2. Use long polling - bad approach afa browser support is concerned.
>
> 3. Using sockets in flash - makes the application flash dependent.
>
> Is there some good way to do this? Or if there is something Django
> specific? Something like HTTPBinding or any 3rd party tested libraries?
> I am expected to provide support till IE6. :-(
>
> Correct me if I am wrong, flash is available on 95% of the systems,
> this approach looks like safest bet, is it good to go?
>
> Btw, how does Gmail and FB chat works?
>
> Thanks
>
> --
> 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-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Re: Web hosting?

Webfaction +2
http://www.webfaction.com/demos/django

Regards
Juande

>
> We will be going live in a while, and we need hosting. I have a host
> in mind, but I wanted to know what others think? In your view, which
> host provides good Django support and decent performance?

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

Django Satchmo render company_name problem and some mods

Hello everyone...

Ive been having the following problem in my satchmo shop, when
registering a new account, the template welcome.txt is not loading the
variable 'company_name' --> debug info : http://dpaste.com/236858/


Besides that there are two things that I want to do... One is to
reverse the order o appearance of the date of birth now it starts with
1910 but I want it to start with 2010, since its a list... I tought I
would be done with the reverse() method on the function but it does
not.. The other thing that I want is to make a required field
optional, Im talking about the postal code field... in the models is
already set with require=False but it is still mark as required...

Ill be thankfull if you can give me some ideas... Im kind of a newb
developing. Thank you all...

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

Re: Django + Postgres

Hi,

Actually, there is a confusion between the administrative data django fills and the data the admin application owns itself.
Unless I'm mistaken, Django admin application only creates 1 table I named in my previous message (django_admin_log).
Can you check this table has been created ?
If it has been created, the second step would be to paste our urls.py file.
Otherwise, I would advice to take the time to read the django tutorial (http://docs.djangoproject.com/en/1.2/).

Regards,
Xavier.

Le 31 août 2010 à 13:53, Robbington a écrit :

> Apologies I should have been more clear,
>
> 'It' refers to my domain name when visited "/admin"
> All the django settings are correct, I've used sqlite3 and got the
> admin up and working.
>
> So I have installed postgres, pyscopg2.
>
> su postgres
> created a database
> updated my settings.py:
> DATABASES = {
> 'default': {
> 'ENGINE': 'django.db.backends.postgresql_psycopg2',
> 'NAME': 'template1',
> 'USER': 'postgres',
> 'PASSWORD': 'postgres',
>
> Then I have su postgres
> postgres@myvps:/var/www/django/$ python manage.py syncdb
>
> That upates the database, with all the admin database stuff, but it
> doesnt find anything at the admin url
>
>
> On Aug 31, 12:42 pm, Xavier Ordoquy <xordo...@linovia.com> wrote:
>> Also, what kind of users are you speaking about ? system, database or django users ?
>> Do you have the admin site available in the urls ? Did you uncomment both the url and the auto discovering part ?
>> Did syncdb showed django_admin_log table being created (or can you check it has been created) ?
>>
>> Regards,
>> Xavier.
>>
>> Le 31 août 2010 à 13:34, Albert Hopkins a écrit :
>>
>>
>>
>>> On Tue, 2010-08-31 at 04:30 -0700, Robbington wrote:
>>>> Hi,
>>
>>>> I seem to be having a problem setting up django and postgresql.
>>
>>>> I have created a database and switched users to postgres then sync'd
>>>> the database successfully in my django project directory. But it isn't
>>>> finding the admin page still. No errors, just cant find them.
>>
>>> What is "it" and what is meant by "it isn't finding the admin page"?
>>
>>> Did you enable the admin in INSTALLED_APPS and urls.py?
>>
>>> --
>>> You received this message because you are subscribed to the Google Groups "Django users" group.
>>> To post to this group, send email to django-users@googlegroups.com.
>>> To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
>>> For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.- Hide quoted text -
>>
>> - Show quoted text -
>
> --
> You received this message because you are subscribed to the Google Groups "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to django-users+unsubscribe@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-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Re: Please wait page trouble

I'll look into this. I have no idea what you mean by 'ajax' or 'json'.
Thus your code doe'snt really make sense given my lack of knowlege. I
will do some googling to see if I can piece it together. Thanks for
the help!

On Mon, Aug 30, 2010 at 10:37 PM, Rolando Espinoza La Fuente
<darkrho@gmail.com> wrote:
> On Mon, Aug 30, 2010 at 7:18 PM, Bradley Hintze
> <bradley.h@aggiemail.usu.edu> wrote:
>> I am attempting to do a lengthe calculation that will require the user
>> to wait a bit. I want a 'Please wait page to come up while the lengthy
>> calculation is performed. I thought this might work:
>>
>> views.py
>>
>> def please_wait(request):
>>    return HttpResponse('Please Wait......')
>>
>> def run_DHM(request):
>>    please_wait(request)
>>    ....lengthy calculations...
>>
>> This did not show the 'Please Wait' page. Is there a better way to do
>> what I am trying to do?
>>
>
> You are not returning the HttpResponse object from please_wait(). But anyway,
> doesn't work that way. At least with django.
>
> What you can do is render a normal html with the message "Please wait",
> then perform an ajax call to start the calculations and finally return
> a json response
> to display the result in the client-side.
>
> Roughly:
>
> def please_wait(request):
>    # ... setup context or something
>    return render_to_response("please_wait.html")
>
> def run_DHM(request)
>    # ... perform calculations and collect the result in a dict
>    data = {"result": something}
>    return HttpResponse(json.dumps(data), mimetype="application/json")
>
>
> # using jquery in your html
> <script type="text/javascript">
> $.getJSON("/run_DHM/", function(data) {
>    // do something with result
>    console.log(data.result);
> });
> </script>
>
>
> Rolando Espinoza La fuente
> www.insophia.com
>
>> --
>> Bradley J. Hintze
>> Graduate Student
>> Duke University
>> School of Medicine
>> 801-712-8799
>>
>> --
>> You received this message because you are subscribed to the Google Groups "Django users" group.
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to django-users+unsubscribe@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-users@googlegroups.com.
> To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
>
>

--
Bradley J. Hintze
Graduate Student
Duke University
School of Medicine
801-712-8799

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

Re: Overriding flatpages class meta

Thanks Owen but is doesn't work. The similar Error message:

contribute_to_class
if self.meta:
AttributeError: 'Options' object has no attribute 'meta'

On Aug 30, 8:03 pm, Owen Nelson <onel...@gmail.com> wrote:
> Sorry to be guessing here, but I was looking at something similar recently.
> My attempt (untested at this point) would be something like:
>
> from copy import copy
> class NewFlatpage(FlatPage):
>     _meta = copy(FlatPage._meta)
>     _meta.verbose_name_plural = "foo"

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

Re: set utf8 as default database char set

I just feel kind of redundant to have the same text in and above the textfields. And also the odd table layout that makes choice fields and votes' fields so apart; and doubt if I did something wrong.

At the moment, I only care about following the tutorial correctly. If you think it looks fine, then it's fine and I'll move forward:)

Thanks Karen

On Tue, Aug 31, 2010 at 5:10 AM, Karen Tracey <kmtracey@gmail.com> wrote:
On Tue, Aug 31, 2010 at 3:14 AM, Elim Qiu <elim.qiu@gmail.com> wrote:
I'm in tutorial 2. Looks like I did something wrong. Please help. thanks
See the image attached

The image looks fine to me. What do you see that you think is wrong?

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

Re: Chat application in Django

I've seen this project: http://code.google.com/p/django-chat/ but I don't test it... perhaps the code can helps you.

What about use a free protocol as XMPP (jabber) and write a "client" for django?

On Tue, Aug 31, 2010 at 14:08, Jeff Bell <jeffreymerrillbell@gmail.com> wrote:

Pretty sure fb uses Erlang for chat.

On Aug 31, 2010 7:34 AM, "Shamail Tayyab" <pleomax00@gmail.com> wrote:
> Hi,
>
> I am working on a chat application in Django, how can I ensure that I
> do not have to poll the server for any chat data.
>
> Possible approaches that I've been to:
>
> 1. BAD - use polling.
>
> 2. Use long polling - bad approach afa browser support is concerned.
>
> 3. Using sockets in flash - makes the application flash dependent.
>
> Is there some good way to do this? Or if there is something Django
> specific? Something like HTTPBinding or any 3rd party tested libraries?
> I am expected to provide support till IE6. :-(
>
> Correct me if I am wrong, flash is available on 95% of the systems, this
> approach looks like safest bet, is it good to go?
>
> Btw, how does Gmail and FB chat works?
>
> Thanks
>
> --
> 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-users@googlegroups.com.
> To unsubscribe from this group, send email to django-users+unsubscribe@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-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.



--
Please, don't send me files with extensions: .doc, .docx, .xls, .xlsx, .ppt and/or .pptx

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

Re: Chat application in Django

Pretty sure fb uses Erlang for chat.

On Aug 31, 2010 7:34 AM, "Shamail Tayyab" <pleomax00@gmail.com> wrote:
> Hi,
>
> I am working on a chat application in Django, how can I ensure that I
> do not have to poll the server for any chat data.
>
> Possible approaches that I've been to:
>
> 1. BAD - use polling.
>
> 2. Use long polling - bad approach afa browser support is concerned.
>
> 3. Using sockets in flash - makes the application flash dependent.
>
> Is there some good way to do this? Or if there is something Django
> specific? Something like HTTPBinding or any 3rd party tested libraries?
> I am expected to provide support till IE6. :-(
>
> Correct me if I am wrong, flash is available on 95% of the systems, this
> approach looks like safest bet, is it good to go?
>
> Btw, how does Gmail and FB chat works?
>
> Thanks
>
> --
> 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-users@googlegroups.com.
> To unsubscribe from this group, send email to django-users+unsubscribe@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-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Re: Django + Postgres

Apologies I should have been more clear,

'It' refers to my domain name when visited "/admin"
All the django settings are correct, I've used sqlite3 and got the
admin up and working.

So I have installed postgres, pyscopg2.

su postgres
created a database
updated my settings.py:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'template1',
'USER': 'postgres',
'PASSWORD': 'postgres',

Then I have su postgres
postgres@myvps:/var/www/django/$ python manage.py syncdb

That upates the database, with all the admin database stuff, but it
doesnt find anything at the admin url


On Aug 31, 12:42 pm, Xavier Ordoquy <xordo...@linovia.com> wrote:
> Also, what kind of users are you speaking about ? system, database or django users ?
> Do you have the admin site available in the urls ? Did you uncomment both the url and the auto discovering part ?
> Did syncdb showed django_admin_log table being created (or can you check it has been created) ?
>
> Regards,
> Xavier.
>
> Le 31 août 2010 à 13:34, Albert Hopkins a écrit :
>
>
>
> > On Tue, 2010-08-31 at 04:30 -0700, Robbington wrote:
> >> Hi,
>
> >> I seem to be having a problem setting up django and postgresql.
>
> >> I have created a database and switched users to postgres then sync'd
> >> the database successfully in my django project directory. But it isn't
> >> finding the admin page still. No errors, just cant find them.
>
> > What is "it" and what is meant by "it isn't finding the admin page"?
>
> > Did you enable the admin in INSTALLED_APPS and urls.py?
>
> > --
> > You received this message because you are subscribed to the Google Groups "Django users" group.
> > To post to this group, send email to django-users@googlegroups.com.
> > To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
> > For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.- Hide quoted text -
>
> - Show quoted text -

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

Re: Django + Postgres

Also, what kind of users are you speaking about ? system, database or django users ?
Do you have the admin site available in the urls ? Did you uncomment both the url and the auto discovering part ?
Did syncdb showed django_admin_log table being created (or can you check it has been created) ?

Regards,
Xavier.


Le 31 août 2010 à 13:34, Albert Hopkins a écrit :

> On Tue, 2010-08-31 at 04:30 -0700, Robbington wrote:
>> Hi,
>>
>> I seem to be having a problem setting up django and postgresql.
>>
>> I have created a database and switched users to postgres then sync'd
>> the database successfully in my django project directory. But it isn't
>> finding the admin page still. No errors, just cant find them.
>
> What is "it" and what is meant by "it isn't finding the admin page"?
>
> Did you enable the admin in INSTALLED_APPS and urls.py?
>
>
> --
> You received this message because you are subscribed to the Google Groups "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to django-users+unsubscribe@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-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Chat application in Django

Hi,

I am working on a chat application in Django, how can I ensure that I
do not have to poll the server for any chat data.

Possible approaches that I've been to:

1. BAD - use polling.

2. Use long polling - bad approach afa browser support is concerned.

3. Using sockets in flash - makes the application flash dependent.

Is there some good way to do this? Or if there is something Django
specific? Something like HTTPBinding or any 3rd party tested libraries?
I am expected to provide support till IE6. :-(

Correct me if I am wrong, flash is available on 95% of the systems, this
approach looks like safest bet, is it good to go?

Btw, how does Gmail and FB chat works?

Thanks

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

Re: Django + Postgres

On Tue, 2010-08-31 at 04:30 -0700, Robbington wrote:
> Hi,
>
> I seem to be having a problem setting up django and postgresql.
>
> I have created a database and switched users to postgres then sync'd
> the database successfully in my django project directory. But it isn't
> finding the admin page still. No errors, just cant find them.

What is "it" and what is meant by "it isn't finding the admin page"?

Did you enable the admin in INSTALLED_APPS and urls.py?


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

Chat application in Django

Hi,

I am working on a chat application in Django, how can I ensure that I
do not have to poll the server for any chat data.

Possible approaches that I've been to:

1. BAD - use polling.

2. Use long polling - bad approach afa browser support is concerned.

3. Using sockets in flash - makes the application flash dependent.

Is there some good way to do this? Or if there is something Django
specific? Something like HTTPBinding or any 3rd party tested libraries?
I am expected to provide support till IE6. :-(

Correct me if I am wrong, flash is available on 95% of the systems, this
approach looks like safest bet, is it good to go?

Btw, how does Gmail and FB chat works?

Thanks

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

Django + Postgres

Hi,

I seem to be having a problem setting up django and postgresql.

I have created a database and switched users to postgres then sync'd
the database successfully in my django project directory. But it isn't
finding the admin page still. No errors, just cant find them.


Can any one help with Postgres or point me in the direction of a good
tutorial?

Thanks

Rob

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

How to create a gerarchical list in admin for flatpages?

Hi all! I'm working to create my CMS on Django, I would like to
realize a easy admin page for my flat pages that in Django-CMS is
called "site map". How I can do that? Are there any tutorial or how to
about that? Have you any advice?

Thanks!

The site map in Django-CMS:
http://www.django-cms.org/media/uploads/cms_page_media/2/3_pagelist___.png

--
Karim Gojux
www.karimblog.net

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

Re: set utf8 as default database char set

On Tue, Aug 31, 2010 at 3:14 AM, Elim Qiu <elim.qiu@gmail.com> wrote:
I'm in tutorial 2. Looks like I did something wrong. Please help. thanks
See the image attached

The image looks fine to me. What do you see that you think is wrong?

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

Re: Query overhead or not ?

Thanks for your advise. I'm short of time right now so I briefly looked at django's aggregation possibilities.
I'll look into them more deeply tonight.

But I stumbled upon a problem.

Post.objects.values('tags')

Gives me:

FieldError: Invalid field name: 'tags'

In [56]: Post.tags
Post.tags

In [56]: Post.tags
Out[56]: <django.db.models.fields.related.ReverseManyRelatedObjectsDescriptor object at 0x78f9f0>

Post.tags does exist. Maybe it's because it's a ManyToManyField ? So I tried Post.objects.values('tags__name'). Still got an error ?

I'm wondering why ?

Op 31-aug-2010, om 09:28 heeft Jirka Vejrazka het volgende geschreven:

>> tags = Tag.objects.all()
>>
>> for t in tags:
>> indexed_tags[t] = Post.objects.filter(tags__name=t).count()
>>
>> Next I would sort indexed_tags and I have a dictionary of which tags are used the most.
>>
>> I'm wondering if this is a good idea ? Since if I have 1000 tags this would require 1000 queries just for one simple tag cloud.
>> Is there a better way of solving this without adding an extra count field to the Tag model.
>
> Hi Jonas,
>
> your gut feeling was correct - it's not a very good idea, although
> it might work for a small site. You might want to take a look at
> database aggregation in Django:
> http://docs.djangoproject.com/en/1.2/topics/db/aggregation/
>
> Cheers
>
> Jirka
>
> --
> You received this message because you are subscribed to the Google Groups "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
>

Met vriendelijke groeten,

Jonas Geiregat
jonas@geiregat.org


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

Re: Re: Moderation of posts

On Tue, Aug 31, 2010 at 2:45 AM, Henrik Genssen <henrik.genssen@miadi.net> wrote:
@Karen:
is there a view in the admin section, where you can filter posts that were never answered?
And if: can it be made public? There are a lot of peaple who might want to help - (see stackoverflow
or cempetitors...) but if one does not know...

No, nothing like that. The easiest way to get that sort of view is probably to subscribe to get the posts emailed and use your favorite email client that displays threads well and look for threads with just one post.

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

Extending LogEntry model

I want to add a column to the logentry model in admin section.How
can I do this?
thanks

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

how to add two numbers with django - revisited

hi,

there was a recent thread on this subject, and I had an idea that this
may be a good way to give a basic instruction in the way django works to
people who come from radically different backgrounds:

http://lawgon.livejournal.com/80621.html
--
regards
Kenneth Gonsalves

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

Re: Web hosting?

Also the Linode support team are amazing, I have been left nothing but
impressed by them.

On Aug 31, 10:25 am, Robbington <robbing...@hotmail.co.uk> wrote:
> I use a Linode with Ubuntu serving django with a uwsgi/cherokee setup.
> Its remarkable how easy and intuitive it is and its hardly bank
> breaking at £10 a month.
> You cant beat the flexibility that you get.
> The only complaint I've got is the compatiblity issues with Django 1.1
> and Cms. Its caused me countless re-installs.
>
> On Aug 31, 9:13 am, Sithembewena Lloyd Dube <zebr...@gmail.com> wrote:
>
>
>
> > Hi folks,
>
> > I introduced Django at work not very long ago and the uptake has been good.
> > We are seeing early results working with the framework (somebody who never
> > previously used Python or Django has managed to build a web app well within
> > proposed time frames).
>
> > We will be going live in a while, and we need hosting. I have a host in
> > mind, but I wanted to know what others think? In your view, which host
> > provides good Django support and decent performance?
>
> > --
> > Regards,
> > Sithembewena Lloyd Dubehttp://www.lloyddube.com- Hide quoted text -
>
> - Show quoted text -

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

Re: Django UserProfile's - the hardest part of the whole framework

On 31 août, 06:16, reduxdj <patricklemi...@gmail.com> wrote:
> So, I'm still newer to django. I have user registration,
> authentication, imagefields, filters, and more all built into my
> application and working. So now, I need a user to be able to edit his
> own email and upload an image to the user_profile. First, I am using
> RegistrationProfile for the django registration just fine, should be
> no conflict right?

Nope, these are distinct apps and needs and whatnot...

> Here's my problem, I know you don't get direct access to the user
> model,

Yes you do.

> so making the user email editable is kind of tricky

Why so ?

> here's my
> FAILED attempt:
>
> from settings.py:
>
> AUTH_PROFILE_MODULE = "gather.models.UserProfile"
>
> From models.py:
>
> class UserProfile(models.Model):
>     user = models.ForeignKey(User, unique=True)
>     image = models.ImageField(null=True,upload_to='images/users')
>
>     def save(self, *args, **kwargs):
>         super(UserProfile, self).save(*args, **kwargs)
>
>     def update(self, *args, **kwargs):
>          super(UserProfile, self).update(*args, **kwargs)
>
>     def delete(self, *args, **kwargs):
>         super(UserProfile, self).delete(*args, **kwargs)

You don't need any of these three methods - your current
implementation just duplicate what would happen without them.

> class UserProfileForm(UserProfileForm):
>     class Meta:
>         model = UserProfile
>         exclude = ['user']
>
> from forms.py:
>
> class UserProfileForm(forms.ModelForm):

I personnaly don't use a ModelForm for user profiles - since you
(usually) have to mix&match data from both the user and profile
models, I find it simpler to use a plain forms.Form and handle the
fields/models mapping, saving etc by myself

(snip form's code - not sure whether it's ok)

>
> from views.py:
>
> def account(request):
>     #return render_to_response('account.html',
> context_instance=RequestContext(request))
>     if request.method == "POST":
>         form =
> UserProfileForm(request.user,request.POST,request.FILES)
>         if form.is_valid():
>             form.save()
>             return HttpResponseRedirect('/account/')
>     else:
>         form = UserProfileForm(request.user)
>         return render_to_response('account.html', {'form': form},
> context_instance=RequestContext(request))
>
> So, this seems simple enough but doesn't work, here's my output:
>
> Caught AttributeError while rendering: 'User' object has no attribute
> 'get'
>

You should have a full traceback, it might help if you post it so we
know where the exception is raised. But from your code and the error
message, I'd say the problem is somewhere in your template (wild
guess...).

> Thanks, as I am at a stoppage.
> appreciated.

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

Re: Web hosting?

I use a Linode with Ubuntu serving django with a uwsgi/cherokee setup.
Its remarkable how easy and intuitive it is and its hardly bank
breaking at £10 a month.
You cant beat the flexibility that you get.
The only complaint I've got is the compatiblity issues with Django 1.1
and Cms. Its caused me countless re-installs.

On Aug 31, 9:13 am, Sithembewena Lloyd Dube <zebr...@gmail.com> wrote:
> Hi folks,
>
> I introduced Django at work not very long ago and the uptake has been good.
> We are seeing early results working with the framework (somebody who never
> previously used Python or Django has managed to build a web app well within
> proposed time frames).
>
> We will be going live in a while, and we need hosting. I have a host in
> mind, but I wanted to know what others think? In your view, which host
> provides good Django support and decent performance?
>
> --
> 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-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Re: Web hosting?

Thanks Kenneth, interesting summary. We would likely start off with WF as our needs at this point should be covered by their hosting.

On Tue, Aug 31, 2010 at 10:25 AM, Kenneth Gonsalves <lawgon@au-kbc.org> wrote:
On Tue, 2010-08-31 at 10:13 +0200, Sithembewena Lloyd Dube wrote:
> We will be going live in a while, and we need hosting. I have a host
> in
> mind, but I wanted to know what others think? In your view, which host
> provides good Django support and decent performance?

low cost small site - webfaction
slightly higher cost - medium site - linode/slicehost/gandi
more pricey for bigger sites - hetzner
huge sites - amazon
--
regards
Kenneth Gonsalves

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

Re: Custom attributes in Django

Hi thanks for quick response.

I was thinking more about real custom attributes. Be able to define a
string, or choice filed from admin. And after all create query and/or
render form on it.
Application that we are working at requires different attributes on
objects from client to client.
We were looking for something like alex's
http://github.com/alex/django-taggit, but perfect situation will be a
tag with a type(or choice)

thanks

On Mon, Aug 30, 2010 at 6:20 PM, Beres Botond <botondus@gmail.com> wrote:
> Hi Sebastian,
>
> I suppose you are trying to do something like this?
>
> class CustomAttributes(models.Model):
>    name = models.CharField(max_length=30)
>    value = models.CharField(max_length=50)
>
> class ObjectWithCustom(models.Model):
>    name = models.CharField(max_length=30)
>    attributes = models.ManyToManyField(CustomAttributes)
>
> new_attr = o.attributes.create(name='custom_attr', value='value')
>
> ObjectWithCustom.objects.filter(attributes__value='value')
>
> For more info about many-to-many check out docs:
> http://www.djangoproject.com/documentation/models/many_to_many/
> Maybe describe in some detail what you are trying to accomplish (in
> terms of resulting functionality), as this might not necessarily be
> the best way to do it.
>
> Cheers,
>
> Béres Botond
>
> On Aug 30, 5:54 pm, Sebastian Pawlus <sebastian.paw...@gmail.com>
> wrote:
>> Hi
>>
>> Maybe im looking in wrong places or maybe there is no application to
>> cover functionality of carrying custom/admin defined attributes, or
>> maybe it isn't even possible.
>>
>> Use Case could looks like
>> Defining models
>>
>> from customr_attr import models
>>
>> class ObjectWithCustom(models.Model):
>>      name = models.CharField(max_length=30)
>>
>> o = ObjectWithCustom.objects.create(name='test')
>> o.custom_attr.create(name='custom_attr', value='value')
>>
>> >> o.custom_attr
>>
>> value
>>
>> >> ObjectWithCustom.objects.filter(custom_attr='value')
>>
>> [o]
>>
>> any ideas?
>
> --
> You received this message because you are subscribed to the Google Groups "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to django-users+unsubscribe@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-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Re: Staticstic app, ask for idea.

To integrate a calculated value with search features from admin app, I
don't know any other way than create and save a calculated field on
your model ...
This calculated field, you can calculate it with cube ... but if you
don't use the Cube for any other statistic than that, it is too much
overhead.

On Aug 31, 5:30 am, Lucian Romi <romi.luc...@gmail.com> wrote:
> Thanks Sebastien.
>
> Can I integrate Cube with filter and search features from the admin app?
> Also, to make things simple, I'm going to use GChart, but I need
> statistic data.
> Let me download Cube and spend some time on it. Thanks.
>
> On Mon, Aug 30, 2010 at 4:16 PM, sebastien piquemal <seb...@gmail.com> wrote:
> > I created an app to easily generate the stats part :
> >http://code.google.com/p/django-cube/; however you still have to
> > create the chart, for example with matplotlib :
> >http://www.scipy.org/Cookbook/Matplotlib/Django.
>
> > To create your stats with django-cube, you can use this code :
>
> >    from cube.models import Cube, Dimension
>
> >    class MyModelCube(Cube):
> >        my_dimension = Dimension(field='my_float_field__range',
> > sample_space=[(0, 1.5), (1.5, 6.2)])
>
> >        @static
> >        def aggregation(queryset):
> >            return queryset.count()/MyModel.objects.count() * 100
>
> > - You specify one dimension for the cube, this dimension refers to the
> > field lookup 'my_float_field__range' (where 'my_float_field' is of
> > course the name of your field)
> > - then you specify a sample space for this dimension, which in fact
> > means that you specify for which ranges the stats will be calculated
> > (here, on the ranges (0, 1.5) and (1.5, 6.2))
> > - then you write your aggregation function, which is in your case a
> > percentage calculation ('queryset' is the queryset filtered according
> > to the dimensions you will use while querying the cube, divided by the
> > total, multiplied by 100)
> > - finally, you instantiate a cube with a base queryset, and use one of
> > the methods provided to calculate the statistics
>
> > Ok, the doc is kind of bad for now, but I can help you if you want to
> > use it but you don't manage to do so.
>
> > On Aug 30, 8:24 pm, hollando <romi.luc...@gmail.com> wrote:
> >> I want to make a statistic app.
> >> There is a float field in my model(table).I want to use a chart to
> >> show what's the percentage in each range.
> >> Any suggestion to make such and app that can fit into django model.
> >> Thanks.
>
> > --
> > You received this message because you are subscribed to the Google Groups "Django users" group.
> > To post to this group, send email to django-users@googlegroups.com.
> > To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
> > For more options, visit this group athttp://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-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Re: Web hosting?

On Tue, 2010-08-31 at 10:13 +0200, Sithembewena Lloyd Dube wrote:
> We will be going live in a while, and we need hosting. I have a host
> in
> mind, but I wanted to know what others think? In your view, which host
> provides good Django support and decent performance?

low cost small site - webfaction
slightly higher cost - medium site - linode/slicehost/gandi
more pricey for bigger sites - hetzner
huge sites - amazon
--
regards
Kenneth Gonsalves

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

Re: Web hosting?

<bias>Looks like my proposed host is at the top there by a wide margin</bias>



On Tue, Aug 31, 2010 at 10:17 AM, Sithembewena Lloyd Dube <zebra05@gmail.com> wrote:
Ah, thanks Federico :)


On Tue, Aug 31, 2010 at 10:15 AM, Federico Maggi <federico.maggi@gmail.com> wrote:
On Aug 31, 2010, at 10:13 AM, Sithembewena Lloyd Dube wrote:

> We will be going live in a while, and we need hosting. I have a host in mind, but I wanted to know what others think? In your view, which host provides good Django support and decent performance?

       http://djangofriendly.com/hosts/

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@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



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

Re: Web hosting?

Ah, thanks Federico :)

On Tue, Aug 31, 2010 at 10:15 AM, Federico Maggi <federico.maggi@gmail.com> wrote:
On Aug 31, 2010, at 10:13 AM, Sithembewena Lloyd Dube wrote:

> We will be going live in a while, and we need hosting. I have a host in mind, but I wanted to know what others think? In your view, which host provides good Django support and decent performance?

       http://djangofriendly.com/hosts/

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

Re: Web hosting?

On Aug 31, 2010, at 10:13 AM, Sithembewena Lloyd Dube wrote:

> We will be going live in a while, and we need hosting. I have a host in mind, but I wanted to know what others think? In your view, which host provides good Django support and decent performance?

http://djangofriendly.com/hosts/

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

Web hosting?

Hi folks,

I introduced Django at work not very long ago and the uptake has been good. We are seeing early results working with the framework (somebody who never previously used Python or Django has managed to build a web app well within proposed time frames).

We will be going live in a while, and we need hosting. I have a host in mind, but I wanted to know what others think? In your view, which host provides good Django support and decent performance?

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

Re: Query overhead or not ?

> tags = Tag.objects.all()
>
> for t in tags:
>    indexed_tags[t] = Post.objects.filter(tags__name=t).count()
>
> Next I would sort indexed_tags and I have a dictionary of which tags are used the most.
>
> I'm wondering if this is a good idea ? Since if I have 1000 tags this would require 1000 queries just for one simple tag cloud.
> Is there a better way of solving this without adding an extra count field to the Tag model.

Hi Jonas,

your gut feeling was correct - it's not a very good idea, although
it might work for a small site. You might want to take a look at
database aggregation in Django:
http://docs.djangoproject.com/en/1.2/topics/db/aggregation/

Cheers

Jirka

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

Re: set utf8 as default database char set

I'm in tutorial 2. Looks like I did something wrong. Please help. thanks
See the image attached

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