django request path

2010-07-01 Thread todd
Hello all,

I've been working through an issue with my django project. The issue
is I've got one project, which will retrieve data for users of
different clients. I need to know 'from where' a viewer is coming from
(request.path [my original solution]). I've been looking at a number
of different options which sound close to what I want to do, but I'm
not sure what the best option is, not having done this before.

My first option was to add a url in the urls.py with a 'tag' or
'keyword' then look for that tag/keyword in the request.path, which
I'd add as a session key. Then go onto get the data.

Something else I started looking at was the sites framework. After
reading through the documentation, I'm still confused how sites
actually works, so I'm not sure if this is the right option.

Another solution talked about using middleware, this came up in
connection with the research into using the sites framework.

And then yet another talked about doing this in apache.

Could some one help point me in the right direction?

Cheers,

T

-- 
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 request path

2010-07-01 Thread Venkatraman S
On Thu, Jul 1, 2010 at 1:36 PM, todd  wrote:

>
> I've been working through an issue with my django project. The issue
> is I've got one project, which will retrieve data for users of
> different clients. I need to know 'from where' a viewer is coming from
> (request.path [my original solution]). I've been looking at a number
> of different options which sound close to what I want to do, but I'm
> not sure what the best option is, not having done this before.
>

Do you mean the referrer?

-V-
http://twitter.com/venkasub

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



best translation solution for my project

2010-07-01 Thread grimmus
Hi,

Sorry if this has been asked before, but i only seem to be finding
bit's and pieces for what i am after.

I have a simple website that needs to be available in English and
French.

I am using locale-url so all pages can have an independent url ( e.g.
en/page and fr/page)

There is a locale folder in my project that contains the .po and .mo
files, all this is working correctly when i switch languages.

The question is, how can my client translate the model fields in the
admin area ? For example, there is a client list page that uses a
model with a title and a body text. If they initially entered the
client list in English, how would they add it in French ?

I have heard about something called Rosetta but have not looked too
much into it yet.

Thanks for any advice on what solution would be best based on my
requirements.

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



Managing the balance between SSL and impact on the server

2010-07-01 Thread ALJ
I have an extranet for staff and known partners. It has absolutely no
public content. I've installed SSL so it should be secure, but I also
heard that SSL can have a big impact on the server.

While login and password changes need to be secure, the content itself
is not particularly sensitive. But actions and views will be user
specific, therefore users will need to be logged in at all times.

Given the above, I was wondering if it is necessary to use SSL at all
times or is possible to use it only for login? Presumably if I dropped
out of SSL after login, the cookies would still be vulnerable to
hijacking. My gut feel is that I have to use SSL all the time and just
accept the hit on the server, but I wondered there were any django
tools (CSRF protection) or best practices anyone has on managing the
balance of SSL and the impact on the server.

- Are they passing logins and passowords? Yes, then SSL
- Is the content sensitive (like bank details or commercial stuff) ?
If yes then SSL.
- Are the content and actions user specific? If yes then SSL.

ALJ

-- 
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: Newby Question: template system doesn't render form html

2010-07-01 Thread grimmus
You dont seem to be closing your input tags, add > to the end of them

On Jul 1, 4:47 am, Gene  wrote:
> When I put a form into my template it comes back blank. Does anyone
> know why?
>
> what is in my template
>
> 
>
>     
>     
> 
> 
>
> what I get in my browser
>
> 

-- 
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: does QuerySet delete delete the objects by their primary key?

2010-07-01 Thread Tom Evans
On Wed, Jun 30, 2010 at 9:01 PM, thusjanthan  wrote:
> Hi,
>
> I did a query on an object using their "non" primary keys such that:
>
> a = Topic.objects.filter(topic='Politics')
> topic is not a primary key. suppose topicID is primary key.
>
> When I run:
>
> a.delete()
>
> the SQL that is executed is:
>
> DELETE FROM 'Topic' WHERE topicID in (1)
>
>
>
> my problem is a little harder than that in the sense my table has
> multiple keys so suppose its topicID and course is the primary key
> together but since topicID is '1' for both the objects returned by the
> filter it tries to be smart and randomly picks what it "thinks" is the
> primary key and deletes based on that.
>
> First off I hate the fact that Django doesn't support multiple primary
> keys... Any suggestions to delete objects using their fields that are
> passed in or do I have to override the delete function to be able to
> do this?
>
> Cheers,
> Nathan.

I think you need to re-read some of your database books. There can be
no such thing as 'multiple primary keys'. Nor can two objects of the
same type have the same primary key - it would instantly not be a
primary key!

The only thing currently missing from django's key support is
composite primary keys - and not supporting composite primary keys
allows you to do some neat tricks with things like Generic Types etc,
so it's not a total loss.

If you wish to strictly control the deletion of items, use a queryset deletion:

Myobject.objects.filter(type=Myobject.STUFF, date__lt=today).delete()

Cheers

Tom

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



Error importing database router: "cannot import name connection"

2010-07-01 Thread dzonny
Hi!

I'm trying to create app router but when I put this row to my
settings.py, I'll get this error traceback:

Traceback (most recent call last):
  File "/home/django/pythonenv/django/bin/django-admin.py", line 5, in

management.execute_from_command_line()
  File "/home/django/pythonenv/django/lib/python2.5/site-packages/
django/core/management/__init__.py", line 429, in
execute_from_command_line
utility.execute()
  File "/home/django/pythonenv/django/lib/python2.5/site-packages/
django/core/management/__init__.py", line 379, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/home/django/pythonenv/django/lib/python2.5/site-packages/
django/core/management/base.py", line 191, in run_from_argv
self.execute(*args, **options.__dict__)
  File "/home/django/pythonenv/django/lib/python2.5/site-packages/
django/core/management/base.py", line 209, in execute
translation.activate('en-us')
  File "/home/django/pythonenv/django/lib/python2.5/site-packages/
django/utils/translation/__init__.py", line 66, in activate
return real_activate(language)
  File "/home/django/pythonenv/django/lib/python2.5/site-packages/
django/utils/functional.py", line 55, in _curried
return _curried_func(*(args+moreargs), **dict(kwargs,
**morekwargs))
  File "/home/django/pythonenv/django/lib/python2.5/site-packages/
django/utils/translation/__init__.py", line 36, in delayed_loader
return getattr(trans, real_name)(*args, **kwargs)
  File "/home/django/pythonenv/django/lib/python2.5/site-packages/
django/utils/translation/trans_real.py", line 193, in activate
_active[currentThread()] = translation(language)
  File "/home/django/pythonenv/django/lib/python2.5/site-packages/
django/utils/translation/trans_real.py", line 176, in translation
default_translation = _fetch(settings.LANGUAGE_CODE)
  File "/home/django/pythonenv/django/lib/python2.5/site-packages/
django/utils/translation/trans_real.py", line 159, in _fetch
app = import_module(appname)
  File "/home/django/pythonenv/django/lib/python2.5/site-packages/
django/utils/importlib.py", line 35, in import_module
__import__(name)
  File "/home/django/pythonenv/django/lib/python2.5/site-packages/
django/contrib/admin/__init__.py", line 1, in 
from django.contrib.admin.helpers import ACTION_CHECKBOX_NAME
  File "/home/django/pythonenv/django/lib/python2.5/site-packages/
django/contrib/admin/helpers.py", line 1, in 
from django import forms
  File "/home/django/pythonenv/django/lib/python2.5/site-packages/
django/forms/__init__.py", line 17, in 
from models import *
  File "/home/django/pythonenv/django/lib/python2.5/site-packages/
django/forms/models.py", line 6, in 
from django.db import connections
  File "/home/django/pythonenv/django/lib/python2.5/site-packages/
django/db/__init__.py", line 64, in 
router = ConnectionRouter(settings.DATABASE_ROUTERS)
  File "/home/django/pythonenv/django/lib/python2.5/site-packages/
django/db/utils.py", line 112, in __init__
raise ImproperlyConfigured('Error importing database router %s:
"%s"' % (klass_name, e))
django.core.exceptions.ImproperlyConfigured: Error importing database
router MyRouter: "cannot import name connection"

Is there anybody who know what i'm doing wrong?
Thanx a lot.
dzonny

-- 
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: Managing the balance between SSL and impact on the server

2010-07-01 Thread Erik Cederstrand
Den 01/07/2010 kl. 11.02 skrev ALJ:

> I have an extranet for staff and known partners. It has absolutely no
> public content. I've installed SSL so it should be secure, but I also
> heard that SSL can have a big impact on the server.

Just measure it instead of guessing. Enable system monitoring on your server 
for a couple of days and run one day with SSL and the next day without.

We can't tell you if your data and your login credentials are worth protecting 
with SSL - you need to make that decision yourself. If your server is choking 
on the load of SSL processing, then either upgrade the server or decide to not 
use SSL if you need to save the money.

Erik

smime.p7s
Description: S/MIME cryptographic signature


Re: Error importing database router: "cannot import name connection"

2010-07-01 Thread Daniel Roseman
On Jul 1, 10:51 am, dzonny  wrote:
> Hi!
>
> I'm trying to create app router but when I put this row to my
> settings.py, I'll get this error traceback:
>

>
> django.core.exceptions.ImproperlyConfigured: Error importing database
> router MyRouter: "cannot import name connection"
>
> Is there anybody who know what i'm doing wrong?
> Thanx a lot.
> dzonny

Yes, what you're doing wrong is not posting the code to your router.
--
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: Managing the balance between SSL and impact on the server

2010-07-01 Thread ALJ
Hi Erik,

Thanks for the advice. I'll certainly have a look at the servers.

I just wanted to know really whether it was an "all or none" situation
with SSL. If it was possible blend secure and non secure connections.

ALJ

On Jul 1, 11:13 am, Erik Cederstrand  wrote:
> Den 01/07/2010 kl. 11.02 skrev ALJ:
>
> > I have an extranet for staff and known partners. It has absolutely no
> > public content. I've installed SSL so it should be secure, but I also
> > heard that SSL can have a big impact on the server.
>
> Just measure it instead of guessing. Enable system monitoring on your server 
> for a couple of days and run one day with SSL and the next day without.
>
> We can't tell you if your data and your login credentials are worth 
> protecting with SSL - you need to make that decision yourself. If your server 
> is choking on the load of SSL processing, then either upgrade the server or 
> decide to not use SSL if you need to save the money.
>
> Erik
>
>  smime.p7s
> 2KViewDownload

-- 
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: Managing the balance between SSL and impact on the server

2010-07-01 Thread euan.godd...@googlemail.com
We have a Django solution that blends both SSL and none SSL. We did it
by creating a decorator for views that adds an attribute to the view
function and then some middleware that ensures these views are always
server over SSL (with a permanent redirect to the SSL equivalent if
necessary). We also rewrote Django's {% url %} to allow us to point to
SSL pages automatically.

The solution is pretty neat and we only use SSL for the same sorts of
things that you mention.

Euan

On Jul 1, 12:59 pm, ALJ  wrote:
> Hi Erik,
>
> Thanks for the advice. I'll certainly have a look at the servers.
>
> I just wanted to know really whether it was an "all or none" situation
> with SSL. If it was possible blend secure and non secure connections.
>
> ALJ
>
> On Jul 1, 11:13 am, Erik Cederstrand  wrote:
>
> > Den 01/07/2010 kl. 11.02 skrev ALJ:
>
> > > I have an extranet for staff and known partners. It has absolutely no
> > > public content. I've installed SSL so it should be secure, but I also
> > > heard that SSL can have a big impact on the server.
>
> > Just measure it instead of guessing. Enable system monitoring on your 
> > server for a couple of days and run one day with SSL and the next day 
> > without.
>
> > We can't tell you if your data and your login credentials are worth 
> > protecting with SSL - you need to make that decision yourself. If your 
> > server is choking on the load of SSL processing, then either upgrade the 
> > server or decide to not use SSL if you need to save the money.
>
> > Erik
>
> >  smime.p7s
> > 2KViewDownload

-- 
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: Managing the balance between SSL and impact on the server

2010-07-01 Thread steven314
It's a very common pattern to use SSL for login and private profile
details and then have the cookie passed over an unencrypted channel
for the rest of the site.

I have implemented an approach where nginx handles all the SSL and
proxies requests to apache (which directly serves non-SSL requests).
Transitions between SSL and non-SSL are achieved with rewrites at the
nginx and apache level, which also means that SSL can be made optional
on, say, the admin URLs.

This breaks request.is_secure() as it stands but this is easy to work
around.

Bear in mind that IE may give you loud warnings about insecure content
if you don't also adjust the MEDIA_URL to use SSL where
appropriate.

Steven.

-- 
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: best translation solution for my project

2010-07-01 Thread bruno desthuilliers


On 1 juil, 10:18, grimmus  wrote:
> Hi,
>
> Sorry if this has been asked before, but i only seem to be finding
> bit's and pieces for what i am after.
>
> I have a simple website that needs to be available in English and
> French.
>
> I am using locale-url so all pages can have an independent url ( e.g.
> en/page and fr/page)
>
> There is a locale folder in my project that contains the .po and .mo
> files, all this is working correctly when i switch languages.
>
> The question is, how can my client translate the model fields in the
> admin area ? For example, there is a client list page that uses a
> model with a title and a body text. If they initially entered the
> client list in English, how would they add it in French ?
>
> I have heard about something called Rosetta but have not looked too
> much into it yet.
>
> Thanks for any advice on what solution would be best based on my
> requirements.

Rosetta can be helpful for all the .po/.mo stuff, but won't help for
your model-based content.

We're using currently using Transmetta on one of projects - the first
that had this requirement - and it works fine so far. One of the nice
points is that it has very minimal impact on your existing code AND
data so you can add it afterwards without much pain.

http://code.google.com/p/django-transmeta/

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



Valid objects are returning an http 404 response

2010-07-01 Thread vjimw
We are having an issue where valid model objects are returning an
apache 404 error. Often times, if you hit refresh in the browser a few
times, the object is returned with the same URL.

We are using Django 1.2.1

-- 
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 on multiple servers? (Deployment Problem)

2010-07-01 Thread bruno desthuilliers
On 1 juil, 02:40, nano  wrote:
> Ok, so i've written my Django app on computer A with the dev server,
> and have pushed it to server B, running apache (implemented with
> mod_wsgi). The server also has Django installed, but cannot find the
> settings for some reason.

It's probably either a pythonpath or permissions problem.

> what i've gathered is that because i've
> never run the 'makeproject' command that the Django instance on the
> server simply doesn't know the project exists.

And you're plain wrong.

There's nothing like a "Django instance" to starts with, all you have
is a django package somewhere in your pythonpath, and a "django
project" (ie : your app) package somewhere else that imports stuff
from the django package. The "startproject" command only creates a
"stub" project package, period.


> the project on the
> server has a slightly different path than it did on the original
> computer, however i have changed settings.py to reflect that.
> Now, my assumption is that the fix will be to go into the django files
> and edit whatever file notes what projects exist,

Once again : django is nothing else than a Python package so it don't
"do" anything by itself, and is *totally* ignorant of your project.
NB : if you don't know what's a Python package is, please read
Python's official tutorial, with special attention to the part about
modules, packages and the pythonpath).

> however i dont even
> know where to start looking. any help?

Read your apache's error log, you should get more information about
why your settings file is not found.

-- 
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 develop cms on django

2010-07-01 Thread bruno desthuilliers


On 30 juin, 12:16, Kenneth Gonsalves  wrote:
> On Wednesday 30 June 2010 15:40:20 samie wrote:
>
> > > Everything or almost.
>
> > i dont have time i need to start development within  a month..
>
> > plz tell me all those crucial topics that i should learn
>
> 1. python
> 2. css
> 3. html
> 4. javascript
> 5. Database design
> 6. django installation, set up and deployment

You forgot the HTTP protocol !-)

-- 
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: Valid objects are returning an http 404 response

2010-07-01 Thread euan.godd...@googlemail.com
When you say "an apache 404 error" do you mean a non-Django styled
one? If so, I think there's something wrong with your apache
configuration and not your Django app. What mechanism are you using to
serve the application? I have seen issues like with this mod_wsgi when
the reload mechanism isn't triggered correctly and you have to restart
apache to get it work correctly. I think in that case it was because
I'd compiled apache slightly incorrectly. I never got to the bottom of
the problem.

On Jul 1, 2:54 pm, vjimw  wrote:
> We are having an issue where valid model objects are returning an
> apache 404 error. Often times, if you hit refresh in the browser a few
> times, the object is returned with the same URL.
>
> We are using Django 1.2.1

-- 
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 develop cms on django

2010-07-01 Thread bruno desthuilliers
On 30 juin, 12:10, samie  wrote:
> On Jun 30, 1:58 pm, bruno desthuilliers
>
>  wrote:
> > On 29 juin, 12:41, samie  wrote:
>
> > > 1 more query..
>
> > > what are important that i shld. learn in python and in django to
> > > develop my cms..
>
> > Everything or almost.
>
> i dont have time i need to start development within  a month..

Epic fail ahead.


-- 
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: Valid objects are returning an http 404 response

2010-07-01 Thread vjimw
Actually, we are getting our Django 404 page. Sorry to be unclear on
that. The URLs appears as 404 in the access logs.

We are actually using fast_cgi per our system administrator and
wondered if switching to mod_wsgi might help solve the problem, but it
looks like you had the issue with mod_wsgi!

Did recompiling apache solve the problem for you with your Django app
running mod_wsgi?

Thanks for the fast response. Let me know any other information that
my be helpful.

On Jul 1, 9:00 am, "euan.godd...@googlemail.com"
 wrote:
> When you say "an apache 404 error" do you mean a non-Django styled
> one? If so, I think there's something wrong with your apache
> configuration and not your Django app. What mechanism are you using to
> serve the application? I have seen issues like with this mod_wsgi when
> the reload mechanism isn't triggered correctly and you have to restart
> apache to get it work correctly. I think in that case it was because
> I'd compiled apache slightly incorrectly. I never got to the bottom of
> the problem.
>
> On Jul 1, 2:54 pm, vjimw  wrote:
>
>
>
> > We are having an issue where valid model objects are returning an
> > apache 404 error. Often times, if you hit refresh in the browser a few
> > times, the object is returned with the same URL.
>
> > We are using Django 1.2.1

-- 
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: best translation solution for my project

2010-07-01 Thread grimmus
Thanks for the reply.

I settled on django-modeltranslation, it's easy to install, well
documented and fits into the admin area.

Thanks again.

On Jul 1, 3:46 pm, bruno desthuilliers 
wrote:
> On 1 juil, 10:18, grimmus  wrote:
>
>
>
> > Hi,
>
> > Sorry if this has been asked before, but i only seem to be finding
> > bit's and pieces for what i am after.
>
> > I have a simple website that needs to be available in English and
> > French.
>
> > I am using locale-url so all pages can have an independent url ( e.g.
> > en/page and fr/page)
>
> > There is a locale folder in my project that contains the .po and .mo
> > files, all this is working correctly when i switch languages.
>
> > The question is, how can my client translate the model fields in the
> > admin area ? For example, there is a client list page that uses a
> > model with a title and a body text. If they initially entered the
> > client list in English, how would they add it in French ?
>
> > I have heard about something called Rosetta but have not looked too
> > much into it yet.
>
> > Thanks for any advice on what solution would be best based on my
> > requirements.
>
> Rosetta can be helpful for all the .po/.mo stuff, but won't help for
> your model-based content.
>
> We're using currently using Transmetta on one of projects - the first
> that had this requirement - and it works fine so far. One of the nice
> points is that it has very minimal impact on your existing code AND
> data so you can add it afterwards without much pain.
>
> http://code.google.com/p/django-transmeta/

-- 
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: using django for google appengine, noob to both.

2010-07-01 Thread Sector7B
Felippe, Thank you for our feedback, I've posted this question over to
the group you mentioned a couple replies ago, still waiting approval
from the moderators but if you feel like continuing this I'd
appreciate it.  It might be helpful to others in the future.

Malcom, I briefly looked over the site, very interesting, I'm going to
continue.  Thanks much.

Joe

On Jul 1, 12:10 am, Malcolm MacKinnon  wrote:
> You should look at this site:
>
> http://www.allbuttonspressed.com/projects/django-nonrel
>
> I recommend it over
> any other django appengine ORM I've tried. I think it can help you with some
> of your issues. The blog and discussion group is very active and
> informative.
>
> On Wed, Jun 30, 2010 at 5:03 PM, Felippe Bueno wrote:
>
>
>
> > You can... but there are some limitations.
> > For example, django's admin site, don't work using appengine
> > You need to use db.Model,
> > You need to use google.appengine.ext.db.djangoforms   to validate forms...
> > And some more 
>
> > Btw, I think its better we discuss this using private messages, or at
> > app-engine-django group (http://groups.google.com/group/app-engine-django
> > ) :)
>
> > I mean, maybe we are bothering the members, talking more about appengine,
> > than django.
>
> > On Wed, Jun 30, 2010 at 8:44 PM, Sector7B wrote:
>
> >> interestingly though, i guess my problem is still that i'm not able to
> >> do the django way of things, which I thought was idea behind doing it
> >> like this:
> >>http://code.google.com/appengine/articles/appengine_helper_for_django...
>
> >> On Jun 30, 7:30 pm, Sector7B  wrote:
> >> > i was just coming to write that, lol.  I opened up the code and read
> >> > it!  What a novel approach.
>
> >> > Thanks for pointer, i'm going to try again.
>
> >> > On Jun 30, 7:17 pm, Felippe Bueno  wrote:
>
> >> > > BaseModel extends db.Model :)
>
> >> > >http://stackoverflow.com/questions/1720157/diference-between-appengin.
> >> ..
>
> >> > > On Wed, Jun 30, 2010 at 8:09 PM, Sector7B 
> >> wrote:
> >> > > > Thank you for your reply.  I gave it a try, and it didn't seem to
> >> > > > work.  The helper project (according to the introductory article)
> >> has
> >> > > > me using their "BaseModel", which I think is supposed to revert me
> >> > > > back to using Django code.  However there seems to be very little
> >> > > > written beyond that article, although it is a good one.  I went back
> >> > > > to the site, they have a google group specifically for this set up,
> >> > > > I'm going to post over to that group now.  Thanks again.
>
> >> > > > Joe
>
> >> > > > On Jun 30, 3:12 pm, Felippe Bueno  wrote:
> >> > > > > I think (THINK) you problem is with the db.Model
>
> >> > > > > Take a look athttp://
> >> > > > code.google.com/appengine/docs/python/datastore/queryclass.htm...
>
> >> > > > > <
> >>http://code.google.com/appengine/docs/python/datastore/queryclass.htm..
> >> > > > .>You
> >> > > > > will see that db.Model don't have the filter method, db.Query have
> >> it.
> >> > > > > You need to do some think like:
> >> > > > > a = XItUser.all()
> >> > > > > a.filter('xit_nickname =', 'awesome')
>
> >> > > > > I'm not sure if there is another way
>
> >> > > > > On Wed, Jun 30, 2010 at 4:04 PM, Sector7B <
> >> joe.greenaw...@gmail.com>
> >> > > > wrote:
> >> > > > > > Hi, I'm using django on google appengine using this:
>
> >>http://code.google.com/appengine/articles/appengine_helper_for_django.
> >> > > > ..
>
> >> > > > > > So I have my models, and I can load my pages and templates, and
> >> > > > > > started to do some rudimentary object creates and gets inside
> >> the
> >> > > > > > shell (python manage.py shell) and my views to get a feel for
> >> the
> >> > > > > > API.  Immediately Im coming across errors, which seem weird
> >> since
> >> > > > > > their so simple, and right out of the sample docs. (http://
>
> >> docs.djangoproject.com/en/dev/topics/db/queries/#topics-db-queries)
> >> > > > > > I'm guessing i have setup or import problem?  Or I'm missing
> >> something
> >> > > > > > major with the appengine way of things, but I am under the
> >> impression
> >> > > > > > after the setup it should run the same.  Either way maybe
> >> someone can
> >> > > > > > tell me better.
>
> >> > > > > > Thanks,
> >> > > > > > j
>
> >> > > > > > >>> b = XItUser(xit_nickname="awesome")
> >> > > > > > >>> b.save()
> >> > > > > > datastore_types.Key.from_path(u'XItUser', 2L, _app=u'xitforme')
> >> > > > > > >>> b
> >> > > > > > XItUser(**{x_user': None, 'xit_nickname': 'awesome'})
> >> > > > > > >>> x = XItUser.objects.filter(xit_nickname="awesome")
> >> > > > > > Traceback (most recent call last):
> >> > > > > >  File "", line 1, in 
> >> > > > > >  File ".../models.py", line 37, in __getattr__
> >> > > > > >    return getattr(self.owner, name)
> >> > > > > > AttributeError: type object 'XItUser' has no attribute 'filter'
> >> > > > > > >>> x = XItUser.objects.get(xit_nickna

Admin datetime js widget and urls

2010-07-01 Thread cfraschetti
Hello all,
I am trying to leverage the Admin site by adding some urls in the
admin class.

Eg.
class Orders(admin.ModelAdmin):
def changelist_view(self,request,customer_id=None):
pass
#set up view for order list based on customer_id by adding
filter to queryset

def get_urls(self):
urls = patterns('',
(r'customer/(?P)/',self.changelist_view),
)
return urls + admin.ModelAdmin.get_urls(self)

This allows a url like
/admin/customers/orders/customer/1/ to access the orders for customer
with id of 1.

This works wonderfully as it allows me to be at the Customer "level"
in regards to their orders (for all functions, viewing list, changing
orders or adding.  I always know the customer).

The problem is that when I do this I know longer have the Admin
datetime js widgets and can't seem to get them back.  If I access the
admin through the normal url (eg. /admin/customers/orders/ ) they
appear.

Any ideas, please?
Much thanks in advance.

Chris

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



Looking for Django Developer(s) in Long Island for part time and full time

2010-07-01 Thread normlevy
Hello Django User group...

I am looking on the site for how to post a job opening to your
community...and I apologize in advance if I am not doing the right.

We are looking for 1 or 2 local (NY Metro area - preferably Long
Island) Django developers to work with me on a new audible Tweet
platform we developed called http://ShoutOmatic.com

If you, or anyone you know is looking for part time or full time work
please contact me normlevy @ shoutomatic  com

We are an exciting start-up and build our platforms with Django...

Thank you for any guidance you may have for us to find Django
developers

Norm Levy
ShoutOmatic

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



Translation problem

2010-07-01 Thread Daniel Baron

Hi all,

I have a problem getting the correct translation using gettext in the 
following situation:


I have a view which calls a custom function to send an email. This 
functions takes three arguments

- subject of the email (string)
- the language of the email
- the template to render the content of the email:

e.g: my_mail(ugettext_lazy('This is the subject'), 'es', 'invitation')

Now, my_mail looks basically like this:

def my_mail(subject, lang, tpl):
  translation.activate(lang)
  content = render_to_string()
  email = EmailMessage(subject, content, from_addr, to_addr)
  email.send()

Now my problem is, that the content of the email is always sent in the 
desired language given by the "lang" variable. While the subject of the 
email is always sent in the language of the user calling the view.


What am I doing wrong? And how can I tell my function to translate the 
subject correctly? I thought that is exactly what ugettext_lazy is for, 
but obviously I misunderstood the concept.


Thanks,
Daniel

--
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: Valid objects are returning an http 404 response

2010-07-01 Thread Bill Freeman
Does it happen when running the development server?  If so, you get
a lot more debugging info right up front (access to variables in each
stack from, for instance).  If it's still not clear you can use the trace
as a guide as to where to put a pdb.set_trace() (possibly in an if that
makes it only trigger in the interesting circumstance) so that you can
poke around.

On Thu, Jul 1, 2010 at 10:06 AM, vjimw  wrote:
> Actually, we are getting our Django 404 page. Sorry to be unclear on
> that. The URLs appears as 404 in the access logs.
>
> We are actually using fast_cgi per our system administrator and
> wondered if switching to mod_wsgi might help solve the problem, but it
> looks like you had the issue with mod_wsgi!
>
> Did recompiling apache solve the problem for you with your Django app
> running mod_wsgi?
>
> Thanks for the fast response. Let me know any other information that
> my be helpful.
>
> On Jul 1, 9:00 am, "euan.godd...@googlemail.com"
>  wrote:
>> When you say "an apache 404 error" do you mean a non-Django styled
>> one? If so, I think there's something wrong with your apache
>> configuration and not your Django app. What mechanism are you using to
>> serve the application? I have seen issues like with this mod_wsgi when
>> the reload mechanism isn't triggered correctly and you have to restart
>> apache to get it work correctly. I think in that case it was because
>> I'd compiled apache slightly incorrectly. I never got to the bottom of
>> the problem.
>>
>> On Jul 1, 2:54 pm, vjimw  wrote:
>>
>>
>>
>> > We are having an issue where valid model objects are returning an
>> > apache 404 error. Often times, if you hit refresh in the browser a few
>> > times, the object is returned with the same URL.
>>
>> > We are using Django 1.2.1
>
> --
> 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: Translation problem

2010-07-01 Thread Tom Evans
On Thu, Jul 1, 2010 at 2:33 PM, Daniel Baron  wrote:
> Hi all,
>
> I have a problem getting the correct translation using gettext in the
> following situation:
>
> I have a view which calls a custom function to send an email. This functions
> takes three arguments
> - subject of the email (string)
> - the language of the email
> - the template to render the content of the email:
>
> e.g: my_mail(ugettext_lazy('This is the subject'), 'es', 'invitation')
>
> Now, my_mail looks basically like this:
>
> def my_mail(subject, lang, tpl):
>  translation.activate(lang)
>  content = render_to_string()
>  email = EmailMessage(subject, content, from_addr, to_addr)
>  email.send()
>
> Now my problem is, that the content of the email is always sent in the
> desired language given by the "lang" variable. While the subject of the
> email is always sent in the language of the user calling the view.
>
> What am I doing wrong? And how can I tell my function to translate the
> subject correctly? I thought that is exactly what ugettext_lazy is for, but
> obviously I misunderstood the concept.
>
> Thanks,
> Daniel
>

I'm guessing my_mail doesn't look exactly like that. ugettext_lazy is
translated to a unicode string when certain operations happen on it,
one of those must be happening. I have a mail function that looks very
similar to that, and it works correctly.

Cheers

Tom

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



Arbitrary Properties from code

2010-07-01 Thread Doug Warren
Let's say I have some models that look like:

class Emotion(models.Model):
mood = CharField(unique=True)

class Person(models.Model):
emotions = ManyToManyField(Emotion)
name = CharField()


angry = Emotion(mood='angry')
angry.save()
sad = Emotion(mood='sad')
sad.save()
bob = Person(name='Bob')
bob.emotions.add(angry)

>From code I'd like to check if a person has a specific emotion, but if
that motion hasn't been defined before (IE: the specified mood does
not exist in the emotion table) I'd like to raise an exception.  So
what I'm looking for is giving the above, a way to check that bob is
'angry', bob is not 'sad', and there is no such thing as 'happy'

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



recommended app for editable settings in the admin?

2010-07-01 Thread pablo platt
Hi

I need to let the admin change settings in the admin interface.
Settings could be tax_rate, admin email, site description...
The straight forward approach is to have a model of key/value pairs in the
db.
The key/value pairs could be cached in request.settings on the first access
like request.user.
This might increase the size of the request.

I've found django-livesettings and django-appsettings.
django-livesettings doesn't have any docs.
I've followed the readme of django-appsettings but couldn't get the app
settings.py to be called.

Is there an app that does that or more docs on the above apps?

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: Valid objects are returning an http 404 response

2010-07-01 Thread vjimw
It only happens in our production environment. We have a stage
environment, which is a mirror of production, that does not have this
behavior and it does not happen on our development or local
environments.  The trace is a good idea to try to see more
information.

On Jul 1, 9:28 am, Bill Freeman  wrote:
> Does it happen when running the development server?  If so, you get
> a lot more debugging info right up front (access to variables in each
> stack from, for instance).  If it's still not clear you can use the trace
> as a guide as to where to put a pdb.set_trace() (possibly in an if that
> makes it only trigger in the interesting circumstance) so that you can
> poke around.
>
>
>
> On Thu, Jul 1, 2010 at 10:06 AM, vjimw  wrote:
> > Actually, we are getting our Django 404 page. Sorry to be unclear on
> > that. The URLs appears as 404 in the access logs.
>
> > We are actually using fast_cgi per our system administrator and
> > wondered if switching to mod_wsgi might help solve the problem, but it
> > looks like you had the issue with mod_wsgi!
>
> > Did recompiling apache solve the problem for you with your Django app
> > running mod_wsgi?
>
> > Thanks for the fast response. Let me know any other information that
> > my be helpful.
>
> > On Jul 1, 9:00 am, "euan.godd...@googlemail.com"
> >  wrote:
> >> When you say "an apache 404 error" do you mean a non-Django styled
> >> one? If so, I think there's something wrong with your apache
> >> configuration and not your Django app. What mechanism are you using to
> >> serve the application? I have seen issues like with this mod_wsgi when
> >> the reload mechanism isn't triggered correctly and you have to restart
> >> apache to get it work correctly. I think in that case it was because
> >> I'd compiled apache slightly incorrectly. I never got to the bottom of
> >> the problem.
>
> >> On Jul 1, 2:54 pm, vjimw  wrote:
>
> >> > We are having an issue where valid model objects are returning an
> >> > apache 404 error. Often times, if you hit refresh in the browser a few
> >> > times, the object is returned with the same URL.
>
> >> > We are using Django 1.2.1
>
> > --
> > 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 
> > 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-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: Valid objects are returning an http 404 response

2010-07-01 Thread Tom Evans
On Thu, Jul 1, 2010 at 3:41 PM, vjimw  wrote:
> It only happens in our production environment. We have a stage
> environment, which is a mirror of production, that does not have this
> behavior and it does not happen on our development or local
> environments.  The trace is a good idea to try to see more
> information.
>

Are you doing anything funky with your databases? Read only slaves?

Cheers

Tom

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



UnicodeDecodeError: 'utf8' codec can't decode

2010-07-01 Thread Yateen
Hi,

I am using a postgres database and DJango. I have a http url in my
database which contains some special characters, but a table query
returns the result successfully.

select http_url from mytable limit 1;
http_url

 http://östrogenfrei.de/verhuetung.html


If I use Django model way to get the same data, I get following error
-
>>> from util import *
>>> cursor = connection.cursor()
>>> query="select http_url from cfedr_raw_data_20100526_24860_1277981101 where 
>>> http_url like '%rogenfrei%'"
>>> cursor.execute(query)
>>> data = []
>>> for item in cursor.fetchall():
... print item
... data.append(item)
...
Traceback (most recent call last):
  File "", line 1, in 
  File "/firstpool/yjoshi/permanent/starbi/python2.6.1/lib/python2.6/
encodings/utf_8.py", line 16, in decode
return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: 'utf8' codec can't decode bytes in position 7-10:
invalid data

Can anyone please throw some light on this? why is this occurring?
what is the solution.

Thanks in advance,

Yateen..

-- 
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: Valid objects are returning an http 404 response

2010-07-01 Thread vjimw
No, the database is pretty standard (mysql 5.1.37-community). This is
an 'in-house' tool and we have about 15 consistent users. They hit is
pretty heavily and notice this issue during that time, but it also
pops up throughout the day. It does seem to be "fixed," albeit
temporarily, after we restart apache, but I am not sure if that is a
red-herring since it will pop up again fairly quickly.

Before going live we did some basic load testing and did not
experience this issue; however, there is a difference between testing
and actually using a Web app.

On Jul 1, 9:48 am, Tom Evans  wrote:
> On Thu, Jul 1, 2010 at 3:41 PM, vjimw  wrote:
> > It only happens in our production environment. We have a stage
> > environment, which is a mirror of production, that does not have this
> > behavior and it does not happen on our development or local
> > environments.  The trace is a good idea to try to see more
> > information.
>
> Are you doing anything funky with your databases? Read only slaves?
>
> Cheers
>
> Tom

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



After sync signal?

2010-07-01 Thread Jari Pennanen
Hi!

I'm trying to add rows to database after sync, but I need to do it
after *all* of the apps has been synced. Since my after sync function
traverses all these apps and builds interesting information to the
database.

While post_syncdb http://docs.djangoproject.com/en/dev/ref/signals/#post-syncdb
allows to connect to sender, I need to know is there a way to connect
to "last sender"... Since there isn't any kind of "after sync signal".

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: recommended app for editable settings in the admin?

2010-07-01 Thread Daniel Roseman
On Jul 1, 3:37 pm, pablo platt  wrote:
> Hi
>
> I need to let the admin change settings in the admin interface.
> Settings could be tax_rate, admin email, site description...
> The straight forward approach is to have a model of key/value pairs in the
> db.
> The key/value pairs could be cached in request.settings on the first access
> like request.user.
> This might increase the size of the request.
>
> I've found django-livesettings and django-appsettings.
> django-livesettings doesn't have any docs.
> I've followed the readme of django-appsettings but couldn't get the app
> settings.py to be called.
>
> Is there an app that does that or more docs on the above apps?
>
> Thanks

I've been successfully using django-dbsettings for years. It was
originally called django-values, and I think it's the original source
of what went into Satchmo and was later extracted again as django-
livesettings. You can find the up-to-date version, complete with docs,
on github:
http://github.com/sciyoshi/django-dbsettings
--
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 to develop cms on django

2010-07-01 Thread Julio Cesar Rodriguez Cruz
If you want rapid, cross-browser facilities, nice and friendly
interfaces and pain-less javascript develop, you must consider learn
and use a js library like jQuery

Instead to develop your cms from scratch consider to use or reuse
http://www.django-cms.org/

Hope this help you

regards
julio cesar

On 7/1/10, bruno desthuilliers  wrote:
> On 30 juin, 12:10, samie  wrote:
>  > On Jun 30, 1:58 pm, bruno desthuilliers
>  >
>  >  wrote:
>  > > On 29 juin, 12:41, samie  wrote:
>  >
>  > > > 1 more query..
>  >
>  > > > what are important that i shld. learn in python and in django to
>  > > > develop my cms..
>
> >
>  > > Everything or almost.
>  >
>  > i dont have time i need to start development within  a month..
>
>
> Epic fail ahead.
>
>
>
>  --
>  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: Admin Search Engline

2010-07-01 Thread Dennis Kaarsemaker
ChangeList.get_query_set in django/contrib/admin/views/main.py

On ma, 2010-06-28 at 11:41 +0200, Massimiliano della Rovere wrote:
> Yes that's my idea.
> Can you tell me which class/method in the admin files is responsible
> for the search engine so that I can extend it?
> 
> On Mon, Jun 28, 2010 at 10:27, euan.godd...@googlemail.com
>  wrote:
> > I think that would be quite an undertaking as you would need to write
> > an expression parser and monkey around with the search code in admin.
> >
> > If you succeed, I'd be interested to see the result.
> >
> > Euan
> >
> > On Jun 28, 8:36 am, Massimiliano della Rovere
> >  wrote:
> >> I'd like to modify the default search engine in the django admin
> >> interface so that is can search metadata too like values depending on
> >> sql COUNT() using google style prefixes in these cases.
> >> Can somebody help me telling which class/method in the admin files is
> >> responsible for the search engine so that I can extend it?
> >>
> >> thanks.
> 

-- 
Dennis K.

They've gone to plaid!

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



www.djangoproject.com

2010-07-01 Thread FC
I can't access www.djangoproject.com from Buenos Aires, Argentina.
Firefox says: "The connection has timed out"

Is anyone else having problems?

-- 
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: www.djangoproject.com

2010-07-01 Thread Rob Broadhead

Works fine for me.

On Jul 1, 2010, at 12:40 PM, FC wrote:


I can't access www.djangoproject.com from Buenos Aires, Argentina.
Firefox says: "The connection has timed out"

Is anyone else having problems?

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




Rob Broadhead
robert.broadh...@gmail.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: Django on multiple servers? (Deployment Problem)

2010-07-01 Thread nano
Ok, thanks. sorry for my rather dumbed down language- by saying that
django 'knew' about the project i was implying that perhaps some
change was made in some configuration file in the django library, but
as thats not the case, moot point.

but again, thanks, ive been able to get it working.

On Jul 1, 9:57 am, bruno desthuilliers 
wrote:
> On 1 juil, 02:40, nano  wrote:
>
> > Ok, so i've written my Django app on computer A with the dev server,
> > and have pushed it to server B, running apache (implemented with
> > mod_wsgi). The server also has Django installed, but cannot find the
> > settings for some reason.
>
> It's probably either a pythonpath or permissions problem.
>
> > what i've gathered is that because i've
> > never run the 'makeproject' command that the Django instance on the
> > server simply doesn't know the project exists.
>
> And you're plain wrong.
>
> There's nothing like a "Django instance" to starts with, all you have
> is a django package somewhere in your pythonpath, and a "django
> project" (ie : your app) package somewhere else that imports stuff
> from the django package. The "startproject" command only creates a
> "stub" project package, period.
>
> > the project on the
> > server has a slightly different path than it did on the original
> > computer, however i have changed settings.py to reflect that.
> > Now, my assumption is that the fix will be to go into the django files
> > and edit whatever file notes what projects exist,
>
> Once again : django is nothing else than a Python package so it don't
> "do" anything by itself, and is *totally* ignorant of your project.
> NB : if you don't know what's a Python package is, please read
> Python's official tutorial, with special attention to the part about
> modules, packages and the pythonpath).
>
> > however i dont even
> > know where to start looking. any help?
>
> Read your apache's error log, you should get more information about
> why your settings file is not found.

-- 
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: www.djangoproject.com

2010-07-01 Thread Daniel Roseman
On Jul 1, 6:40 pm, FC  wrote:
> I can't accesswww.djangoproject.comfrom Buenos Aires, Argentina.
> Firefox says: "The connection has timed out"
>
> Is anyone else having problems?

http://downforeveryoneorjustme.com/www.djangoproject.com

--
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: www.djangoproject.com

2010-07-01 Thread Felippe Bueno
Sao Paulo, Brazil ok.

On Thu, Jul 1, 2010 at 2:42 PM, Rob Broadhead wrote:

> Works fine for me.
>
> On Jul 1, 2010, at 12:40 PM, FC wrote:
>
> I can't access www.djangoproject.com from Buenos Aires, Argentina.
> Firefox says: "The connection has timed out"
>
> Is anyone else having problems?
>
> --
> 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.
>
>
>  Rob Broadhead
> robert.broadh...@gmail.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.
>

-- 
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: Arbitrary Properties from code

2010-07-01 Thread Daniel Roseman
On Jul 1, 3:31 pm, Doug Warren  wrote:
> Let's say I have some models that look like:
>
> class Emotion(models.Model):
>     mood = CharField(unique=True)
>
> class Person(models.Model):
>     emotions = ManyToManyField(Emotion)
>     name = CharField()
>
> angry = Emotion(mood='angry')
> angry.save()
> sad = Emotion(mood='sad')
> sad.save()
> bob = Person(name='Bob')
> bob.emotions.add(angry)
>
> From code I'd like to check if a person has a specific emotion, but if
> that motion hasn't been defined before (IE: the specified mood does
> not exist in the emotion table) I'd like to raise an exception.  So
> what I'm looking for is giving the above, a way to check that bob is
> 'angry', bob is not 'sad', and there is no such thing as 'happy'

bob.emotions.filter(mood='angry').count()   # 1
bob.emotions.filter(mood='sad').count()   # 0
Emotion.objects.get(mood='happy')   # raises Emotion.DoesNotExist
--
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: www.djangoproject.com

2010-07-01 Thread Iván Raskovsky
Buenos Aires, Arnet and Fibertel (ISPs) OK.
Iván

On Thu, Jul 1, 2010 at 3:09 PM, Felippe Bueno wrote:

> Sao Paulo, Brazil ok.
>
>
> On Thu, Jul 1, 2010 at 2:42 PM, Rob Broadhead 
> wrote:
>
>> Works fine for me.
>>
>> On Jul 1, 2010, at 12:40 PM, FC wrote:
>>
>> I can't access www.djangoproject.com from Buenos Aires, Argentina.
>> Firefox says: "The connection has timed out"
>>
>> Is anyone else having problems?
>>
>> --
>> 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.
>>
>>
>>  Rob Broadhead
>> robert.broadh...@gmail.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.
>>
>
>  --
> 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: www.djangoproject.com

2010-07-01 Thread Carsten Fuchs

Hi all,

Am 01.07.2010 19:40, schrieb FC:

I can't access www.djangoproject.com from Buenos Aires, Argentina.
Firefox says: "The connection has timed out"

Is anyone else having problems?


I experience the same when I use Firefox under Ubuntu 10.04 (Lucid Lynx).
Using Firefox under Windows or Epiphany under Ubuntu works.
Will try telnet next time as well.

I already used Wireshark to see what's going on with the unique combination "Firefox under Lucid 
Lynx accessing djangoproject.com": the djangoproject.com host simply doesn't respond to the 
initial HTTP GET request (or the reply never gets through). Not sure what to make from that, tough.


Best regards,
Carsten



--
   Cafu - the open-source Game and Graphics Engine
for multiplayer, cross-platform, real-time 3D Action
  Learn more at http://www.cafu.de



smime.p7s
Description: S/MIME Cryptographic Signature


Re: UnicodeDecodeError: 'utf8' codec can't decode

2010-07-01 Thread Bill Freeman
What's in the database probably isn't legal UTF-8.  It is easily possible
to have a sequence of characters in some other encoding which only
results in the wrong characters if treated as UTF-8, but it is also possible
to violate the UTF-8 structure with such a sequence.  PostgreSQL, if
set for UTF-8, may still not care about the contents of character or
text columns, so long as they don't offend the quoting.

Look at the actual byte sequence in the particular entry in, for example,
hexadecimal.  If a character in which the 0x80 bit is zero is followed by
a character in which the 0x80 bit is set, that is the beginning of a multi
byte encoding of a unicode code point.  In that first character, the number
of contiguous one bits, starting with and including the 0x80 bit,  and in
most significant to least significant, before the most significant zero, is
the number of bytes in the character.  There must be at least 2 bytes,
so the 0x40 bit must also be set.  Any additional bytes required must
have their 0x80 bit a one, and their 0x40 bit a zero (continuation bytes).
Continuation bytes contribute 6 bits each to the construction of an
integer, the first byte contributes 7-n bits.  Byte value 0xFE and 0xFF
are never valid.  Bytes not part of a multi-byte sequence may not have
a one in their 0x80 bit.

Perhaps some other piece of software has dumped something into
PostgreSQL using, say, Latin-1 or Latin-8, etc.

On Thu, Jul 1, 2010 at 10:55 AM, Yateen  wrote:
> Hi,
>
> I am using a postgres database and DJango. I have a http url in my
> database which contains some special characters, but a table query
> returns the result successfully.
>
> select http_url from mytable limit 1;
>                http_url
> 
>  http://östrogenfrei.de/verhuetung.html
>
>
> If I use Django model way to get the same data, I get following error
> -
 from util import *
 cursor = connection.cursor()
 query="select http_url from cfedr_raw_data_20100526_24860_1277981101 where 
 http_url like '%rogenfrei%'"
 cursor.execute(query)
 data = []
 for item in cursor.fetchall():
> ...     print item
> ...     data.append(item)
> ...
> Traceback (most recent call last):
>  File "", line 1, in 
>  File "/firstpool/yjoshi/permanent/starbi/python2.6.1/lib/python2.6/
> encodings/utf_8.py", line 16, in decode
>    return codecs.utf_8_decode(input, errors, True)
> UnicodeDecodeError: 'utf8' codec can't decode bytes in position 7-10:
> invalid data
>
> Can anyone please throw some light on this? why is this occurring?
> what is the solution.
>
> Thanks in advance,
>
> Yateen..
>
> --
> 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: cleaning html with bleach

2010-07-01 Thread Tor Nordam
Thank you both for your replies. I think I'll go for using bleach to
clean on input, and mark as safe on output.

I must say, however, that I'm surprised at how hard it is to find
information about this topic. I would have thought that allowing some,
but not all, html was a relatively common task, and that there would
be a standard solution.

On Jun 30, 6:08 pm, shacker  wrote:
> On Jun 30, 12:00 am, Sam Lai  wrote:
>
> > Nice find - I did pretty much the same thing, but using lxml.Cleaner.
> > This seems more configurable; I'm probably going to change mine over
> > to this instead.
>
> I needed to allow public rich text input on bucketlist.org so had to
> sanitize input carefully, and used this approach:
>
> http://birdhouse.org/blog/2010/05/12/secure-user-input-with-django/
>
> (part of which involves tinymce, but the back-end portion  is
> agnostic).
>
> ./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: www.djangoproject.com

2010-07-01 Thread FC
On Jul 1, 3:41 pm, Carsten Fuchs  wrote:
> Hi all,
>
> Am 01.07.2010 19:40, schrieb FC:
>
> > I can't accesswww.djangoproject.comfrom Buenos Aires, Argentina.
> > Firefox says: "The connection has timed out"
>
> > Is anyone else having problems?
>
> I experience the same when I use Firefox under Ubuntu 10.04 (Lucid Lynx).
> Using Firefox under Windows or Epiphany under Ubuntu works.
> Will try telnet next time as well.
>
> I already used Wireshark to see what's going on with the unique combination 
> "Firefox under Lucid
> Lynx accessing djangoproject.com": the djangoproject.com host simply doesn't 
> respond to the
> initial HTTP GET request (or the reply never gets through). Not sure what to 
> make from that, tough.
>
I can't access from Win2k with Firefox and Opera.
I can't access either from Gentoo and Links.

It's really weird because I can use any other site just fine.

-- 
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: Valid objects are returning an http 404 response

2010-07-01 Thread Bill Freeman
I may be just living under a rock, but I don't know how to use
pdb.set_trace() when not using the development server.  If you do this
successfully, please let me know.

What I have done is append "print"ings to a file, or configure extra
logger outputs.  Under mod_wsgi I get some logging output in the
apache logs without doing anything special, I don't know how it works
with FCGI.

Since you say this is an internal tool, you might try DEBUG=True in
settings.py and getting users to come look at their 404 screens, since
they will then carry extra info.

On Thu, Jul 1, 2010 at 10:41 AM, vjimw  wrote:
> It only happens in our production environment. We have a stage
> environment, which is a mirror of production, that does not have this
> behavior and it does not happen on our development or local
> environments.  The trace is a good idea to try to see more
> information.
>
> On Jul 1, 9:28 am, Bill Freeman  wrote:
>> Does it happen when running the development server?  If so, you get
>> a lot more debugging info right up front (access to variables in each
>> stack from, for instance).  If it's still not clear you can use the trace
>> as a guide as to where to put a pdb.set_trace() (possibly in an if that
>> makes it only trigger in the interesting circumstance) so that you can
>> poke around.
>>
>>
>>
>> On Thu, Jul 1, 2010 at 10:06 AM, vjimw  wrote:
>> > Actually, we are getting our Django 404 page. Sorry to be unclear on
>> > that. The URLs appears as 404 in the access logs.
>>
>> > We are actually using fast_cgi per our system administrator and
>> > wondered if switching to mod_wsgi might help solve the problem, but it
>> > looks like you had the issue with mod_wsgi!
>>
>> > Did recompiling apache solve the problem for you with your Django app
>> > running mod_wsgi?
>>
>> > Thanks for the fast response. Let me know any other information that
>> > my be helpful.
>>
>> > On Jul 1, 9:00 am, "euan.godd...@googlemail.com"
>> >  wrote:
>> >> When you say "an apache 404 error" do you mean a non-Django styled
>> >> one? If so, I think there's something wrong with your apache
>> >> configuration and not your Django app. What mechanism are you using to
>> >> serve the application? I have seen issues like with this mod_wsgi when
>> >> the reload mechanism isn't triggered correctly and you have to restart
>> >> apache to get it work correctly. I think in that case it was because
>> >> I'd compiled apache slightly incorrectly. I never got to the bottom of
>> >> the problem.
>>
>> >> On Jul 1, 2:54 pm, vjimw  wrote:
>>
>> >> > We are having an issue where valid model objects are returning an
>> >> > apache 404 error. Often times, if you hit refresh in the browser a few
>> >> > times, the object is returned with the same URL.
>>
>> >> > We are using Django 1.2.1
>>
>> > --
>> > 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 
>> > 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-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: Arbitrary Properties from code

2010-07-01 Thread Bill Freeman
mood = Emotion.objects.get(mood='thoughtful')

The above raises DoesNotExist if the emotion hasn't been defined.  If
you want to raise a different one, then catch this one and raise your
own.  Then use mood in your query on the person's emotions.

On Thu, Jul 1, 2010 at 10:31 AM, Doug Warren  wrote:
> Let's say I have some models that look like:
>
> class Emotion(models.Model):
>    mood = CharField(unique=True)
>
> class Person(models.Model):
>    emotions = ManyToManyField(Emotion)
>    name = CharField()
>
>
> angry = Emotion(mood='angry')
> angry.save()
> sad = Emotion(mood='sad')
> sad.save()
> bob = Person(name='Bob')
> bob.emotions.add(angry)
>
> From code I'd like to check if a person has a specific emotion, but if
> that motion hasn't been defined before (IE: the specified mood does
> not exist in the emotion table) I'd like to raise an exception.  So
> what I'm looking for is giving the above, a way to check that bob is
> 'angry', bob is not 'sad', and there is no such thing as 'happy'
>
> --
> 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: www.djangoproject.com

2010-07-01 Thread Bill Freeman
You might have a poisoned DNS cache.  Since this is Windows, you could
try rebooting, but there could be other DNS caches between you and a
good name server.

On Thu, Jul 1, 2010 at 3:37 PM, FC  wrote:
> On Jul 1, 3:41 pm, Carsten Fuchs  wrote:
>> Hi all,
>>
>> Am 01.07.2010 19:40, schrieb FC:
>>
>> > I can't accesswww.djangoproject.comfrom Buenos Aires, Argentina.
>> > Firefox says: "The connection has timed out"
>>
>> > Is anyone else having problems?
>>
>> I experience the same when I use Firefox under Ubuntu 10.04 (Lucid Lynx).
>> Using Firefox under Windows or Epiphany under Ubuntu works.
>> Will try telnet next time as well.
>>
>> I already used Wireshark to see what's going on with the unique combination 
>> "Firefox under Lucid
>> Lynx accessing djangoproject.com": the djangoproject.com host simply doesn't 
>> respond to the
>> initial HTTP GET request (or the reply never gets through). Not sure what to 
>> make from that, tough.
>>
> I can't access from Win2k with Firefox and Opera.
> I can't access either from Gentoo and Links.
>
> It's really weird because I can use any other site just fine.
>
> --
> 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.



django simple captcha issue

2010-07-01 Thread weiwei
Hi all,

I am using django-simple-captcha, it works fine on my dev environment
(windows). But after i deployed to linux server, all other views/pages
are working fine. But  when i request  /captcha/image/{{imagekey}}/ i
got server internal error 500.

Something I missed to configure?

Thanks a lot

-- 
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: www.djangoproject.com

2010-07-01 Thread FC
$ ping www.djangoproject.com
PING www.djangoproject.com (64.207.133.18) 56(84) bytes of data.


Can you confirm this is ok?
I get no response but at least it resolves to something.

On Jul 1, 4:50 pm, Bill Freeman  wrote:
> You might have a poisoned DNS cache.  Since this is Windows, you could
> try rebooting, but there could be other DNS caches between you and a
> good name server.
>
>
>
> On Thu, Jul 1, 2010 at 3:37 PM, FC  wrote:
> > On Jul 1, 3:41 pm, Carsten Fuchs  wrote:
> >> Hi all,
>
> >> Am 01.07.2010 19:40, schrieb FC:
>
> >> > I can't accesswww.djangoproject.comfromBuenos Aires, Argentina.
> >> > Firefox says: "The connection has timed out"
>
> >> > Is anyone else having problems?
>
> >> I experience the same when I use Firefox under Ubuntu 10.04 (Lucid Lynx).
> >> Using Firefox under Windows or Epiphany under Ubuntu works.
> >> Will try telnet next time as well.
>
> >> I already used Wireshark to see what's going on with the unique 
> >> combination "Firefox under Lucid
> >> Lynx accessing djangoproject.com": the djangoproject.com host simply 
> >> doesn't respond to the
> >> initial HTTP GET request (or the reply never gets through). Not sure what 
> >> to make from that, tough.
>
> > I can't access from Win2k with Firefox and Opera.
> > I can't access either from Gentoo and Links.
>
> > It's really weird because I can use any other site just fine.
>
> > --
> > 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 
> > 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-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: www.djangoproject.com

2010-07-01 Thread Tim Chase

On 07/01/2010 02:37 PM, FC wrote:

I already used Wireshark to see what's going on with the
unique combination "Firefox under Lucid Lynx accessing
djangoproject.com": the djangoproject.com host simply
doesn't respond to the initial HTTP GET request (or the
reply never gets through). Not sure what to make from that,
tough.


I can't access from Win2k with Firefox and Opera. I can't
access either from Gentoo and Links.

It's really weird because I can use any other site just fine.


I don't know if throwing in this in the mix helps or if it's just
a red herring, but I had difficulties accessing the
docs.python.org a while back and the issue turned out to be IPv6
related (my ISP wasn't routing IPv6 properly).  I disabled it on
my PC and suddenly d.p.o started working.  Don't know if
www.djangoproject.com uses IPv6.

-tkc


--
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: Managing the balance between SSL and impact on the server

2010-07-01 Thread ALJ
Thanks for that Euan.

Steven, you say you have login on SSL and then have the cookie passed
over unencrypted channel for the rest of the site. Is there any risk
with this or mitigating steps that should be taken?

(Sorry ... don't have my head around it)

ALJ

On 1 July, 15:20, steven314  wrote:
> It's a very common pattern to use SSL for login and private profile
> details and then have the cookie passed over an unencrypted channel
> for the rest of the site.
>
> I have implemented an approach where nginx handles all the SSL and
> proxies requests to apache (which directly serves non-SSL requests).
> Transitions between SSL and non-SSL are achieved with rewrites at the
> nginx and apache level, which also means that SSL can be made optional
> on, say, the admin URLs.
>
> This breaks request.is_secure() as it stands but this is easy to work
> around.
>
> Bear in mind that IE may give you loud warnings about insecure content
> if you don't also adjust the MEDIA_URL to use SSL where
> appropriate.
>
> Steven.

-- 
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.test.TestCase in external tests files (KeyError: 'SUPPORTS_TRANSACTIONS'")

2010-07-01 Thread Jari Pennanen
Hi,

I'm trying to use django.test.TestCase class in my project's directory
"tests", e.g.

myapp/models.py
myapp/...
tests/sometest.py

If I use django TestCase inside sometest.py I get:

Traceback (most recent call last):
  File "\django\django\test\testcases.py", line 256, in __call__
self._pre_setup()
  File "\django\django\test\testcases.py", line 223, in _pre_setup
self._fixture_setup()
  File "\django\django\test\testcases.py", line 486, in _fixture_setup
if not connections_support_transactions():
  File "\django\django\test\testcases.py", line 475, in
connections_support_transactions
for conn in connections.all())
  File "\django\django\test\testcases.py", line 475, in 
for conn in connections.all())
KeyError: 'SUPPORTS_TRANSACTIONS'

But if I use it normally in the "myapp/tests.py", and command
"manage.py test myapp" it works just fine. Whats the problem here? I
would prefer to keep my tests outside the main package, and run them
manually without the manage.py (actually Eclipse runs tests directory
tests automatically).

My testing file currently is pretty simple:

from django.test import TestCase

class SomeTestCase(TestCase):
def test_something(self):
pass

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: www.djangoproject.com

2010-07-01 Thread Felippe Bueno
www.djangoproject.com has address 64.207.133.18



On Thu, Jul 1, 2010 at 5:07 PM, FC  wrote:

> $ ping www.djangoproject.com
> PING www.djangoproject.com (64.207.133.18) 56(84) bytes of data.
>
>
> Can you confirm this is ok?
> I get no response but at least it resolves to something.
>
> On Jul 1, 4:50 pm, Bill Freeman  wrote:
> > You might have a poisoned DNS cache.  Since this is Windows, you could
> > try rebooting, but there could be other DNS caches between you and a
> > good name server.
> >
> >
> >
> > On Thu, Jul 1, 2010 at 3:37 PM, FC  wrote:
> > > On Jul 1, 3:41 pm, Carsten Fuchs  wrote:
> > >> Hi all,
> >
> > >> Am 01.07.2010 19:40, schrieb FC:
> >
> > >> > I can't accesswww.djangoproject.comfromBuenos Aires, Argentina.
> > >> > Firefox says: "The connection has timed out"
> >
> > >> > Is anyone else having problems?
> >
> > >> I experience the same when I use Firefox under Ubuntu 10.04 (Lucid
> Lynx).
> > >> Using Firefox under Windows or Epiphany under Ubuntu works.
> > >> Will try telnet next time as well.
> >
> > >> I already used Wireshark to see what's going on with the unique
> combination "Firefox under Lucid
> > >> Lynx accessing djangoproject.com": the djangoproject.com host simply
> doesn't respond to the
> > >> initial HTTP GET request (or the reply never gets through). Not sure
> what to make from that, tough.
> >
> > > I can't access from Win2k with Firefox and Opera.
> > > I can't access either from Gentoo and Links.
> >
> > > It's really weird because I can use any other site just fine.
> >
> > > --
> > > 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 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-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.



Newbie Q: Is there a way to prevent Django from creating fields w. 'Not Null' by default?

2010-07-01 Thread Barto
I've been following 'Writing Your First Django App. Pt. 1'
substituting my own object names in experiment.

Noticed that when I told Django to create my tables, it did so giving
all (psycopg2/postgres) fields the 'not null' setting. Easy to change
this via PgAdmin, but I'm wondering if it is possible to prevent 'not
null' from being assumed as default.

-- 
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: Newbie Q: Is there a way to prevent Django from creating fields w. 'Not Null' by default?

2010-07-01 Thread Michael
On Thu, Jul 1, 2010 at 4:16 PM, Barto  wrote:

> I've been following 'Writing Your First Django App. Pt. 1'
> substituting my own object names in experiment.
>
> Noticed that when I told Django to create my tables, it did so giving
> all (psycopg2/postgres) fields the 'not null' setting. Easy to change
> this via PgAdmin, but I'm wondering if it is possible to prevent 'not
> null' from being assumed as default.
>
>
http://docs.djangoproject.com/en/dev/ref/models/fields/#null

-- 
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: Translation problem

2010-07-01 Thread Daniel
Of course my_mail() is more complicated than my example. But I am not
touching "subject" elsewhere as in the posted lines (I am only passing
it to EmailMessage). Thus, I did not consider the rest of my_mail() to
be important.

Is there a way to check at a certain point if the the proxy object has
already been translated without interfering in the translation
process?

Thanks,
Daniel

-- 
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 on multiple servers? (Deployment Problem)

2010-07-01 Thread bruno desthuilliers
On 1 juil, 19:56, nano  wrote:
> Ok, thanks. sorry for my rather dumbed down language- by saying that
> django 'knew' about the project i was implying that perhaps some
> change was made in some configuration file in the django library,

That's what I understood, but I fail to see what made you think it
would be the case.

>
> but again, thanks, ive been able to get it working.

Fine. Now by all means DO NOT explain what went wrong and how you
solved it, as this might one day help someone having the same problem
- and we DON'T want to help, do we ?

-- 
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: www.djangoproject.com

2010-07-01 Thread George Sakkis
On Jul 1, 8:41 pm, Carsten Fuchs  wrote:
> Hi all,
>
> Am 01.07.2010 19:40, schrieb FC:
>
> > I can't accesswww.djangoproject.comfrom Buenos Aires, Argentina.
> > Firefox says: "The connection has timed out"
>
> > Is anyone else having problems?
>
> I experience the same when I use Firefox under Ubuntu 10.04 (Lucid Lynx).
> Using Firefox under Windows or Epiphany under Ubuntu works.
> Will try telnet next time as well.
>
> I already used Wireshark to see what's going on with the unique combination 
> "Firefox under Lucid
> Lynx accessing djangoproject.com": the djangoproject.com host simply doesn't 
> respond to the
> initial HTTP GET request (or the reply never gets through). Not sure what to 
> make from that, tough.

For the last 12 hours at least I can't connect with Firefox under
Lucid from two different computers and IPs. I just tried Chromium
under Lucid and it does connect. So indeed there's something funny
going on with the Firefox/Ubuntu combo.

George

-- 
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 on multiple servers? (Deployment Problem)

2010-07-01 Thread nano
On Jul 1, 5:52 pm, bruno desthuilliers 
wrote:

> That's what I understood, but I fail to see what made you think it
> would be the case.

It was what i implied when the app ran well on the machine that I had
run the 'startproject' command on and didn't run at all on the one
that i hadn't. I thought that perhaps one of the things startproject
did was to add the directory to the sys.path. It was a reasonable
conclusion, i think, just a faulty premise. excuse me if i hadn't done
all my homework before starting to work on this.


anyway, the first problem was that i hadn't added the entire path to
the sys.path in the django.wsgi script, just the top of it, the cause
of which was my own misinterpretation of a help page.  The database
problem was because the database's parent directory wasn't writable by
apache. making the database file as well as its parent direcory
writable by apache and running syncdb solved the database problem AND
the admin problem, although i have to admit that i have no idea how it
solved that (and it may be notable that the admin page works, just
without any formatting. confusing but not entierly detrimental)

as for running the app parallel to a static site, i had to change all
the urls in all the templates and any pages referencing it to "/app/
myapp", as opposed to just "/myapp", where "/app" was the
WSGIscriptalias. the weird url generation was because of a missing
forward slash in the link on the template pages.

again, both sorry and 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.



Newbie Question - django-jython - how to "run" the app?

2010-07-01 Thread Victor Hooi
heya,

I've trying to get my Django app to run on a Tomcat 5.x server, using
django-jython. I'm a bit of a newbie in the Java/Tomcat world though.

Firstly, I'm currently using PostgreSQL. However, to make things
easier on the target server, I was just going to use SQLite3 - the app
will only be used by two users, and getting a database in this
deployment environment is a bit tricky. However, I read on the django-
jython pages that SQlite3 support is experimental and considered
risky:

http://packages.python.org/django-jython/database-backends.html

Is that still true? Should I try and push hard to get a database setup
for me? The only one they offer is MySQL, there's a few hoops to get
that though.

Secondly, apparently this Tomcat server doesn't take WAR archives
files, you need to explode them first. Anyhow, I've unzipped the WAR
archive to the directory, now I'm not exactly sure how to get it to
actually run.

Under my app context directory, my structure looks like (where
application is called chair, just for example's sake)

\chair
 - application.py
 - application$py.class
 \WEB-INF
   web.xml
   \lib
- jruby-extras-fileservlet.jar
- jython.jar
   \lib-python
 - Lib.pth
 - README
 \chair
 \django
 \doj
 \Lib

etc.

Is this right, or am I missing any files/directories in the WAR
creation?

Apart from setting up the context, what exactly do I need to do (or
get the web server administrator) to do to get the application to run?
Do I need to get them to import the web.xml file? I had a look in
there, didn't seem to find anything that seems to "run" my app, or
point to anything to get it to run?

Cheers,
Victor

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



Problem with jdbc postgresql driver

2010-07-01 Thread Hugo
Hi everyone,

I am experiencing a funny issue with the jdbc driver when trying to
run syncdb.

I've installed jython2.5.1, Django-1.2.1 and django-jython-1.1.1

1. I create a project 'mysite'...

2. change settings.py:
 DATABASE_ENGINE = 'doj.backends.zxjdbc.postgresql'
 DATABASE_NAME = 'mysite' # Or path to database file if
using sqlite3.
 DATABASE_USER = 'hugo' # Not used with sqlite3.
 DATABASE_PASSWORD = 'newuser1' # Not used with sqlite3.
 DATABASE_HOST = '' # Set to empty string for localhost.
Not used with sqlite3.
 DATABASE_PORT = '' # Set to empty string for default. Not
used with sqlite3.

3. set my CLASSPATH=/path/to/jdbc/postgresql/jar.file

4. run jython manage.py syncdb


The problem is I get the following error:

Traceback (most recent call last):
  File "manage.py", line 11, in 
execute_manager(settings)
  File "/opt/jython2.5.1/Lib/site-packages/django/core/management/
__init__.py", line 438, in execute_manager
utility.execute()
  File "/opt/jython2.5.1/Lib/site-packages/django/core/management/
__init__.py", line 379, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/opt/jython2.5.1/Lib/site-packages/django/core/management/
__init__.py", line 257, in fetch_command
klass = load_command_class(app_name, subcommand)
  File "/opt/jython2.5.1/Lib/site-packages/django/core/management/
__init__.py", line 257, in fetch_command
klass = load_command_class(app_name, subcommand)
  File "/opt/jython2.5.1/Lib/site-packages/django/core/management/
__init__.py", line 67, in load_command_class
module = import_module('%s.management.commands.%s' % (app_name,
name))
  File "/opt/jython2.5.1/Lib/site-packages/django/utils/importlib.py",
line 35, in import_module
__import__(name)
  File "/opt/jython2.5.1/Lib/site-packages/django/core/management/
commands/syncdb.py", line 7, in 
from django.core.management.sql import custom_sql_for_model,
emit_post_sync_signal
  File "/opt/jython2.5.1/Lib/site-packages/django/core/management/
sql.py", line 5, in 
from django.contrib.contenttypes import generic
  File "/opt/jython2.5.1/Lib/site-packages/django/contrib/contenttypes/
generic.py", line 6, in 
from django.db import connection
  File "/opt/jython2.5.1/Lib/site-packages/django/db/__init__.py",
line 75, in 
connection = connections[DEFAULT_DB_ALIAS]
  File "/opt/jython2.5.1/Lib/site-packages/django/db/utils.py", line
92, in __getitem__
conn = backend.DatabaseWrapper(db, alias)
  File "/opt/jython2.5.1/Lib/site-packages/doj/backends/zxjdbc/
postgresql/base.py", line 70, in __init__
self.ops = DatabaseOperations()
TypeError: __init__() takes exactly 2 arguments (1 given)

I can't be alone experiencing this issue... and the solution is
probably pretty simple... but I can't seem to find anything.


Thank you for the help!
Hugo

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



Personalization and preferences?

2010-07-01 Thread zweb
On my web pages I have  labels for text fields. I want user to be able
to personalize the labels.

Example :
default label: Employee, alternative is that user can choose -
Associate or Staff Member.
Depending on which label an user chooses, all screens should show that
label for that user. Other users can see other label they choose.
I am ok in providing fixed set of labels to choose from if that
simplifies things.
This problem is very similar to I18N except it is not based on locale.
What is the best approach?

Approach:
1. When user logs in - gets his preferences from DB and save it in
session.

2. I create a custom template {% getlabeltext employee %}

something like ** psuedo code **
def getLabelText('employee'):

   if 'employee' in request.session:
return request.session['employee']
   else:
   return DEFAULT

Is there a better approach or some one already done in 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.



Nginx-fcgi setup guidance needed to render certain views with HTTPS.

2010-07-01 Thread Sam Walters
Hi Django Users

I have been looking to make some of my views secured by SSL, i have
made a certificate for testing.

For the views which require https i rewrite the url and redirect using
a decorator.
In theory this should redirect and nginx will server the views through https.

Instead what i find is the "The page isn't redirecting properly"
Looking at firebug its looping over and over again with a GET request
to https://url.com/payments/

Which seems to indicate the nging.conf entry for my /payments/
location is not configured correctly.

Im new to the https stuff so if anyone could take a look and give me
tips it would be greatly appreciated.

http://pastebin.com/Jauysm9C

cheers

sam_w

-- 
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 simple captcha issue

2010-07-01 Thread Venkatraman S
On Fri, Jul 2, 2010 at 1:22 AM, weiwei  wrote:

>
> I am using django-simple-captcha, it works fine on my dev environment
> (windows). But after i deployed to linux server, all other views/pages
> are working fine. But  when i request  /captcha/image/{{imagekey}}/ i
> got server internal error 500.
>

Sorry to digress, but i use recaptcha, which is much easier to configure+use
and also is one of the better solutions out there.

-V-
http://twitter.com/venkasub

-- 
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.test.TestCase in external tests files (KeyError: 'SUPPORTS_TRANSACTIONS'")

2010-07-01 Thread Karen Tracey
On Thu, Jul 1, 2010 at 4:41 PM, Jari Pennanen wrote:

> Hi,
>
> I'm trying to use django.test.TestCase class in my project's directory
> "tests", e.g.
>
> myapp/models.py
> myapp/...
> tests/sometest.py
>
> If I use django TestCase inside sometest.py I get:
>
> Traceback (most recent call last):
>  File "\django\django\test\testcases.py", line 256, in __call__
>self._pre_setup()
>  File "\django\django\test\testcases.py", line 223, in _pre_setup
>self._fixture_setup()
>  File "\django\django\test\testcases.py", line 486, in _fixture_setup
>if not connections_support_transactions():
>  File "\django\django\test\testcases.py", line 475, in
> connections_support_transactions
>for conn in connections.all())
>  File "\django\django\test\testcases.py", line 475, in 
>for conn in connections.all())
> KeyError: 'SUPPORTS_TRANSACTIONS'
>
> But if I use it normally in the "myapp/tests.py", and command
> "manage.py test myapp" it works just fine. Whats the problem here? I
> would prefer to keep my tests outside the main package, and run them
> manually without the manage.py (actually Eclipse runs tests directory
> tests automatically).
>
> My testing file currently is pretty simple:
>
>from django.test import TestCase
>
>class SomeTestCase(TestCase):
>def test_something(self):
>pass
>
>
manage.py test, before running any test cases, does a fair amount of setup,
including things like creating a test database for the tests to use. The
error you are seeing is a side-effect of this setup code not running before
the test code is called. If you want to use a different structure for your
tests you can, but you will need to make sure your test runner does
everything necessary to set up the environment properly for a
django.test.TestCase to run.  See:
http://docs.djangoproject.com/en/1.2/topics/testing/#using-different-testing-frameworks

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.



Newbie: Google App Engine and Facebook

2010-07-01 Thread Binh
Hi,

Has anyone here built a facebook canvas application using Django 1.*
and got it working on Google App Engine?

If so, can you give pointers on how I can learn 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: deployment problem

2010-07-01 Thread kakarukeys
On Jun 30, 9:38 pm, kakarukeys  wrote:
> I tried to deploy a simple web app I wrote in Django and ran into
> problem with user authentication.
>
> On production server, the following steps didn't work like expected
> (on development server).
>
> "log in using a test user account,
> access a restricted page."
>
> it shows login required error message,
> the page is displayed properly only after a refresh.
>
> On development server, there is (should be) no error message.
>
> All unit-tests passed on development and production server.
> What could be causing it? Let me know if you need other info.

nobody seems to know the answer.
Anyway, the problem is solved by adding a cache control header to each
response

-- 
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 you need a code review

2010-07-01 Thread Lee Hinde
I'm new to Django. I've done one modest, search only, public site
prior to my current project. I'm also new to python. While I'm new to
all this, I've been doing web dev. for 14 years.

The site I'm working on now is a low-user intranet for a local
restaurant chain.  I was able to conceptualize the whole thing, there
weren't any real challenges in the design. It's just that the tools
were all new. Google and a stack of books were my friend.

During the course of  my development I ran across a helpful blog post
(http://blog.roseman.org.uk/2010/05/10/django-aggregation-and-simple-group/)
on aggregation that actually provided a working example of something I
was needing to do. I added the blog to my reader list and moved on.

After I was done with the first phase of the project I went looking
for a code review. I was hoping to have someone point out where I was
working too hard, missing pythonic approaches and/or Django features.
And, I went back to the author of the very helpful blog post.

The point of all this is to highly recommend Daniel Roseman
(http://www.roseman.org.uk/) if you're inclined to have someone review
your work.  Mr. Roseman was kind (I was sort of prepared to get ripped
as only one can on the internet.), concise and helpful. We had an hour
and a half of Skype enabled review and I don't feel there was a wasted
minute.

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



Any implement of event bus in django

2010-07-01 Thread cat in a tub
Hi

I am wondering whether there is any implement of event bus (a
centralized control of sub/dist event via ajax sync).
Google use this design pattern in its ad-words by java. Does django
have similar solutions ?

Cheers
Homer

-- 
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 can I access attributes in intermediate class

2010-07-01 Thread cat in a tub
I found model inheritance may be a better solution: combine may model
into one (Similar to views combining tables in database)


Quote:

Model inheritance in Django works almost identically to the way normal
class inheritance works in Python. The only decision you have to make
is whether you want the parent models to be models in their own right
(with their own database tables), or if the parents are just holders
of common information that will only be visible through the child
models.

There are three styles of inheritance that are possible in Django.

   1. Often, you will just want to use the parent class to hold
information that you don't want to have to type out for each child
model. This class isn't going to ever be used in isolation, so
Abstract base classes are what you're after.
   2. If you're subclassing an existing model (perhaps something from
another application entirely) and want each model to have its own
database table, Multi-table inheritance is the way to go.
   3. Finally, if you only want to modify the Python-level behaviour
of a model, without changing the models fields in any way, you can use
Proxy models.


On Jun 29, 12:04 pm, Alexandre González  wrote:
> I was intrigued so I did it, I get this solution:
>
> from models import User, Group, Membership
>
> def example(request):
>     example_group_id = 1 #I create only one group to test, this is his id
>
>     group = Group.objects.get(pk=example_group_id)
>     for user in group.members.iterator(): #Get all user in the group
> throught the membership
>         membership = Membership.objects.get(person=user, group=group) #Get
> the membership object using the user and the group as keys
>         membership.date_joined # Now you can read your date_joined
>
> Perhaps it isn't the best way to do it, but it works :p
>
> I hope this helps you,
> Álex González
>
> On Tue, Jun 29, 2010 at 19:45, cat in a tub  wrote:
>
>
>
> > class User(models.Model):
> >    name = models.CharField(max_length=128)
>
> > class Group(models.Model):
> >    name = models.CharField(max_length=128)
> >    members = models.ManyToManyField(User, through='Membership')
>
> > class Membership(models.Model):
> >    person = models.ForeignKey(User)
> >    group = models.ForeignKey(Group)
> >    date_joined = models.DateField()
>
> > What if I want to access Membership.data_joined in Group class?
>
> > 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.
>
> --
> Please, don't send me files with extensions: .doc, .docx, .xls, .xlsx, .ppt
> and/or .pptxhttp://mirblu.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.