Re: Platform system with Django?

2011-09-26 Thread Phang Mulianto
of cource it can be done.
it will be your application logic jobs and the database layout...
On Sep 26, 2011 12:57 PM, "Ian"  wrote:
> I'm new to django, and at this point all I've done is the tutorial.
>
> But my end goal is to create a website that serves as a platform
> system.
>
> I want users to go to my site, create an account, edit some settings/
> preferences, and a subdomain (can you do this with django?).
>
> Then within each subdomain, other people can register as users to this
> particular subdomain, post things, etc.
>
> Is it possible to do this? I can imagine the structure and how to get
> the second part working (having users register on a particular
> subdomain site, post things, etc), but I'm having trouble figuring out
> where to get started with the first part (creating the subdomain site)
>
> Is there a tutorial or guide to get me started with this platform
> concept? Thanks so much!
>
> --
> You received this message because you are subscribed to the Google Groups
"Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
django-users+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-users@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: Platform system with Django?

2011-09-26 Thread Markus Gattol
Have you had a look at the sites framework yet: 
https://docs.djangoproject.com/en/dev/ref/contrib/sites/ That might just be 
what you're after...

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/PCEgsyKf-ywJ.
To post to this group, send email to django-users@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: Web Designer

2011-09-26 Thread Markus Gattol
I'd say most people us a simple text editor such as Vim, Emacs... If you use 
runserver and and your browsers auto-reload for that tab then that's all you 
need. If you want to be a bit speedier then you can use things like 
Sass/Compass for your CSS and maybe HamlPy for your HTML. Both have "watch" 
commands that watch your .sass/.haml files and automatically create the 
.css/.html which would then be picked up be runserver which in turn gets 
reloaded by your browser's tab for which you set the autoload toggle.

for HTML
 - https://github.com/jessemiller/HamlPy

for CSS
 - https://github.com/chriseppstein/compass (is written in Sass)
 - https://github.com/nex3/sass

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/TeaOlJLTbK0J.
To post to this group, send email to django-users@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: FieldError on ManyToMany after upgrading to Django 1.3

2011-09-26 Thread Philip Mountifield

Has anyone else experienced this error? Any help would be appreciated.

Thanks

Philip

On 23/09/2011 14:40, Philip wrote:

Just been updating to Django 1.3.1 and come across an odd error. I'm
getting the following error from some code which works with version
1.2.7.

FieldError: Cannot resolve keyword 'email_config_set' into field.
Choices are: id, name, site, type

The odd thing being email_config_set is a related name for a
ManyToMany field. I'm not sure why django is trying to resolve it into
a field.

To make it even more odd, this error occurs when DEBUG = TRUE and not
when DEBUG = FALSE when testing with runserver.

I've been trying to solve this for days now with much googling/pdb/
logging, but since the exception originates deep inside django I'm not
familiar enough to find what is going wrong:

Traceback (most recent call last):
   File "./core/driver.py", line 268, in run
 self.init_norm()
   File "./driver/emailevent/background.py", line 130, in init_norm
 self.load_config()
   File "./driver/emailevent/background.py", line 71, in load_config
 events = list(config.events.select_related())
   File "/usr/local/lib/python2.6/site-packages/Django-1.3.1-py2.6.egg/
django/db/models/manager.py", line 168, in select_related
 return self.get_query_set().select_related(*args, **kwargs)
   File "/usr/local/lib/python2.6/site-packages/Django-1.3.1-py2.6.egg/
django/db/models/fields/related.py", line 497, in get_query_set
 return
superclass.get_query_set(self).using(db)._next_is_sticky().filter(**(self.core_filters))
   File "/usr/local/lib/python2.6/site-packages/Django-1.3.1-py2.6.egg/
django/db/models/query.py", line 550, in filter
 return self._filter_or_exclude(False, *args, **kwargs)
   File "/usr/local/lib/python2.6/site-packages/Django-1.3.1-py2.6.egg/
django/db/models/query.py", line 568, in _filter_or_exclude
 clone.query.add_q(Q(*args, **kwargs))
   File "/usr/local/lib/python2.6/site-packages/Django-1.3.1-py2.6.egg/
django/db/models/sql/query.py", line 1194, in add_q
 can_reuse=used_aliases, force_having=force_having)
   File "/usr/local/lib/python2.6/site-packages/Django-1.3.1-py2.6.egg/
django/db/models/sql/query.py", line 1069, in add_filter
 negate=negate, process_extras=process_extras)
   File "/usr/local/lib/python2.6/site-packages/Django-1.3.1-py2.6.egg/
django/db/models/sql/query.py", line 1260, in setup_joins
 "Choices are: %s" % (name, ", ".join(names)))
FieldError: Cannot resolve keyword 'email_config_set' into field.
Choices are: id, name, site, type

Any ideas/solutions/pointers/tips would be most welcome.


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



Re: FieldError on ManyToMany after upgrading to Django 1.3

2011-09-26 Thread Russell Keith-Magee
Hi Philip,

I can't say I've seen the error you report.

My immediate question when I see reports like this is "what else are
you doing?". Django has an extensive test suite, and things like m2m
fields are tested very heavily. Outside of Django's test suite, there
are thousands of applications out there using Django, and many of them
are using Django 1.3, and this is the first time that this particular
problem has been reported. So, you are clearly doing *something* that
is unusual (whether you know it's unusual or not).

What we need is a reproducible test case -- the smallest possible
sample of code that works under 1.2.7, but breaks under 1.3.1. That
will provide us the basis on which to debug the problem, and form the
core of a regression test to make sure the problem doesn't occur again
in the future.

Yours,
Russ Magee %-)

On Mon, Sep 26, 2011 at 4:27 PM, Philip Mountifield
 wrote:
> Has anyone else experienced this error? Any help would be appreciated.
>
> Thanks
>
> Philip
>
> On 23/09/2011 14:40, Philip wrote:
>>
>> Just been updating to Django 1.3.1 and come across an odd error. I'm
>> getting the following error from some code which works with version
>> 1.2.7.
>>
>> FieldError: Cannot resolve keyword 'email_config_set' into field.
>> Choices are: id, name, site, type
>>
>> The odd thing being email_config_set is a related name for a
>> ManyToMany field. I'm not sure why django is trying to resolve it into
>> a field.
>>
>> To make it even more odd, this error occurs when DEBUG = TRUE and not
>> when DEBUG = FALSE when testing with runserver.
>>
>> I've been trying to solve this for days now with much googling/pdb/
>> logging, but since the exception originates deep inside django I'm not
>> familiar enough to find what is going wrong:
>>
>> Traceback (most recent call last):
>>   File "./core/driver.py", line 268, in run
>>     self.init_norm()
>>   File "./driver/emailevent/background.py", line 130, in init_norm
>>     self.load_config()
>>   File "./driver/emailevent/background.py", line 71, in load_config
>>     events = list(config.events.select_related())
>>   File "/usr/local/lib/python2.6/site-packages/Django-1.3.1-py2.6.egg/
>> django/db/models/manager.py", line 168, in select_related
>>     return self.get_query_set().select_related(*args, **kwargs)
>>   File "/usr/local/lib/python2.6/site-packages/Django-1.3.1-py2.6.egg/
>> django/db/models/fields/related.py", line 497, in get_query_set
>>     return
>>
>> superclass.get_query_set(self).using(db)._next_is_sticky().filter(**(self.core_filters))
>>   File "/usr/local/lib/python2.6/site-packages/Django-1.3.1-py2.6.egg/
>> django/db/models/query.py", line 550, in filter
>>     return self._filter_or_exclude(False, *args, **kwargs)
>>   File "/usr/local/lib/python2.6/site-packages/Django-1.3.1-py2.6.egg/
>> django/db/models/query.py", line 568, in _filter_or_exclude
>>     clone.query.add_q(Q(*args, **kwargs))
>>   File "/usr/local/lib/python2.6/site-packages/Django-1.3.1-py2.6.egg/
>> django/db/models/sql/query.py", line 1194, in add_q
>>     can_reuse=used_aliases, force_having=force_having)
>>   File "/usr/local/lib/python2.6/site-packages/Django-1.3.1-py2.6.egg/
>> django/db/models/sql/query.py", line 1069, in add_filter
>>     negate=negate, process_extras=process_extras)
>>   File "/usr/local/lib/python2.6/site-packages/Django-1.3.1-py2.6.egg/
>> django/db/models/sql/query.py", line 1260, in setup_joins
>>     "Choices are: %s" % (name, ", ".join(names)))
>> FieldError: Cannot resolve keyword 'email_config_set' into field.
>> Choices are: id, name, site, type
>>
>> Any ideas/solutions/pointers/tips would be most welcome.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+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-users@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: FieldError on ManyToMany after upgrading to Django 1.3

2011-09-26 Thread David Markey
I had some problems with 1.3 and Postgres 8.1,

Are you using psycopg2 and pg 8.1?

On 26 September 2011 11:16, Russell Keith-Magee wrote:

> Hi Philip,
>
> I can't say I've seen the error you report.
>
> My immediate question when I see reports like this is "what else are
> you doing?". Django has an extensive test suite, and things like m2m
> fields are tested very heavily. Outside of Django's test suite, there
> are thousands of applications out there using Django, and many of them
> are using Django 1.3, and this is the first time that this particular
> problem has been reported. So, you are clearly doing *something* that
> is unusual (whether you know it's unusual or not).
>
> What we need is a reproducible test case -- the smallest possible
> sample of code that works under 1.2.7, but breaks under 1.3.1. That
> will provide us the basis on which to debug the problem, and form the
> core of a regression test to make sure the problem doesn't occur again
> in the future.
>
> Yours,
> Russ Magee %-)
>
> On Mon, Sep 26, 2011 at 4:27 PM, Philip Mountifield
>  wrote:
> > Has anyone else experienced this error? Any help would be appreciated.
> >
> > Thanks
> >
> > Philip
> >
> > On 23/09/2011 14:40, Philip wrote:
> >>
> >> Just been updating to Django 1.3.1 and come across an odd error. I'm
> >> getting the following error from some code which works with version
> >> 1.2.7.
> >>
> >> FieldError: Cannot resolve keyword 'email_config_set' into field.
> >> Choices are: id, name, site, type
> >>
> >> The odd thing being email_config_set is a related name for a
> >> ManyToMany field. I'm not sure why django is trying to resolve it into
> >> a field.
> >>
> >> To make it even more odd, this error occurs when DEBUG = TRUE and not
> >> when DEBUG = FALSE when testing with runserver.
> >>
> >> I've been trying to solve this for days now with much googling/pdb/
> >> logging, but since the exception originates deep inside django I'm not
> >> familiar enough to find what is going wrong:
> >>
> >> Traceback (most recent call last):
> >>   File "./core/driver.py", line 268, in run
> >> self.init_norm()
> >>   File "./driver/emailevent/background.py", line 130, in init_norm
> >> self.load_config()
> >>   File "./driver/emailevent/background.py", line 71, in load_config
> >> events = list(config.events.select_related())
> >>   File "/usr/local/lib/python2.6/site-packages/Django-1.3.1-py2.6.egg/
> >> django/db/models/manager.py", line 168, in select_related
> >> return self.get_query_set().select_related(*args, **kwargs)
> >>   File "/usr/local/lib/python2.6/site-packages/Django-1.3.1-py2.6.egg/
> >> django/db/models/fields/related.py", line 497, in get_query_set
> >> return
> >>
> >>
> superclass.get_query_set(self).using(db)._next_is_sticky().filter(**(self.core_filters))
> >>   File "/usr/local/lib/python2.6/site-packages/Django-1.3.1-py2.6.egg/
> >> django/db/models/query.py", line 550, in filter
> >> return self._filter_or_exclude(False, *args, **kwargs)
> >>   File "/usr/local/lib/python2.6/site-packages/Django-1.3.1-py2.6.egg/
> >> django/db/models/query.py", line 568, in _filter_or_exclude
> >> clone.query.add_q(Q(*args, **kwargs))
> >>   File "/usr/local/lib/python2.6/site-packages/Django-1.3.1-py2.6.egg/
> >> django/db/models/sql/query.py", line 1194, in add_q
> >> can_reuse=used_aliases, force_having=force_having)
> >>   File "/usr/local/lib/python2.6/site-packages/Django-1.3.1-py2.6.egg/
> >> django/db/models/sql/query.py", line 1069, in add_filter
> >> negate=negate, process_extras=process_extras)
> >>   File "/usr/local/lib/python2.6/site-packages/Django-1.3.1-py2.6.egg/
> >> django/db/models/sql/query.py", line 1260, in setup_joins
> >> "Choices are: %s" % (name, ", ".join(names)))
> >> FieldError: Cannot resolve keyword 'email_config_set' into field.
> >> Choices are: id, name, site, type
> >>
> >> Any ideas/solutions/pointers/tips would be most welcome.
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Django users" group.
> > To post to this group, send email to django-users@googlegroups.com.
> > To unsubscribe from this group, send email to
> > django-users+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-users@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-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, v

Re: FieldError on ManyToMany after upgrading to Django 1.3

2011-09-26 Thread Matthias Kestenholz
Hi Philip

On Fri, Sep 23, 2011 at 3:40 PM, Philip  wrote:
> FieldError: Cannot resolve keyword 'email_config_set' into field.
> Choices are: id, name, site, type
>
> Any ideas/solutions/pointers/tips would be most welcome.

Yes, I've seen similar problems in two sites I'm running. I suspect it
has to do with dynamically created models and startup timing effects
in our case. I'm not sure when it started and it's really hard to test
because it only happens in production (mod_wsgi / DEBUG=False) and I
don't have a consistent view of when the problem happens yet.

What we are doing in FeinCMS against it is trying to remove the caches
on Model._meta when new models are being created; this works for us,
but isn't all that nice. I'm running the following code in production
and will be waiting a few hours / days for the problem to manifest
itself again, hoping it wont:
https://github.com/matthiask/feincms/commit/f2de708a09f8b6cf4fdbca6b3583747b6ebbc2e2


Matthias

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



Re: FieldError on ManyToMany after upgrading to Django 1.3

2011-09-26 Thread Philip Mountifield
I am indeed using psycopyg2 and pg8.1, which version did you move to in 
order to solve the problem? I have just been using 8.1 since it was the 
default for CentOS 5, but I also see the 8.4 is available via yum.


Philip

On 26/09/2011 11:20, David Markey wrote:

I had some problems with 1.3 and Postgres 8.1,

Are you using psycopg2 and pg 8.1?

On 26 September 2011 11:16, Russell Keith-Magee 
mailto:russ...@keith-magee.com>> wrote:


Hi Philip,

I can't say I've seen the error you report.

My immediate question when I see reports like this is "what else are
you doing?". Django has an extensive test suite, and things like m2m
fields are tested very heavily. Outside of Django's test suite, there
are thousands of applications out there using Django, and many of them
are using Django 1.3, and this is the first time that this particular
problem has been reported. So, you are clearly doing *something* that
is unusual (whether you know it's unusual or not).

What we need is a reproducible test case -- the smallest possible
sample of code that works under 1.2.7, but breaks under 1.3.1. That
will provide us the basis on which to debug the problem, and form the
core of a regression test to make sure the problem doesn't occur again
in the future.

Yours,
Russ Magee %-)

On Mon, Sep 26, 2011 at 4:27 PM, Philip Mountifield
mailto:pmountifi...@formac.net>> wrote:
> Has anyone else experienced this error? Any help would be
appreciated.
>
> Thanks
>
> Philip
>
> On 23/09/2011 14:40, Philip wrote:
>>
>> Just been updating to Django 1.3.1 and come across an odd
error. I'm
>> getting the following error from some code which works with version
>> 1.2.7.
>>
>> FieldError: Cannot resolve keyword 'email_config_set' into field.
>> Choices are: id, name, site, type
>>
>> The odd thing being email_config_set is a related name for a
>> ManyToMany field. I'm not sure why django is trying to resolve
it into
>> a field.
>>
>> To make it even more odd, this error occurs when DEBUG = TRUE
and not
>> when DEBUG = FALSE when testing with runserver.
>>
>> I've been trying to solve this for days now with much googling/pdb/
>> logging, but since the exception originates deep inside django
I'm not
>> familiar enough to find what is going wrong:
>>
>> Traceback (most recent call last):
>>   File "./core/driver.py", line 268, in run
>> self.init_norm()
>>   File "./driver/emailevent/background.py", line 130, in init_norm
>> self.load_config()
>>   File "./driver/emailevent/background.py", line 71, in load_config
>> events = list(config.events.select_related())
>>   File
"/usr/local/lib/python2.6/site-packages/Django-1.3.1-py2.6.egg/
>> django/db/models/manager.py", line 168, in select_related
>> return self.get_query_set().select_related(*args, **kwargs)
>>   File
"/usr/local/lib/python2.6/site-packages/Django-1.3.1-py2.6.egg/
>> django/db/models/fields/related.py", line 497, in get_query_set
>> return
>>
>>

superclass.get_query_set(self).using(db)._next_is_sticky().filter(**(self.core_filters))
>>   File
"/usr/local/lib/python2.6/site-packages/Django-1.3.1-py2.6.egg/
>> django/db/models/query.py", line 550, in filter
>> return self._filter_or_exclude(False, *args, **kwargs)
>>   File
"/usr/local/lib/python2.6/site-packages/Django-1.3.1-py2.6.egg/
>> django/db/models/query.py", line 568, in _filter_or_exclude
>> clone.query.add_q(Q(*args, **kwargs))
>>   File
"/usr/local/lib/python2.6/site-packages/Django-1.3.1-py2.6.egg/
>> django/db/models/sql/query.py", line 1194, in add_q
>> can_reuse=used_aliases, force_having=force_having)
>>   File
"/usr/local/lib/python2.6/site-packages/Django-1.3.1-py2.6.egg/
>> django/db/models/sql/query.py", line 1069, in add_filter
>> negate=negate, process_extras=process_extras)
>>   File
"/usr/local/lib/python2.6/site-packages/Django-1.3.1-py2.6.egg/
>> django/db/models/sql/query.py", line 1260, in setup_joins
>> "Choices are: %s" % (name, ", ".join(names)))
>> FieldError: Cannot resolve keyword 'email_config_set' into field.
>> Choices are: id, name, site, type
>>
>> Any ideas/solutions/pointers/tips would be most welcome.
>
> --
> You received this message because you are subscribed to the
Google Groups
> "Django users" group.
> To post to this group, send email to
django-users@googlegroups.com .
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com
.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en

Re: FieldError on ManyToMany after upgrading to Django 1.3

2011-09-26 Thread Philip Mountifield
I also have a great deal of dynamically generated models. Interestingly 
in my case I find the issue when using the development server with DEBUG 
= TRUE, I've not yet tried it in deployment.


I'll take a look at your github, thanks for sharing the link.

Out of interest, with respect to David's comment about postgres 
versions, do you use version 8.1 or another?


Phil

On 26/09/2011 11:27, Matthias Kestenholz wrote:

Hi Philip

On Fri, Sep 23, 2011 at 3:40 PM, Philip  wrote:

FieldError: Cannot resolve keyword 'email_config_set' into field.
Choices are: id, name, site, type

Any ideas/solutions/pointers/tips would be most welcome.

Yes, I've seen similar problems in two sites I'm running. I suspect it
has to do with dynamically created models and startup timing effects
in our case. I'm not sure when it started and it's really hard to test
because it only happens in production (mod_wsgi / DEBUG=False) and I
don't have a consistent view of when the problem happens yet.

What we are doing in FeinCMS against it is trying to remove the caches
on Model._meta when new models are being created; this works for us,
but isn't all that nice. I'm running the following code in production
and will be waiting a few hours / days for the problem to manifest
itself again, hoping it wont:
https://github.com/matthiask/feincms/commit/f2de708a09f8b6cf4fdbca6b3583747b6ebbc2e2


Matthias




--

Philip Mountifield
Formac Electronics Ltd
tel  +44 (0) 1225 837333
fax  +44 (0) 1225 430995

pmountifi...@formac.net
www.formac.net
www.telgas.net

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



Re: FieldError on ManyToMany after upgrading to Django 1.3

2011-09-26 Thread David Markey
I actually haven't moved.. I'm still using django 1.2.x. :)

Although we plan to move to PG 9.1 and django 1.3 within the next few
weeks(we are already using both in testing)

I think i read something somewhere in the django 1.3 documentation that PG
8.1 was not supported any more(could have dreamt it though).





On 26 September 2011 11:30, Philip Mountifield wrote:

>  I am indeed using psycopyg2 and pg8.1, which version did you move to in
> order to solve the problem? I have just been using 8.1 since it was the
> default for CentOS 5, but I also see the 8.4 is available via yum.
>
> Philip
>
>
> On 26/09/2011 11:20, David Markey wrote:
>
> I had some problems with 1.3 and Postgres 8.1,
>
>  Are you using psycopg2 and pg 8.1?
>
> On 26 September 2011 11:16, Russell Keith-Magee 
> wrote:
>
>> Hi Philip,
>>
>> I can't say I've seen the error you report.
>>
>> My immediate question when I see reports like this is "what else are
>> you doing?". Django has an extensive test suite, and things like m2m
>> fields are tested very heavily. Outside of Django's test suite, there
>> are thousands of applications out there using Django, and many of them
>> are using Django 1.3, and this is the first time that this particular
>> problem has been reported. So, you are clearly doing *something* that
>> is unusual (whether you know it's unusual or not).
>>
>> What we need is a reproducible test case -- the smallest possible
>> sample of code that works under 1.2.7, but breaks under 1.3.1. That
>> will provide us the basis on which to debug the problem, and form the
>> core of a regression test to make sure the problem doesn't occur again
>> in the future.
>>
>> Yours,
>> Russ Magee %-)
>>
>> On Mon, Sep 26, 2011 at 4:27 PM, Philip Mountifield
>>  wrote:
>> > Has anyone else experienced this error? Any help would be appreciated.
>> >
>> > Thanks
>> >
>> > Philip
>> >
>> > On 23/09/2011 14:40, Philip wrote:
>> >>
>> >> Just been updating to Django 1.3.1 and come across an odd error. I'm
>> >> getting the following error from some code which works with version
>> >> 1.2.7.
>> >>
>> >> FieldError: Cannot resolve keyword 'email_config_set' into field.
>> >> Choices are: id, name, site, type
>> >>
>> >> The odd thing being email_config_set is a related name for a
>> >> ManyToMany field. I'm not sure why django is trying to resolve it into
>> >> a field.
>> >>
>> >> To make it even more odd, this error occurs when DEBUG = TRUE and not
>> >> when DEBUG = FALSE when testing with runserver.
>> >>
>> >> I've been trying to solve this for days now with much googling/pdb/
>> >> logging, but since the exception originates deep inside django I'm not
>> >> familiar enough to find what is going wrong:
>> >>
>> >> Traceback (most recent call last):
>> >>   File "./core/driver.py", line 268, in run
>> >> self.init_norm()
>> >>   File "./driver/emailevent/background.py", line 130, in init_norm
>> >> self.load_config()
>> >>   File "./driver/emailevent/background.py", line 71, in load_config
>> >> events = list(config.events.select_related())
>> >>   File "/usr/local/lib/python2.6/site-packages/Django-1.3.1-py2.6.egg/
>> >> django/db/models/manager.py", line 168, in select_related
>> >> return self.get_query_set().select_related(*args, **kwargs)
>> >>   File "/usr/local/lib/python2.6/site-packages/Django-1.3.1-py2.6.egg/
>> >> django/db/models/fields/related.py", line 497, in get_query_set
>> >> return
>> >>
>> >>
>> superclass.get_query_set(self).using(db)._next_is_sticky().filter(**(self.core_filters))
>> >>   File "/usr/local/lib/python2.6/site-packages/Django-1.3.1-py2.6.egg/
>> >> django/db/models/query.py", line 550, in filter
>> >> return self._filter_or_exclude(False, *args, **kwargs)
>> >>   File "/usr/local/lib/python2.6/site-packages/Django-1.3.1-py2.6.egg/
>> >> django/db/models/query.py", line 568, in _filter_or_exclude
>> >> clone.query.add_q(Q(*args, **kwargs))
>> >>   File "/usr/local/lib/python2.6/site-packages/Django-1.3.1-py2.6.egg/
>> >> django/db/models/sql/query.py", line 1194, in add_q
>> >> can_reuse=used_aliases, force_having=force_having)
>> >>   File "/usr/local/lib/python2.6/site-packages/Django-1.3.1-py2.6.egg/
>> >> django/db/models/sql/query.py", line 1069, in add_filter
>> >> negate=negate, process_extras=process_extras)
>> >>   File "/usr/local/lib/python2.6/site-packages/Django-1.3.1-py2.6.egg/
>> >> django/db/models/sql/query.py", line 1260, in setup_joins
>> >> "Choices are: %s" % (name, ", ".join(names)))
>> >> FieldError: Cannot resolve keyword 'email_config_set' into field.
>> >> Choices are: id, name, site, type
>> >>
>> >> Any ideas/solutions/pointers/tips would be most welcome.
>> >
>> > --
>> > You received this message because you are subscribed to the Google
>> Groups
>> > "Django users" group.
>> > To post to this group, send email to django-users@googlegroups.com.
>> > To unsubscribe from this group, send email to
>> > django-users+unsubscr...@googlegroups

Re: FieldError on ManyToMany after upgrading to Django 1.3

2011-09-26 Thread Matthias Kestenholz
On Mon, Sep 26, 2011 at 12:34 PM, Philip Mountifield
 wrote:
> I also have a great deal of dynamically generated models. Interestingly in
> my case I find the issue when using the development server with DEBUG =
> TRUE, I've not yet tried it in deployment.
>
> I'll take a look at your github, thanks for sharing the link.
>
> Out of interest, with respect to David's comment about postgres versions, do
> you use version 8.1 or another?
>

We don't (unfortunately, but that's a different topic) on the site in question.


Matthias

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



Re: FieldError on ManyToMany after upgrading to Django 1.3

2011-09-26 Thread Matthias Kestenholz
On Mon, Sep 26, 2011 at 12:36 PM, Matthias Kestenholz  wrote:
> On Mon, Sep 26, 2011 at 12:34 PM, Philip Mountifield
>  wrote:
>> I also have a great deal of dynamically generated models. Interestingly in
>> my case I find the issue when using the development server with DEBUG =
>> TRUE, I've not yet tried it in deployment.
>>
>> I'll take a look at your github, thanks for sharing the link.
>>
>> Out of interest, with respect to David's comment about postgres versions, do
>> you use version 8.1 or another?
>>

(Sorry for pressing send too early.)


We don't use postgresql at all (unfortunately, but that's a different
topic) on the site in question.


Matthias

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



Re: Platform system with Django?

2011-09-26 Thread kenneth gonsalves
On Sun, 2011-09-25 at 21:18 -0700, Ian wrote:
> Is it possible to do this?  I can imagine the structure and how to get
> the second part working (having users register on a particular
> subdomain site, post things, etc), but I'm having trouble figuring out
> where to get started with the first part (creating the subdomain
> site) 

you will have to do this in python - but then django is nothing but
python anyway.
-- 
regards
Kenneth Gonsalves

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



Reuse admin for views when some fields are from remote sources

2011-09-26 Thread cesar.ortiz
Hi,

We have some fields that will appear in the view that we won't to be
part of the model. They are from other system and we don't wish to
store them in order to avoid the problems that will arise with the
duplication of data.
We also would like to reuse the admin as much as possible in order to
avoid to create our own templates.

Those remote fields will be read/written to the remote system.
Which would be the best way to implement this behaviour in django?

Thanks,

-- César

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



Re: Reuse admin for views when some fields are from remote sources

2011-09-26 Thread Ilian Iliev
If these fields are not field in the model class you won't see them in the
add/edit of the admin.
If you want to show them in the view(list) section of the admin you can
define them as properties,
example:

class MyModel(models.Model):
# field here

@property
def remote_property(self):
return remote_property

class MyModelAdmin(admin.ModelAdmin)
list_display = ( 'remote_property', 'other_model_field')

-- 
eng. Ilian Iliev
Web Software Developer

Mobile: +359 88 66 08 400
Website: http://ilian.i-n-i.org


On Mon, Sep 26, 2011 at 2:11 PM, cesar.ortiz  wrote:

> Hi,
>
> We have some fields that will appear in the view that we won't to be
> part of the model. They are from other system and we don't wish to
> store them in order to avoid the problems that will arise with the
> duplication of data.
> We also would like to reuse the admin as much as possible in order to
> avoid to create our own templates.
>
> Those remote fields will be read/written to the remote system.
> Which would be the best way to implement this behaviour in django?
>
> Thanks,
>
> -- César
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+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-users@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: Platform system with Django?

2011-09-26 Thread jmontoya
You can use pinax is based in django and it has a lots of "website
templates", intranet, blog, social etc
You can easly customized it ...

http://pinaxproject.com/

Regards,

Julio


On Sep 26, 6:18 am, Ian  wrote:
> I'm new to django, and at this point all I've done is the tutorial.
>
> But my end goal is to create a website that serves as a platform
> system.
>
> I want users to go to my site, create an account, edit some settings/
> preferences, and a subdomain (can you do this with django?).
>
> Then within each subdomain, other people can register as users to this
> particular subdomain, post things, etc.
>
> Is it possible to do this?  I can imagine the structure and how to get
> the second part working (having users register on a particular
> subdomain site, post things, etc), but I'm having trouble figuring out
> where to get started with the first part (creating the subdomain site)
>
> Is there a tutorial or guide to get me started with this platform
> concept?  Thanks so much!

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



HY010 Function sequence error (mssql django-pyodbc)

2011-09-26 Thread PyMan
Hi guys, I'm experiencing a problem with ODBC driver. I'm quite sure
is not a django problem, but I'm posting here 'cause maybe someone can
help me.

I'm using Python 2.6, Django 1.2.0, pyodbc 2.1.7, django-pyodbc (not
the last version, but it's ok for this django version).

In the settings the DATABASES['default']['OPTIONS']['driver'] is
setted up to 'SQL Native Client' or 'SQL Server Native Client 10.0'
and the MARS_Connection is True.

I get the error "HY010 Function sequence error" when doing some query,
I don't get the error if using 'SQL Server' as driver (but it's slow
since it can't use MARS well, I mean chunked reads).

I experience the problem with mssql 2005 and 2008 too.

I could understand I get the problem when reading/writing "many"
records (not so many tough). For example I have a table with about
1700 records and the Mytable.objects.all().delete() works for the
first 100 records and then the above error is raised (note that django
has an internal setting CHUNK_SIZE setted up to 100!).

Another example is then Mytable is empty and I do this:
for item in Mytable2.objects.all():
Mytable.objects.create(...)

600 records are created and then the error is raised (Mytable2 has
about 1700 records...)

Upgrading to the last django-pyodbc version and to the pyodbc 2.1.11
can't solve things.

Thank you for your time!


...
...
...
File "C:\MyApp\Python26\lib\site-packages\django\db\models\query.py",
line 106, in _result_iter
self._fill_cache()

  File "C:\MyApp\Python26\lib\site-packages\django\db\models
\query.py", line 760, in _fill_cache
self._result_cache.append(self._iter.next())

  File "C:\MyApp\Python26\lib\site-packages\django\db\models
\query.py", line 269, in iterator
for row in compiler.results_iter():

  File "C:\MyApp\Python26\lib\site-packages\django\db\models\sql
\compiler.py", line 672, in results_iter
for rows in self.execute_sql(MULTI):

  File "C:\MyApp\Python26\lib\site-packages\django\db\models\sql
\compiler.py", line 745, in 
result = iter((lambda: cursor.fetchmany(GET_ITERATOR_CHUNK_SIZE)),

  File "C:\MyApp\Python26\lib\site-packages\sql_server\pyodbc
\base.py", line 358, in fetchmany
return [self.format_results(row) for row in
self.cursor.fetchmany(chunk)]

Error: ('HY010', '[HY010] [Microsoft][ODBC Driver Manager] Function
sequence error (0) (SQLFetch)')



note: GET_ITERATOR_CHUNK_SIZE for django is 100!

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



Multiple Image Field in a model

2011-09-26 Thread NavaTux
Hi all,

   I have a filed(ImageField) in my model.Also I want to have
multiple ImageFields.How to have more than one ImageFields only in
django model.Is there any need to derive that ImageField as a seperate
new model which holds as a foreign key of another one?

This is my model:

class Report(models.Model):
name = models.CharField(max_length=1024)
data = models.TextField()
image = models.ImageField(upload_to=settings.IMAGE_UPLOAD_PATH,
blank=True, null=True)

I need to display atleast 4 imagefields for this model object?

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



Re: Multiple Image Field in a model

2011-09-26 Thread Philip Mountifield
I would put the images in a seperate model such as "ReportImage" and 
make a foreign key to "Report", and finally I'd use the "inlines" admin 
feature for ReportImages to display them on the same page as the report.


Phil

On 26/09/2011 15:02, NavaTux wrote:

Hi all,

I have a filed(ImageField) in my model.Also I want to have
multiple ImageFields.How to have more than one ImageFields only in
django model.Is there any need to derive that ImageField as a seperate
new model which holds as a foreign key of another one?

This is my model:

class Report(models.Model):
 name = models.CharField(max_length=1024)
 data = models.TextField()
 image = models.ImageField(upload_to=settings.IMAGE_UPLOAD_PATH,
blank=True, null=True)

I need to display atleast 4 imagefields for this model object?




--

Philip Mountifield
Formac Electronics Ltd
tel  +44 (0) 1225 837333
fax  +44 (0) 1225 430995

pmountifi...@formac.net
www.formac.net
www.telgas.net

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



postgres- can nulls be first when sorting in asc order?

2011-09-26 Thread j_syk
Hello-
On Friday afternoon I migrated a project from sqlite to postgres.
Everything went smoothly and I was able to go home for the weekend and
be happy. Yay.
This morning I was informed that the sort order is different. I have a
DateField for a due date that is set as not required, however leaving
it blank treats it as ASAP. I'm assuming this is a result of the
different sort orders between sqlite and postgres. I got used to
sqlite sorting it like: "None, Oct, Dec, etc." but now I am getting
"Oct, Dec, etc., None".

Here are the options I'd rather not do:
-Go back to sqlite
-set the default as some date years ago and override the display value
in templates (I already use this method to make a None show as "ASAP")
i.e. {% if item.due_date == '1999-1-1' %}ASAP{% else %}
{{ item.due_date }}{% endif %}
-add another field to the model, a boolean field for  ASAP, set it to
true if the due date is blank and sort by that first (this may
actually be a decent option)

I'm hoping there is a setting in postgres that can be changed for the
sort priority of null.
Is this any easy way to solve this problem before I start reworking
all the code?

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



Re: postgres- can nulls be first when sorting in asc order?

2011-09-26 Thread j_syk
Found a similar post
http://groups.google.com/group/django-users/browse_thread/thread/4edf7a4a94c65c17/2dfbc193845d4383?lnk=gst&q=sort+null#2dfbc193845d4383

The main difference is that mine is a DateField. So I can't just make
it 0 instead of None.

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



Accessing sum in templates

2011-09-26 Thread David
Hello

In my view I have:

a = Person.objects.select_related().get(pk=pk)
b =
a.issue_set.filter(resolution_date__isnull=True).aggregate(Sum('type__severity'))
variables = RequestContext(request, {
'person': a,
'issue': b,
})
return render_to_response('contacts/view_person.html',
variables)

b produces the query:

SELECT SUM("issues_type"."severity") AS "type__severity__sum" FROM
"issues_issue" LEFT OUTER JOIN "issues_type" ON
("issues_issue"."type_id" = "issues_type"."id") WHERE
("issues_issue"."person_id" = 1 AND "issues_issue"."resolution_date"
IS NULL)

How can I access and use type__severity__sum in my template please ?
This is what I have tried:


{% for is in person.issue_set.all %}
Issues
{{ is.type__severity__sum }}
{% endfor %}


Thanks for any help

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

2011-09-26 Thread David
Sorted: {{ issue.type__severity__sum }}

doh :-/

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



Re: postgres- can nulls be first when sorting in asc order?

2011-09-26 Thread Tom Evans
On Mon, Sep 26, 2011 at 3:12 PM, j_syk  wrote:
> Hello-
> On Friday afternoon I migrated a project from sqlite to postgres.
> Everything went smoothly and I was able to go home for the weekend and
> be happy. Yay.
> This morning I was informed that the sort order is different. I have a
> DateField for a due date that is set as not required, however leaving
> it blank treats it as ASAP. I'm assuming this is a result of the
> different sort orders between sqlite and postgres. I got used to
> sqlite sorting it like: "None, Oct, Dec, etc." but now I am getting
> "Oct, Dec, etc., None".
>
> Here are the options I'd rather not do:
> -Go back to sqlite
> -set the default as some date years ago and override the display value
> in templates (I already use this method to make a None show as "ASAP")
> i.e. {% if item.due_date == '1999-1-1' %}ASAP{% else %}
> {{ item.due_date }}{% endif %}
> -add another field to the model, a boolean field for  ASAP, set it to
> true if the due date is blank and sort by that first (this may
> actually be a decent option)
>
> I'm hoping there is a setting in postgres that can be changed for the
> sort priority of null.
> Is this any easy way to solve this problem before I start reworking
> all the code?
>

You can control the order of how nulls sort with pgsql (at least, 8.3
and above) by appending 'NULLS FIRST' or 'NULLS LAST' to the 'ORDER
BY' clause of a select query. I'm not aware of a way to
administratively choose 'NULLS FIRST' for all queries, and you may
find it tricky getting 'ORDER BY ... NULLS FIRST' into a django
produced query.

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



Wrong view prefix on Django 1.3, mod_wsgi and mutliple URLconfs

2011-09-26 Thread lucamag
Hi all,
I'm using multiple URLconfs for my simple django application.
Everything works fine in development mode, but I'm getting a strange
error when moving to Apache 2 with mod_wsgi.

My main urls.py looks like:

---
from django.conf.urls.defaults import *
from django.conf import settings

# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns('',
# Include app URL structure
(r'^alerts/', include('mymodule.urls')),
# Uncomment the admin/doc line below to enable admin
documentation:
(r'^admin/doc/', include('django.contrib.admindocs.urls')),
# Uncomment the next line to enable the admin:
(r'^admin/', include(admin.site.urls)),
)
---

and the urls.py for my first module is below.
Please note I'm using a prefix view:

---
from django.conf.urls.defaults import *
urlpatterns = patterns('assistant.views',
# Example:
(r'^view/(?P\d+)/$', 'detail'),
(r'^$', 'index'),
)
---

How can it be that the once running in Apache my main application
works fine, but the admin page fails with a "TemplateSyntaxError"
because it tries to use a wrong view name,  It looks for
"assistant.views.django.view.generic.simple" rather then
"django.views.generic.simple"?

The problem disappear if merging everything in one urls.py file
without any view prefix.

Thanks in advance!
Luca

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



django foreign key admin interface and models structure

2011-09-26 Thread maxwell
(All code is some kind of pseudocode, just for better reading I have
an Invoice model:

 class Invoice(models.Model):
// many fields here
I need to attach some products (with price for unit, and quantity
fields) to this invoice, so I made additional table:

class InvoiceProduct(models.Model):
product = models.ForeignKey
quantity = models.IntegerField
unit_price = models.DecimalField
invoice = models.ForeignKey(Invoice)
So, this is almost first question — «Could it be done better way?»

My second problem is, that in django admin I have manage these models
by inlines: Screenshot But my customer wants otherwise. He wants one
button (Add product) then pop-up windows appears, with fields:
product, quantity, unit price. He fills them, press OK. Then pop-up
window closes and line with "product fields" appears in main form. I
suppose I need override admin form template? Or I need to write my own
widget or smth like that?

Sorry for my English.

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



Cloudfiles Storage Backend

2011-09-26 Thread Kurtis
Hey,

I really want to build a storage back-end for cloudfiles. The snag is
that cloudfiles containers do not allow for a hierarchical directory
structure. Everything must be in a "base directory".

Does anyone have any suggestions on methods for performing this
conversion of a hierarchical directory structure to a flat directory
structure?

Thanks!

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



Re: How to make a query form depend on a field?

2011-09-26 Thread David G. Pullman

On Sep 25, 2011, at 7:45 PM, Russell Keith-Magee wrote:

> On Sun, Sep 25, 2011 at 9:00 PM, David  wrote:
>> I'm new to Django, gone through the django book and some
>> documentation, but I can't find how to do this or if it's possible.
>> 
>> I have a model that lists documents with title and edition.  It also
>> has a foreign key to an organization table.
>> 
>> I'm trying to create a query form that first takes the name of the
>> organization in one field, and they lets the user search by document
>> title.  The idea is to only show results in the document search that
>> are from the organization.  I'm not sure if this is something for the
>> forms.py or if it's done in the view for the form.
> 
> It sounds like you're getting a little tangled over what processing
> should be handled where.
> 
> A form retrieves inputs from the user. A query retrieves data from the
> database. The view is a function that takes a request, from the user
> and turns it into a response that can be rendered back to the user.
> 
> So - for your purposes, you need a form to retrieve from the user the
> organization they want to search, and the title of the document to
> search for:
> 
> class SearchForm(forms.Form):
>organization = forms.ModelField(Organization)
>search_term = forms.CharField(max_length=100)
> 
> i.e., a form that lets you select an organization, and provide a block
> of text for searching.
> 
> Then, in your view, use the data from that form to issue a query:
> 
> def my_view(request):
>...
>form = SearchForm(data=request.GET)
>if form.is_valid():
>organzation = form.cleaned_data['organization']
>search_term = form.cleaned_data]['search_term']
>results = Document.objects.filter(organization=organization,
> title__icontains=search_term)
>
> 
> At this point, results will contain the list of documents that are
> from the selected organization, and has a title that is a
> case-insensitive partial match for the search term. If you want
> different matching criteria, alter the __icontains query term.
> 
> The view requires a little more fleshing out, tool. Obviously, you'll
> need to render `results` into a HTTPResponse. I've also assumed that
> the query is being issued as a GET query -- which is possible, because
> a search should be idempotent, but you *could* issue the search as a
> POST, in which case the view handling will be slightly different. If
> you're using the same view to present the original form *and* present
> the results, you'll need to handle that case; you'll also need to
> handle the case where the user doesn't provide a search term.
> 
> Filling in these extra bits is left as an exercise for the reader :-)
> Hopefully with the form/query/view thing clarified, the rest will fall
> into place. If it doesn't, feel free to ask.
> 
> Yours,
> Russ Magee %-)
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
> 


Russ,

Thanks very much for helping to separate the processing.  I'm trying to 
implement a setup using your suggestions.  I've hit a snag on a detail:

> class SearchForm(forms.Form):
>organization = forms.ModelField(Organization)
>search_term = forms.CharField(max_length=100)

What's a ModelField?  I was unable to find it in a search on 
docs.djangoproject.com.  I found it referred to in an abstract way on a google 
search, but not as an actual attribute name.

Thanks!

David

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



Multiple forms with same name.

2011-09-26 Thread sakthi
In a page i made multiple text forms with the same name. i cannot get
the values of all the forms. only the last form's value is available.

my html looks like this







how can i get the values of all the forms having the same name.

Thank you.

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



Re: Multiple forms with same name.

2011-09-26 Thread Shawn Milochik
Use the 'prefix' kwarg that comes with Django forms.

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



Re: postgres- can nulls be first when sorting in asc order?

2011-09-26 Thread j_syk
> You can control the order of how nulls sort with pgsql (at least, 8.3
> and above) by appending 'NULLS FIRST' or 'NULLS LAST' to the 'ORDER
> BY' clause of a select query.

Good to know. I am using 8.4, I may look into adding the order by into
a .extra() call.
Thanks

Due to the urgency, I went with option 3 on my list (adding an ASAP
field to the model), It just frustrates me that I now have a column
that is false except when the due_date column is null. Just seems like
such a waste, I wish I could have hooked into the due_date. Good news
is that this guarantees the right sort for any db, should I ever need
to switch it.

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



FileField parser populating other fields

2011-09-26 Thread Paulo VJ
Hello Everyone,

I'm looking to building an Model where it's fields are populated by the 
contents of a PDF file.
I've come to this solution, one I didn't like:

class ContaPdf(models.Model):
  conta_pdf = models.FileField(upload_to='conta_pdf')
  
class Conta(models.Model)
  data_inicio = models.DateField()
  data_fim = models.DateField()
  data_vencimento = models.DateField()
  telefone = models.ForeignKey(Telefone)

@receiver(pos_save, sender=ContaPdf)
def pdf_parser(sender, **kwards):
  # Parses data from PDF file and create/save Conta object.

Is there any easier way to do this, considering I'll be using mostly 
django.admin as interface?
I can't quite see the alternatives.

Thanks a lot,
Paulo

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/X2j39tDniDgJ.
To post to this group, send email to django-users@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 make a query form depend on a field?

2011-09-26 Thread Tom Evans
On Mon, Sep 26, 2011 at 4:26 PM, David G. Pullman
 wrote:
> Thanks very much for helping to separate the processing.  I'm trying to 
> implement a setup using your suggestions.  I've hit a snag on a detail:
>
>> class SearchForm(forms.Form):
>>    organization = forms.ModelField(Organization)
>>    search_term = forms.CharField(max_length=100)
>
> What's a ModelField?  I was unable to find it in a search on 
> docs.djangoproject.com.  I found it referred to in an abstract way on a 
> google search, but not as an actual attribute name.
>

100% certain that was just a brain fade on Russell's part, it should
be forms.ModelChoiceField

https://docs.djangoproject.com/en/1.3/ref/forms/fields/#modelchoicefield

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-users@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: Multiple forms with same name.

2011-09-26 Thread sakthi
Thank you.
But how to use that. can you please briefly demonstrate in my code
that how could i use it in views.py to populate the values.


On Sep 26, 11:36 am, Shawn Milochik  wrote:
> Use the 'prefix' kwarg that comes with Django forms.

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



Re: Web Designer

2011-09-26 Thread Sushirod
For Mac I use coda and for Windows I realy like Notepad++.

As far as WYSIWYG editors go I`ve never seen one that`s better than
Dreamweaver, wich I`d say it`s not that wysiwyg at all. To be honest
there's no such thing as a WYSIWYG, I think its just a marketing term
that propose a software with a very junky visualization of what your
are doing.

The real deal it's to experience the code rendered in browser (try to
use all of then for production purpose). That`s how your user will
experience it.

I`d also say that vi (or vim) are realy good to work "in server" via
the SSH, I use it sometimes before going to production.

Make good use of plugins such as firebug (firefox) and the google
chrome code inspector.

On 25 set, 21:05, "christian.posta"  wrote:
> I do most of the html code for my django templates in PyCharm and just
> write the code by hand. I've been evaluating WYSIWYG html/web
> designers recently (Dreamweaver). But, I find myself using the 'split'
> mode of Dreamweaver where I write the code and watch the auto-updating
> visual editor. But i don't want to switch to a different code editor
> since i'm very comfortable with the keyboard shortcuts and
> autocompletion I get in PyCharm.
>
> Do most people who write the templates/html code for django apps
> primarily write some code, jump to a browser and refresh? Or write the
> static content using a full-blown designer and then break it up into
> django templates? I would be grateful for any ideas
> Thanks!

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



Re: Web Designer

2011-09-26 Thread Sushirod

Good sugestions, I`ll take a look at this!

On 26 set, 04:32, Markus Gattol  wrote:
> I'd say most people us a simple text editor such as Vim, Emacs... If you use
> runserver and and your browsers auto-reload for that tab then that's all you
> need. If you want to be a bit speedier then you can use things like
> Sass/Compass for your CSS and maybe HamlPy for your HTML. Both have "watch"
> commands that watch your .sass/.haml files and automatically create the
> .css/.html which would then be picked up be runserver which in turn gets
> reloaded by your browser's tab for which you set the autoload toggle.
>
> for HTML
>  -https://github.com/jessemiller/HamlPy
>
> for CSS
>  -https://github.com/chriseppstein/compass(is written in Sass)
>  -https://github.com/nex3/sass

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



Re: Reuse admin for views when some fields are from remote sources

2011-09-26 Thread cesar.ortiz
It works for the List View, but it doesn't work for the Edit View

On 26 sep, 13:40, Ilian Iliev  wrote:
> If these fields are not field in the model class you won't see them in the
> add/edit of the admin.
> If you want to show them in the view(list) section of the admin you can
> define them as properties,
> example:
>
> class MyModel(models.Model):
>     # field here
>
>     @property
>     def remote_property(self):
>         return remote_property
>
> class MyModelAdmin(admin.ModelAdmin)
>     list_display = ( 'remote_property', 'other_model_field')
>
> --
> eng. Ilian Iliev
> Web Software Developer
>
> Mobile: +359 88 66 08 400
> Website:http://ilian.i-n-i.org
>
>
>
>
>
>
>
> On Mon, Sep 26, 2011 at 2:11 PM, cesar.ortiz  wrote:
> > Hi,
>
> > We have some fields that will appear in the view that we won't to be
> > part of the model. They are from other system and we don't wish to
> > store them in order to avoid the problems that will arise with the
> > duplication of data.
> > We also would like to reuse the admin as much as possible in order to
> > avoid to create our own templates.
>
> > Those remote fields will be read/written to the remote system.
> > Which would be the best way to implement this behaviour in django?
>
> > Thanks,
>
> > -- César
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Django users" group.
> > To post to this group, send email to django-users@googlegroups.com.
> > To unsubscribe from this group, send email to
> > django-users+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-users@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.



good django twitter login tutorial

2011-09-26 Thread Guido
Hey all,

I want to build a website where users log in with their twitter
account like you see a lot on the internet.

I read some things about OAuth 2.0 etc. but don't understand any of
those docs.

I am a total beginner (I just got the poll application to work) and
have never build a site with users/logins.

Do you guys know a tutorial that explains all the basics (possibly
explains what tables are made etc and why) for django and twitter
login?

Thanks!

p.s. of course I have googled, however I can't find any good stuff.
More general good django tut sites would be welcome too!

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



Re: Cloudfiles Storage Backend

2011-09-26 Thread Alex Chan
Hi,

Have you already checked out this project?
http://code.welldev.org/django-storages/

I'm currently using this and it works great with Mongo's GridFS and S3.

--
Alex

On Mon, Sep 26, 2011 at 8:33 AM, Kurtis  wrote:

> Hey,
>
> I really want to build a storage back-end for cloudfiles. The snag is
> that cloudfiles containers do not allow for a hierarchical directory
> structure. Everything must be in a "base directory".
>
> Does anyone have any suggestions on methods for performing this
> conversion of a hierarchical directory structure to a flat directory
> structure?
>
> Thanks!
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+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-users@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 make a query form depend on a field?

2011-09-26 Thread David G. Pullman

On Sep 26, 2011, at 11:59 AM, Tom Evans wrote:

> 100% certain that was just a brain fade on Russell's part, it should
> be forms.ModelChoiceField
> 
> https://docs.djangoproject.com/en/1.3/ref/forms/fields/#modelchoicefield
> 
> 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-users@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.
> 

Russ and Tom,

Thanks to both of you.  It's  working.  Here's what I did (Sdo is the 
Organization):

# snip of models.py
class Sdo(models.Model):
name = models.CharField(max_length=255, unique=True)
background = models.TextField(blank=True, null=True)
address = models.CharField(max_length=255, blank=True, null=True)
phone = models.CharField(max_length=255, blank=True, null=True)
url = models.CharField(max_length=255, blank=True, null=True)

def __unicode__(self):
return self.name

class Document(models.Model):
number = models.CharField(max_length=255)
title = models.CharField(max_length=255)
edition = models.CharField(max_length=255)
scope = models.CharField(max_length=255, blank=True, null=True)
sdo = models.ForeignKey(Sdo)

class Meta:
unique_together = (('number', 'title', 'edition'),)

def __unicode__(self):
return u'%s %s %s' % (self.number, self.title, self.edition)

# snip from forms.py
class SearchForm(forms.Form):
sdo = forms.ModelChoiceField(queryset=Sdo.objects.all())
document_search_term = forms.CharField(max_length=100)

# snip from views.py
def search_form(request):
form = SearchForm(data=request.GET)
if form.is_valid():
sdo = form.cleaned_data['sdo']
document_search_term = form.cleaned_data['document_search_term']
documents = Document.objects.filter(sdo=sdo, 
number__icontains=document_search_term)
results = RequestContext(request, {
'form': form,
'documents': documents,
'show_results': True
})
return render_to_response('search_form.html', results)
else:
return render_to_response('search_form.html', locals())

# contents of search_form.html
{% extends "base.html" %}
{% block external %}
{% endblock %}
{% block title %}SDO Search{% endblock %}
{% block head %}SDO Search{% endblock %}
{% block content %}

  

  
SDO
{{ form.sdo }}
Document Number
{{ form.document_search_term }}
  


  
  
{% if show_results %}
{% include "document_list.html" %}
{% endif %}
  
  {% endblock %}


#contents of document_list.html
{% if documents %}


  {% for document in documents %}
  
{{ document.number }}{{ document.title }}{{ 
document.edition }}
  
  {% endfor %}


{% endif %}

There is a simple url.py entry for /search_form/.  It provides a list of the 
documents that have the sdo_id that matches the id field in Sdo for the 
selected value of the Sdo name in the sdo field of the request.

I know some of this is goofy as I'm working from tuts and the examples in the 
docs and such, but I would like to say that I'm impressed how relatively easy 
it is to get something working in Django.  Especially with such a helpful users 
mailing list!

--David

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



Python Weekly

2011-09-26 Thread Rahul
Hi Everyone,

I have started a free weekly newsletter called Python Weekly which
includes curated news, articles, new releases, software & tools,
events, jobs etc about Python and related technologies. It's a great
way to keep abreast of what's happening in Python land. You can
subscribe to it here, http://www.pythonweekly.com/

Regards
Rahul Chaudhary

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



Re: Python Weekly

2011-09-26 Thread Cal Leeming [Simplicity Media Ltd]
Sample looks quite interesting - subscribed.

On Mon, Sep 26, 2011 at 6:43 PM, Rahul  wrote:

> Hi Everyone,
>
> I have started a free weekly newsletter called Python Weekly which
> includes curated news, articles, new releases, software & tools,
> events, jobs etc about Python and related technologies. It's a great
> way to keep abreast of what's happening in Python land. You can
> subscribe to it here, http://www.pythonweekly.com/
>
> Regards
> Rahul Chaudhary
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+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-users@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: good django twitter login tutorial

2011-09-26 Thread Cal Leeming [Simplicity Media Ltd]
You are kidding, right?

https://bitbucket.org/david/django-oauth-plus/wiki/Home

I appreciate you are a total beginner, but come on, get your hands dirty! :)

Cal


On Mon, Sep 26, 2011 at 6:13 PM, Guido  wrote:

> Hey all,
>
> I want to build a website where users log in with their twitter
> account like you see a lot on the internet.
>
> I read some things about OAuth 2.0 etc. but don't understand any of
> those docs.
>
> I am a total beginner (I just got the poll application to work) and
> have never build a site with users/logins.
>
> Do you guys know a tutorial that explains all the basics (possibly
> explains what tables are made etc and why) for django and twitter
> login?
>
> Thanks!
>
> p.s. of course I have googled, however I can't find any good stuff.
> More general good django tut sites would be welcome too!
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> 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-users@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: Reuse admin for views when some fields are from remote sources

2011-09-26 Thread Ilian Iliev
If you want to make these editable you should declare your own form
for the admin and overwrite the save method.

-- 
eng. Ilian Iliev
Web Software Developer

Mobile: +359 88 66 08 400
Website: http://ilian.i-n-i.org



On Mon, Sep 26, 2011 at 7:37 PM, cesar.ortiz  wrote:

> It works for the List View, but it doesn't work for the Edit View
>
> On 26 sep, 13:40, Ilian Iliev  wrote:
> > If these fields are not field in the model class you won't see them in
> the
> > add/edit of the admin.
> > If you want to show them in the view(list) section of the admin you can
> > define them as properties,
> > example:
> >
> > class MyModel(models.Model):
> > # field here
> >
> > @property
> > def remote_property(self):
> > return remote_property
> >
> > class MyModelAdmin(admin.ModelAdmin)
> > list_display = ( 'remote_property', 'other_model_field')
> >
> > --
> > eng. Ilian Iliev
> > Web Software Developer
> >
> > Mobile: +359 88 66 08 400
> > Website:http://ilian.i-n-i.org
> >
> >
> >
> >
> >
> >
> >
> > On Mon, Sep 26, 2011 at 2:11 PM, cesar.ortiz 
> wrote:
> > > Hi,
> >
> > > We have some fields that will appear in the view that we won't to be
> > > part of the model. They are from other system and we don't wish to
> > > store them in order to avoid the problems that will arise with the
> > > duplication of data.
> > > We also would like to reuse the admin as much as possible in order to
> > > avoid to create our own templates.
> >
> > > Those remote fields will be read/written to the remote system.
> > > Which would be the best way to implement this behaviour in django?
> >
> > > Thanks,
> >
> > > -- César
> >
> > > --
> > > You received this message because you are subscribed to the Google
> Groups
> > > "Django users" group.
> > > To post to this group, send email to django-users@googlegroups.com.
> > > To unsubscribe from this group, send email to
> > > django-users+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-users@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-users@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: Python Weekly

2011-09-26 Thread Arthur Gouveia
Nice one. I'm in.

--
Arthur Gouveia
Web Developer

http://arthurgouveia.com



On Mon, Sep 26, 2011 at 1:46 PM, Cal Leeming [Simplicity Media Ltd] <
cal.leem...@simplicitymedialtd.co.uk> wrote:

> Sample looks quite interesting - subscribed.
>
>
> On Mon, Sep 26, 2011 at 6:43 PM, Rahul wrote:
>
>> Hi Everyone,
>>
>> I have started a free weekly newsletter called Python Weekly which
>> includes curated news, articles, new releases, software & tools,
>> events, jobs etc about Python and related technologies. It's a great
>> way to keep abreast of what's happening in Python land. You can
>> subscribe to it here, http://www.pythonweekly.com/
>>
>> Regards
>> Rahul Chaudhary
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+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-users@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-users@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.



circular dependency in models.py

2011-09-26 Thread Amit Sethi
I think the solution to this might actually be very simple . I have an
app stories that looks something like this at the moment . It is in
the same file ideally i would like if both of them were related by
foreignkey but that is not possible because they are in same file and
there are declaration issues(NameError).

class Story(models.Model):
"""Story model."""

author = models.ForeignKey(User, blank=True, null=True)
title = models.TextField(_('title'), )


class Vote(models.Model):
"""
A vote on an story by a User.
"""
user = models.ForeignKey(User)
story = models.ForeignKey(Story)
votes = models.SmallIntegerField(default=0)

if i make a foreignkey in story , I have to write a very complicated
query to ensure no user can vote twice.  In case I keep it in vote its
incredibly complicated to write a query to get the score for a story
and order stories by vote what should i do .


Thanks
Amit

-- 
A-M-I-T S|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-users@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: Cloudfiles Storage Backend

2011-09-26 Thread Kurtis Mullins
Thanks Alex.

Yeah, I actually did try to use that. Currently I'm using it for SFTP (and
having some issues with the URLs provided by the SFTP plugin). The problem
with the Cloudfiles implementation is that, according to what I've read and
tried, the API it used is outdated. Rackspace has changed quite a bit since
it was built. So for now, it's not a readily available resource for
Rackspace Cloudfiles. If anyone can prove me wrong, I'd be very happy :)

On Mon, Sep 26, 2011 at 12:59 PM, Alex Chan  wrote:

> Hi,
>
> Have you already checked out this project?
> http://code.welldev.org/django-storages/
>
> I'm currently using this and it works great with Mongo's GridFS and S3.
>
> --
> Alex
>
>
> On Mon, Sep 26, 2011 at 8:33 AM, Kurtis  wrote:
>
>> Hey,
>>
>> I really want to build a storage back-end for cloudfiles. The snag is
>> that cloudfiles containers do not allow for a hierarchical directory
>> structure. Everything must be in a "base directory".
>>
>> Does anyone have any suggestions on methods for performing this
>> conversion of a hierarchical directory structure to a flat directory
>> structure?
>>
>> Thanks!
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+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-users@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-users@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: circular dependency in models.py

2011-09-26 Thread Shawn Milochik
If I'm understanding your question properly, you can use the
unique_together option.

https://docs.djangoproject.com/en/1.3/ref/models/options/#unique-together

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



Re: Python Weekly

2011-09-26 Thread Kurtis Mullins
Thanks! I'm joining as well.

On Mon, Sep 26, 2011 at 1:52 PM, Arthur Gouveia wrote:

> Nice one. I'm in.
>
> --
> Arthur Gouveia
> Web Developer
>
> http://arthurgouveia.com
>
>
>
> On Mon, Sep 26, 2011 at 1:46 PM, Cal Leeming [Simplicity Media Ltd] <
> cal.leem...@simplicitymedialtd.co.uk> wrote:
>
>> Sample looks quite interesting - subscribed.
>>
>>
>> On Mon, Sep 26, 2011 at 6:43 PM, Rahul wrote:
>>
>>> Hi Everyone,
>>>
>>> I have started a free weekly newsletter called Python Weekly which
>>> includes curated news, articles, new releases, software & tools,
>>> events, jobs etc about Python and related technologies. It's a great
>>> way to keep abreast of what's happening in Python land. You can
>>> subscribe to it here, http://www.pythonweekly.com/
>>>
>>> Regards
>>> Rahul Chaudhary
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Django users" group.
>>> To post to this group, send email to django-users@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> django-users+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-users@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-users@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-users@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: Python Weekly

2011-09-26 Thread ANKUR AGGARWAL
Nice :) Subscribed :D

On Mon, Sep 26, 2011 at 11:49 PM, Kurtis Mullins
wrote:

> Thanks! I'm joining as well.
>
>
> On Mon, Sep 26, 2011 at 1:52 PM, Arthur Gouveia 
> wrote:
>
>> Nice one. I'm in.
>>
>> --
>> Arthur Gouveia
>> Web Developer
>>
>> http://arthurgouveia.com
>>
>>
>>
>> On Mon, Sep 26, 2011 at 1:46 PM, Cal Leeming [Simplicity Media Ltd] <
>> cal.leem...@simplicitymedialtd.co.uk> wrote:
>>
>>> Sample looks quite interesting - subscribed.
>>>
>>>
>>> On Mon, Sep 26, 2011 at 6:43 PM, Rahul wrote:
>>>
 Hi Everyone,

 I have started a free weekly newsletter called Python Weekly which
 includes curated news, articles, new releases, software & tools,
 events, jobs etc about Python and related technologies. It's a great
 way to keep abreast of what's happening in Python land. You can
 subscribe to it here, http://www.pythonweekly.com/

 Regards
 Rahul Chaudhary

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



Question about losing port number.

2011-09-26 Thread Chen Xu
I have a general question about  PHP:
So basically I have a link, and I want the href to be absolute., so I
do 'https://' . $_SERVER['HTTP_HOST'] . '/login' ; this gives me
https://127.0.0.1/login on my local; however, what i really want is
https://127.0.0.1:9090/login, it is missing ":9090".

Could anyone please help?

-- 
⚡ Chen Xu ⚡

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



Re: Question about losing port number.

2011-09-26 Thread Donald Stufft
 I think you might be on the wrong mailing list… There's no PHP around these 
parts ;)  


On Monday, September 26, 2011 at 3:30 PM, Chen Xu wrote:

> I have a general question about PHP:
> So basically I have a link, and I want the href to be absolute., so I do 
> 'https://' . $_SERVER['HTTP_HOST'] . '/login' ; this gives me 
> https://127.0.0.1/login on my local; however, what i really want is 
> https://127.0.0.1:9090/login, it is missing ":9090".
>  
> Could anyone please help?
>  
> --  
> ⚡ Chen Xu ⚡
>  --  
>  You received this message because you are subscribed to the Google Groups 
> "Django users" group.
>  To post to this group, send email to django-users@googlegroups.com 
> (mailto:django-users@googlegroups.com).
>  To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com 
> (mailto: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-users@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: Question about losing port number.

2011-09-26 Thread Kurtis Mullins
Umm, I'm kinda new here so I'm not sure if this is the right place for that
kind of a question. But, you could easily include $_SERVER['SERVER_PORT'] in
there
Source: http://php.net/manual/en/reserved.variables.server.php


On Mon, Sep 26, 2011 at 3:30 PM, Chen Xu  wrote:

> I have a general question about  PHP:
> So basically I have a link, and I want the href to be absolute., so I
> do 'https://' . $_SERVER['HTTP_HOST'] . '/login' ; this gives me
> https://127.0.0.1/login on my local; however, what i really want is
> https://127.0.0.1:9090/login, it is missing ":9090".
>
> Could anyone please help?
>
> --
> ⚡ Chen Xu ⚡
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+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-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Admin WCAG Conformance

2011-09-26 Thread Lee
The only reference I see to WCAG in this forum is from 2007. What is
the current level of conformance to WCAG for the Admin interface?

Thanks-

Lee

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



Re: Python Weekly

2011-09-26 Thread Sonny
Would be nice if you include a privacy policy clause on your site, but
good idea overall.

On Sep 26, 1:43 pm, Rahul  wrote:
> Hi Everyone,
>
> I have started a free weekly newsletter called Python Weekly which
> includes curated news, articles, new releases, software & tools,
> events, jobs etc about Python and related technologies. It's a great
> way to keep abreast of what's happening in Python land. You can
> subscribe to it here,http://www.pythonweekly.com/
>
> Regards
> Rahul Chaudhary

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



Re: Question about losing port number.

2011-09-26 Thread Chen Xu
Thx, but $_SERVER['SERVER_PORT'] doesn't give me 9090, it gives me 80.

On Mon, Sep 26, 2011 at 12:33 PM, Kurtis Mullins
wrote:

> Umm, I'm kinda new here so I'm not sure if this is the right place for that
> kind of a question. But, you could easily include $_SERVER['SERVER_PORT'] in
> there
> Source: http://php.net/manual/en/reserved.variables.server.php
>
>
> On Mon, Sep 26, 2011 at 3:30 PM, Chen Xu  wrote:
>
>> I have a general question about  PHP:
>> So basically I have a link, and I want the href to be absolute., so I
>> do 'https://' . $_SERVER['HTTP_HOST'] . '/login' ; this gives me
>> https://127.0.0.1/login on my local; however, what i really want is
>> https://127.0.0.1:9090/login, it is missing ":9090".
>>
>> Could anyone please help?
>>
>> --
>> ⚡ Chen Xu ⚡
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+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-users@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.
>



-- 
⚡ Chen Xu ⚡

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



Re: Question about losing port number.

2011-09-26 Thread Felipe Prenholato
People, this is DJANGO user list, not PHP user list...

Go to the right place (and you will get more help).

Felipe 'chronos' Prenholato.
Linux User nº 405489
Home page: http://chronosbox.org/blog
Twitter: http://twitter.com/chronossc



2011/9/26 Chen Xu 

> Thx, but $_SERVER['SERVER_PORT'] doesn't give me 9090, it gives me 80.
>
>
> On Mon, Sep 26, 2011 at 12:33 PM, Kurtis Mullins  > wrote:
>
>> Umm, I'm kinda new here so I'm not sure if this is the right place for
>> that kind of a question. But, you could easily include
>> $_SERVER['SERVER_PORT'] in there
>> Source: http://php.net/manual/en/reserved.variables.server.php
>>
>>
>> On Mon, Sep 26, 2011 at 3:30 PM, Chen Xu  wrote:
>>
>>> I have a general question about  PHP:
>>> So basically I have a link, and I want the href to be absolute., so I
>>> do 'https://' . $_SERVER['HTTP_HOST'] . '/login' ; this gives me
>>> https://127.0.0.1/login on my local; however, what i really want is
>>> https://127.0.0.1:9090/login, it is missing ":9090".
>>>
>>> Could anyone please help?
>>>
>>> --
>>> ⚡ Chen Xu ⚡
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Django users" group.
>>> To post to this group, send email to django-users@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> django-users+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-users@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.
>>
>
>
>
> --
> ⚡ Chen Xu ⚡
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+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-users@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: Python Weekly

2011-09-26 Thread Kurtis Mullins
There is a privacy policy right on the page where you subscribe.

We respect your privacy, and we take it very seriously. We won't share your
> email address with anyone, and you'll only receive Python Weekly newsletter
> as scheduled.
>
> On Mon, Sep 26, 2011 at 3:42 PM, Sonny  wrote:

> Would be nice if you include a privacy policy clause on your site, but
> good idea overall.
>
> On Sep 26, 1:43 pm, Rahul  wrote:
> > Hi Everyone,
> >
> > I have started a free weekly newsletter called Python Weekly which
> > includes curated news, articles, new releases, software & tools,
> > events, jobs etc about Python and related technologies. It's a great
> > way to keep abreast of what's happening in Python land. You can
> > subscribe to it here,http://www.pythonweekly.com/
> >
> > Regards
> > Rahul Chaudhary
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+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-users@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.



Using exists() on queryset for a User

2011-09-26 Thread Kurtis
I'm trying to check if a user with a specified email already exists.
According to the docs, it's better to use the .exists() method.

I tried this:

if User.objects.exists(email = data['email']):
raise forms.ValidationError(u'Email Already Exists')

However, I get this error:

exists() got an unexpected keyword argument 'email'

I'm just going to assume I went about this the wrong way. Any
suggestions on how to do it the right way?

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



Re: Using exists() on queryset for a User

2011-09-26 Thread Shawn Milochik
if User.objects.filter(email = data['email']).exists()

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



looking for an event planning app

2011-09-26 Thread j_syk
I'm looking to build a site to plan events for a small convention.
I've been looking around for an
Here's what I'm looking for:

-Users can sign up to host an event at a given location
-User can pick event length in hour or 30min increments
-There can't be more than one event at the same location and time
-Chart/spreadsheet view of the whole event, or a specific location

It would be like a meeting space planning application. I'm kinda on a
time crunch so finding an existing app would be nice, if not, this
won't be too hard to implement myself (and may have to post a repo if
it's any good).

Anyone know of any suitable apps to check out? Thanks

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



can't get STATICFILES to work (Django dev version)

2011-09-26 Thread nara
I am having trouble getting STATICFILES to work. I have read the docs,
and followed the instructions, but I never get my css files to load.
My current workaround is to put all the css inline in my template
file, but that should not be a permanent solution.

I am running the django dev version, and I am using the built-in
server. Here are my changes:

1. I placed my media (css) files under /home/nara/media
2. I added '/home/nara/media' under STATICFILES_DIRS
(django.contrib.staticfiles is already in INSTALLED_APPS)
3. I added {{STATIC_URL}} (no spaces) in front of the reference to
static files in my template file.
4. I restarted the server.

No further changes. I don't have additional copies of the static files
anywhere else, such
us under my project, or app.

Looking at the result in firebug within firefox, I get an HTTP
response of 200 on my css files
(happen to be css/blueprint/screen.css and print.css), but the files
are null. Clearing
the cache, restarting Firefox etc. do not help.

I have been fighting this issue for several days now, and have tried
many things,
but the above description is for my current state.

Thanks
Nara


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



Re: Using exists() on queryset for a User

2011-09-26 Thread Kurtis Mullins
That worked perfectly and makes a lot more sense. Thanks!

On Mon, Sep 26, 2011 at 4:05 PM, Shawn Milochik  wrote:

> if User.objects.filter(email = data['email']).exists()
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+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-users@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.



MYSQL Installation error

2011-09-26 Thread PremAnand Lakshmanan
Im trying to install mysql and get the following error,

Any idea on this error?

>>> import pymysql
>>> conn = pymysql.connect(host='localhost', port=3306, user='root',
passwd=None
, db='mysql')
Traceback (most recent call last):
  File "", line 1, in 
  File "build\bdist.win32\egg\pymysql\__init__.py", line 72, in Connect
  File "build\bdist.win32\egg\pymysql\connections.py", line 465, in __init__
  File "build\bdist.win32\egg\pymysql\connections.py", line 607, in _connect
  File "C:\Python27\lib\socket.py", line 224, in meth
return getattr(self._sock,name)(*args)
socket.error: [Errno 10061] No connection could be made because the target
machi
ne actively refused it

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



Re: MYSQL Installation error

2011-09-26 Thread Ilian Iliev
Probably your MtSQL is not working, Try to telnet to this port to check
is it open and is something listening on it.

-- 
eng. Ilian Iliev
Web Software Developer

Mobile: +359 88 66 08 400
Website: http://ilian.i-n-i.org

On Mon, Sep 26, 2011 at 11:32 PM, PremAnand Lakshmanan
wrote:

> Im trying to install mysql and get the following error,
>
> Any idea on this error?
>
> >>> import pymysql
> >>> conn = pymysql.connect(host='localhost', port=3306, user='root',
> passwd=None
> , db='mysql')
> Traceback (most recent call last):
>   File "", line 1, in 
>   File "build\bdist.win32\egg\pymysql\__init__.py", line 72, in Connect
>   File "build\bdist.win32\egg\pymysql\connections.py", line 465, in
> __init__
>   File "build\bdist.win32\egg\pymysql\connections.py", line 607, in
> _connect
>   File "C:\Python27\lib\socket.py", line 224, in meth
> return getattr(self._sock,name)(*args)
> socket.error: [Errno 10061] No connection could be made because the target
> machi
> ne actively refused it
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> 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-users@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.middleware.gzip vs mod_deflate (Apache)

2011-09-26 Thread CC4t
What is the best choise? django.middleware.gzip or mod_deflate
(Apache)?

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



daemon mod_wsgi or embedded mod_wsgi + apache-mpm + suexec

2011-09-26 Thread CC4t
What do you use in your high loaded project?
mod_wsgi with "WSGIDaemonProcess testapp.test user=testapp
group=testapp processes=N threads=M" in your VirtualHost
or
embedded mod_wsgi + apache-mpm + suexec

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



Re: Web Designer

2011-09-26 Thread Andre Terra
Please refer to our recent thread with suggestions for development
environments. There's enough there already to get anyone started.

On the web:
https://groups.google.com/forum/#!msg/django-users/ZwVHa0jBRrY/Fq-jCVxrK7AJ


Cheers,
AT



On Mon, Sep 26, 2011 at 1:25 PM, Sushirod  wrote:

>
> Good sugestions, I`ll take a look at this!
>
> On 26 set, 04:32, Markus Gattol  wrote:
> > I'd say most people us a simple text editor such as Vim, Emacs... If you
> use
> > runserver and and your browsers auto-reload for that tab then that's all
> you
> > need. If you want to be a bit speedier then you can use things like
> > Sass/Compass for your CSS and maybe HamlPy for your HTML. Both have
> "watch"
> > commands that watch your .sass/.haml files and automatically create the
> > .css/.html which would then be picked up be runserver which in turn gets
> > reloaded by your browser's tab for which you set the autoload toggle.
> >
> > for HTML
> >  -https://github.com/jessemiller/HamlPy
> >
> > for CSS
> >  -https://github.com/chriseppstein/compass(is written in Sass)
> >  -https://github.com/nex3/sass
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+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-users@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 make a query form depend on a field?

2011-09-26 Thread Doug Ballance
There are also a few third-party apps that can assist you with the
form->query process such as this one:

https://github.com/alex/django-filter

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



Re: Python Weekly

2011-09-26 Thread Javier Guerra Giraldez
On Mon, Sep 26, 2011 at 12:43 PM, Rahul  wrote:
> started a free weekly newsletter called Python Weekly

make it an RSS, and on a readable format (not a single PNG), and I'm
in.  right now, it's too much like spam techniques for my taste.  (not
saying that it's spam, only that you're using the same methods)

-- 
Javier

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



Re: DJango doesn't work with Oracle 11g on Windows 8

2011-09-26 Thread Andre Terra
Windows 8?

On Sat, Sep 24, 2011 at 5:27 AM, Benjamin Welton <
benjamin.r.wel...@wmich.edu> wrote:

>  Hey Alec,
>
> django.core.exceptions.ImproperlyConfigured: Error loading cx_Oracle
> module: DLL load failed: %1 is not a valid Win32 application.
>
> Do you have the visual c redistributable installed for 64bit and the Python
> for windows extensions for 64bit installed?
>
> Ben
>
>
> On 9/24/2011 3:17 AM, Alec Taylor wrote:
>
> Good afternoon,
>
> Unfortunately DJango doesn't work with Oracle 11g Express on Windows 8 x64.
>
> DJango error: http://pastebin.com/8tAzsjYh (summary: "No module named
> cx_Oracle")
>
> pip install cx_Oracle output: http://pastebin.com/6Y61PqSM
>
> easy_install cx_Oracle output: http://pastebin.com/rCsY63RS
>
> Summary: "Unable to find vcvarsall.bat"
>
> When I try tried the x64 installer fromhttp://cx-oracle.sourceforge.net/ 
> (using Python 2.7 x64), I got the
> following manage.py syncdb error: http://pastebin.com/syqxF4m6
>
> How can I make DJango work with my Oracle 11g Express database?
>
> Thanks for all suggestions,
>
> Alec Taylor
>
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+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-users@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 doesn't work with Oracle 11g on Windows 8

2011-09-26 Thread Benjamin Welton

Windows 8?


Its possible he's using it on Windows 8 since the developer preview is 
available. If he actually is id be curious to know if everything works 
ok on windows 8 with python/django.


Ben

On 09/26/2011 04:10 PM, Andre Terra wrote:

Windows 8?

On Sat, Sep 24, 2011 at 5:27 AM, Benjamin Welton 
mailto:benjamin.r.wel...@wmich.edu>> wrote:


Hey Alec,

django.core.exceptions.ImproperlyConfigured: Error loading
cx_Oracle module: DLL load failed: %1 is not a valid Win32
application.

Do you have the visual c redistributable installed for 64bit and
the Python for windows extensions for 64bit installed?

Ben


On 9/24/2011 3:17 AM, Alec Taylor wrote:

Good afternoon,

Unfortunately DJango doesn't work with Oracle 11g Express on Windows 8 x64.

DJango error:http://pastebin.com/8tAzsjYh  (summary: "No module named
cx_Oracle")

pip install cx_Oracle output:http://pastebin.com/6Y61PqSM

easy_install cx_Oracle output:http://pastebin.com/rCsY63RS

Summary: "Unable to find vcvarsall.bat"

When I try tried the x64 installer from
http://cx-oracle.sourceforge.net/  (using Python 2.7 x64), I got the
following manage.py syncdb error:http://pastebin.com/syqxF4m6

How can I make DJango work with my Oracle 11g Express database?

Thanks for all suggestions,

Alec Taylor



-- 
You received this message because you are subscribed to the Google

Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com
.
To unsubscribe from this group, send email to
django-users+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-users@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-users@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 doesn't work with Oracle 11g on Windows 8

2011-09-26 Thread Andre Terra
It's just that if I were trying to get django working on windows 8, I
wouldn't start with an Oracle setup.


Cheers,
AT

On Mon, Sep 26, 2011 at 6:14 PM, Benjamin Welton <
benjamin.r.wel...@wmich.edu> wrote:

>  Windows 8?
>
>
> Its possible he's using it on Windows 8 since the developer preview is
> available. If he actually is id be curious to know if everything works ok on
> windows 8 with python/django.
>
> Ben
>
>
> On 09/26/2011 04:10 PM, Andre Terra wrote:
>
> Windows 8?
>
> On Sat, Sep 24, 2011 at 5:27 AM, Benjamin Welton <
> benjamin.r.wel...@wmich.edu> wrote:
>
>>  Hey Alec,
>>
>> django.core.exceptions.ImproperlyConfigured: Error loading cx_Oracle
>> module: DLL load failed: %1 is not a valid Win32 application.
>>
>> Do you have the visual c redistributable installed for 64bit and the
>> Python for windows extensions for 64bit installed?
>>
>> Ben
>>
>>
>> On 9/24/2011 3:17 AM, Alec Taylor wrote:
>>
>> Good afternoon,
>>
>> Unfortunately DJango doesn't work with Oracle 11g Express on Windows 8 x64.
>>
>> DJango error: http://pastebin.com/8tAzsjYh (summary: "No module named
>> cx_Oracle")
>>
>> pip install cx_Oracle output: http://pastebin.com/6Y61PqSM
>>
>> easy_install cx_Oracle output: http://pastebin.com/rCsY63RS
>>
>> Summary: "Unable to find vcvarsall.bat"
>>
>> When I try tried the x64 installer fromhttp://cx-oracle.sourceforge.net/ 
>> (using Python 2.7 x64), I got the
>> following manage.py syncdb error: http://pastebin.com/syqxF4m6
>>
>> How can I make DJango work with my Oracle 11g Express database?
>>
>> Thanks for all suggestions,
>>
>> Alec Taylor
>>
>>
>>
>>--
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+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-users@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-users@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-users@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: good django twitter login tutorial

2011-09-26 Thread Gianluca Sforna
On Mon, Sep 26, 2011 at 7:49 PM, Cal Leeming [Simplicity Media Ltd]
 wrote:
> You are kidding, right?
> https://bitbucket.org/david/django-oauth-plus/wiki/Home
> I appreciate you are a total beginner, but come on, get your hands dirty! :)

Are you sure that covers the OP question? I think django-oauth is
useful to create oauth providers; for consumers (like the one he's
trying to build) he needs a client. For that, I found python-oauth2 at
https://github.com/simplegeo/python-oauth2; the readme there has even
an example of authenticating a django app with twitter.

-- 
Gianluca Sforna

http://morefedora.blogspot.com
http://identi.ca/giallu - http://twitter.com/giallu

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



Re: Web Designer

2011-09-26 Thread Joseph Slone
What!!! Nobody is using vigor anymore?

On Mon, Sep 26, 2011 at 12:25 PM, Sushirod  wrote:

> For Mac I use coda and for Windows I realy like Notepad++.
>
> As far as WYSIWYG editors go I`ve never seen one that`s better than
> Dreamweaver, wich I`d say it`s not that wysiwyg at all. To be honest
> there's no such thing as a WYSIWYG, I think its just a marketing term
> that propose a software with a very junky visualization of what your
> are doing.
>
> The real deal it's to experience the code rendered in browser (try to
> use all of then for production purpose). That`s how your user will
> experience it.
>
> I`d also say that vi (or vim) are realy good to work "in server" via
> the SSH, I use it sometimes before going to production.
>
> Make good use of plugins such as firebug (firefox) and the google
> chrome code inspector.
>
> On 25 set, 21:05, "christian.posta"  wrote:
> > I do most of the html code for my django templates in PyCharm and just
> > write the code by hand. I've been evaluating WYSIWYG html/web
> > designers recently (Dreamweaver). But, I find myself using the 'split'
> > mode of Dreamweaver where I write the code and watch the auto-updating
> > visual editor. But i don't want to switch to a different code editor
> > since i'm very comfortable with the keyboard shortcuts and
> > autocompletion I get in PyCharm.
> >
> > Do most people who write the templates/html code for django apps
> > primarily write some code, jump to a browser and refresh? Or write the
> > static content using a full-blown designer and then break it up into
> > django templates? I would be grateful for any ideas
> > Thanks!
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>


-- 
Joseph Slone

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



Re: DJango doesn't work with Oracle 11g on Windows 8

2011-09-26 Thread Benjamin Welton
Very true, oracle is quite difficult to get working (properly at least) 
in general on windows. Much less what amounts to a beta version of 
windows. I haven't heard back from the original poster on this, like i 
said im very curious to see if he was able to get everything working 
correctly. Everything should work for him since there doesnt seem to be 
any major kernel changes in windows 8 (unless he's using the Protogon 
file system, then all bets are off).


Ben

On 9/26/2011 4:23 PM, Andre Terra wrote:
It's just that if I were trying to get django working on windows 8, I 
wouldn't start with an Oracle setup.



Cheers,
AT

On Mon, Sep 26, 2011 at 6:14 PM, Benjamin Welton 
mailto:benjamin.r.wel...@wmich.edu>> wrote:



Windows 8?


Its possible he's using it on Windows 8 since the developer
preview is available. If he actually is id be curious to know if
everything works ok on windows 8 with python/django.

Ben


On 09/26/2011 04:10 PM, Andre Terra wrote:

Windows 8?

On Sat, Sep 24, 2011 at 5:27 AM, Benjamin Welton
mailto:benjamin.r.wel...@wmich.edu>> wrote:

Hey Alec,

django.core.exceptions.ImproperlyConfigured: Error loading
cx_Oracle module: DLL load failed: %1 is not a valid Win32
application.

Do you have the visual c redistributable installed for 64bit
and the Python for windows extensions for 64bit installed?

Ben


On 9/24/2011 3:17 AM, Alec Taylor wrote:

Good afternoon,

Unfortunately DJango doesn't work with Oracle 11g Express on Windows 8 
x64.

DJango error:http://pastebin.com/8tAzsjYh  (summary: "No module named
cx_Oracle")

pip install cx_Oracle output:http://pastebin.com/6Y61PqSM

easy_install cx_Oracle output:http://pastebin.com/rCsY63RS

Summary: "Unable to find vcvarsall.bat"

When I try tried the x64 installer from
http://cx-oracle.sourceforge.net/  (using Python 2.7 x64), I got the
following manage.py syncdb error:http://pastebin.com/syqxF4m6

How can I make DJango work with my Oracle 11g Express database?

Thanks for all suggestions,

Alec Taylor



-- 
You received this message because you are subscribed to the

Google Groups "Django users" group.
To post to this group, send email to
django-users@googlegroups.com
.
To unsubscribe from this group, send email to
django-users+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-users@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-users@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-users@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-users@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.



psycopg2 pickling error

2011-09-26 Thread tom
Hello,

since a while I see very often those errors:
Traceback (most recent call last):

 File "/opt/agileamp/lib/python/django/core/handlers/base.py", line
89, in get_response
   response = middleware_method(request)

 File "/usr/local/lib/python2.6/dist-packages/newrelic-0.5.15.41-
py2.6.egg/newrelic/api/function_trace.py", line 137, in __call__
   return self._nr_next_object(*args, **kwargs)

 File "/usr/local/lib/python2.6/dist-packages/newrelic-0.5.15.41-
py2.6.egg/newrelic/api/name_transaction.py", line 58, in __call__
   return self._nr_next_object(*args, **kwargs)

 File "/opt/agileamp/scrumtool/utils/middleware/customer.py", line 19,
in process_request
   customer = Company.objects.get(account__subdomain =
request.subdomain)

 File "/opt/agileamp/lib/python/django/db/models/manager.py", line
132, in get
   return self.get_query_set().get(*args, **kwargs)

 File "/opt/agileamp/scrumtool/agile_cache/managers.py", line 117, in
get
   return super(CachingQuerySet, self).get(*args, **kwargs)

 File "/opt/agileamp/lib/python/django/db/models/query.py", line 344,
in get
   num = len(clone)

 File "/opt/agileamp/lib/python/django/db/models/query.py", line 82,
in __len__
   self._result_cache = list(self.iterator())

 File "/opt/agileamp/scrumtool/agile_cache/managers.py", line 87, in
iterator
   cache.add(obj.cache_key, obj, 60 * 60 * 24)

 File "/opt/agileamp/lib/python/django/core/cache/backends/
memcached.py", line 54, in add
   return self._cache.add(key, value,
self._get_memcache_timeout(timeout))

 File "/usr/local/lib/python2.6/dist-packages/newrelic-0.5.15.41-
py2.6.egg/newrelic/api/memcache_trace.py", line 113, in __call__
   return self._nr_next_object(*args, **kwargs)

 File "/usr/lib/pymodules/python2.6/memcache.py", line 456, in add
   return self._set("add", key, val, time, min_compress_len)

 File "/usr/lib/pymodules/python2.6/memcache.py", line 725, in _set
   store_info = self._val_to_store_info(val, min_compress_len)

 File "/usr/lib/pymodules/python2.6/memcache.py", line 697, in
_val_to_store_info
   pickler.dump(val)

PicklingError: Can't pickle :
it's not the same object as psycopg2.tz.FixedOffsetTimezone

I have upgraded psycopg2 to version 2.4.2 (the FixedOffsetTimezone
should contain a fix for pickling errors - 
http://initd.org/psycopg/docs/tz.html),
but I still see the error. I have contacted newrelic about the issue,
but they see this issue not related to newrelic.

Has someone a hint how I can nail that issue down?

Many thanks, 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-users@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.



Postgres on OSX Lion

2011-09-26 Thread adrian

Postgres comes pre-installed in OSX Lion for the first time (and mysql
is no longer present).  Yeah!
I installed psycopg2 using pip.

Then I kept getting the error message:

psycopg2.OperationalError: could not connect to server: Permission
denied
Is the server running locally and accepting
connections on Unix domain socket "/var/pgsql_socket/.s.PGSQL.5432"?

The simple solution is to change your settings file so that HOST =
'localhost'.   If it is set to '127.0.0.1'  or not specified you will
get the error above.
>From google searches it appears some people are having this issue with
MacPorts, Fink, and homebrew versions of Postgres as well, as of MacOS
10.7.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-users@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: Python Weekly

2011-09-26 Thread Gelonida N
On 09/26/2011 07:43 PM, Rahul wrote:
> Hi Everyone,
> 
> I have started a free weekly newsletter called Python Weekly which
> includes curated news, articles, new releases, software & tools,
> events, jobs etc about Python and related technologies. It's a great
> way to keep abreast of what's happening in Python land. You can
> subscribe to it here, http://www.pythonweekly.com/
> 
> Regards
> Rahul Chaudhary
> 
Can one see the newsletter also online (without subscribing??)

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



Re: How to make a query form depend on a field?

2011-09-26 Thread Russell Keith-Magee
On Mon, Sep 26, 2011 at 11:59 PM, Tom Evans  wrote:
> On Mon, Sep 26, 2011 at 4:26 PM, David G. Pullman
>  wrote:
>> Thanks very much for helping to separate the processing.  I'm trying to 
>> implement a setup using your suggestions.  I've hit a snag on a detail:
>>
>>> class SearchForm(forms.Form):
>>>    organization = forms.ModelField(Organization)
>>>    search_term = forms.CharField(max_length=100)
>>
>> What's a ModelField?  I was unable to find it in a search on 
>> docs.djangoproject.com.  I found it referred to in an abstract way on a 
>> google search, but not as an actual attribute name.
>>
>
> 100% certain that was just a brain fade on Russell's part, it should
> be forms.ModelChoiceField
>
> https://docs.djangoproject.com/en/1.3/ref/forms/fields/#modelchoicefield

Gah - yes, you've correctly diagnosed my degenerative brain disorder... :-)

Yours,
Russ Magee %-)

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



Re: Postgres on OSX Lion

2011-09-26 Thread Nadae Ivar BADIO
Sudo for admin permissions
Envoyé par mon BlackBerry® smartphone de Tigo

-Original Message-
From: adrian 
Sender: django-users@googlegroups.com
Date: Mon, 26 Sep 2011 15:54:00 
To: Django users
Reply-To: django-users@googlegroups.com
Subject: Postgres on OSX Lion


Postgres comes pre-installed in OSX Lion for the first time (and mysql
is no longer present).  Yeah!
I installed psycopg2 using pip.

Then I kept getting the error message:

psycopg2.OperationalError: could not connect to server: Permission
denied
Is the server running locally and accepting
connections on Unix domain socket "/var/pgsql_socket/.s.PGSQL.5432"?

The simple solution is to change your settings file so that HOST =
'localhost'.   If it is set to '127.0.0.1'  or not specified you will
get the error above.
>From google searches it appears some people are having this issue with
MacPorts, Fink, and homebrew versions of Postgres as well, as of MacOS
10.7.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-users@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-users@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: Platform system with Django?

2011-09-26 Thread Ian
So I already have my site up and running in PHP/mySQL, but I want to
move to Django (and learn it in the process!)

The way I do it now is have a main table of posts, and the table of
posts has a column called "site".  If the user accesses myproject.com/
mySite, it loads the posts from the database for everything with the
condition site=="mySite"
So I do it the same way in Django?  Use the same logic, with Django's
sites framework?

That makes my life easy since the application logic is already done!
How do I handle the subdomain, though?

Thanks!

On Sep 26, 9:26 am, jmontoya  wrote:
> You can use pinax is based in django and it has a lots of "website
> templates", intranet, blog, social etc
> You can easly customized it ...
>
> http://pinaxproject.com/
>
> Regards,
>
> Julio
>
> On Sep 26, 6:18 am, Ian  wrote:
>
>
>
>
>
>
>
> > I'm new to django, and at this point all I've done is the tutorial.
>
> > But my end goal is to create a website that serves as aplatform
> > system.
>
> > I want users to go to my site, create an account, edit some settings/
> > preferences, and a subdomain (can you do this with django?).
>
> > Then within each subdomain, other people can register as users to this
> > particular subdomain, post things, etc.
>
> > Is it possible to do this?  I can imagine the structure and how to get
> > the second part working (having users register on a particular
> > subdomain site, post things, etc), but I'm having trouble figuring out
> > where to get started with the first part (creating the subdomain site)
>
> > Is there a tutorial or guide to get me started with thisplatform
> > concept?  Thanks so much!

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



Re: [pinax-users] Learn DJango first, then learn Pinax; or just learn Pinax straight-off?

2011-09-26 Thread Brian Rosner
On Sat, Sep 17, 2011 at 1:17 AM, Alec Taylor  wrote:
> Would you recommend I follow the aforementioned Learning Plan, or
> would you recommend a different method?

Our getting started guide
http://pinax.readthedocs.org/en/latest/gettingstarted.html shows you
some reading you should do before diving into Pinax. NOTE: the
documentation linked is for the development version of Pinax.

-- 
Brian Rosner
http://twitter.com/brosner

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



Re: can't get STATICFILES to work (Django dev version)

2011-09-26 Thread nara
Xavier,

I followed the blog, and at the end, my css files were not getting
pulled in.
I then tried doing a ./manage.py collectstatic, and this does collect
all
static files. Unfortunately, running the server still does not serve
my
css files.

I have spent too many cycles on this issue now. I will go back to my
workaround of just placing css inline in the templates, and later,
use Apache on my local machine to serve the css files.

Thanks
Nara

On Sep 25, 2:44 pm, Xavier Ordoquy  wrote:
> Hi,
>
> > I have read and followed the docs on static files.
> > django.contrib.staticfiles is in INSTALLED_APPS
> > (by default), and I have set STATICFILES_DIRS to where my static files
> > are (/home/nara/media). (I have
> > tried with and without a slash at the end of this absolute file path).
>
> Static files aren't media. You should keep them separated.
>
> > I am confused about whether ./manage.py collectstatic is a necessary
> > step for static files to work, I didn't think so, and have not done
> > that.
>
> It isn't if you aren't on production stage (ie, DEBUG=False).
>
> I have started a post on how to setup static files. It isn't finished yet but 
> might help you to set it 
> up:http://www.linovia.com/blog/django-staticfiles-howto/
>
> Regards,
> Xavier.

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



Forms from models API example.

2011-09-26 Thread Jack720
I'd just like to state that I did try and find this out on my own
first but "django form model api" isn't a vary narrowing search. I've
read through the documentation multiple times but I'm still a little
stuck. It would appear most of the documentation/examples are
outdated. I'm certain this has been answered before I just can't find
the answer.

First, is the current forms api solid? Or are major changes still
planed? It seems like it went through a major change in 2007 and now
2010? The newforms versus forms gets a bit hairy.

2ndly, As a bit of constructive criticism the main tutorial should
really have included a section on the forms api. At the very least the
end of the tutorial should let you know it exists. I know how time
keeps documentation from getting done. I get the whole learning to
multiply before using a calculator thing but I didn't even know about
that part of the API for a while and it's fairly major. When it comes
to forms the tutorial leaves us at multiplication and didn't even tell
us there was a calculator.

3rd, and the main question. Does anyone have a simple working example!
I'm trying to use the form api using my models but the code in the
documentation seems to have a bit of a chicken egg problem. They seem
to show a view that displays a new form or posts and saves a form but
doesn't show how we got the form for a specific record id in the first
place! I'm just trying to create a simple list of records with CRUD.
simple enough just like the admin interface only I'll be putting a
bunch of other code around this.

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



password_reset_form_save() got an unexpected keyword argument 'request'

2011-09-26 Thread Ben O'Day
I recently upgraded to Django 1.3 (from 1.2) and noticed that our
password reset functionality isn't working.  I do have the templates
customized, but am using the default view/form files for this.
Looking at the django.contrib.auth.views file, I can't see the issue
either (the parameters in the opt dict seem to match the expected
params on the form, etc)

here is my urls.py config...

# password reset
(r'^password_reset/$', 'django.contrib.auth.views.password_reset',
{'template_name':'registration/dasn_password_reset.html',
'email_template_name':'email/dasn_password_reset_email.html'}),
(r'^password_reset/done/$',
'django.contrib.auth.views.password_reset_done',
{'template_name':'registration/dasn_password_reset_done.html'}),
(r'^reset/(?P[0-9A-Za-z]+)-(?P.+)/$',
'django.contrib.auth.views.password_reset_confirm', {'template_name':
'registration/dasn_password_reset_confirm.html'}),
(r'^reset/done/$',
'django.contrib.auth.views.password_reset_complete', {'template_name':
'registration/dasn_password_reset_complete.html'}),

here is the error...any ideas?

Request Method: POST
Request URL:http://127.0.0.1:8000/password_reset/
Django Version: 1.3 SVN-16907
Exception Type: TypeError
Exception Value:

password_reset_form_save() got an unexpected keyword argument
'request'

Exception Location: c:\projects\dasn\django\django\contrib\auth
\views.py in password_reset, line 155
Python Executable:  C:\Python27\python.exe
Python Version: 2.7.1
Python Path:

['C:\\projects\\dasn\\dasn\\apps',
 'C:\\Python27\\lib\\site-packages\\xlrd-0.7.1-py2.7-win32.egg',
 'C:\\Python27\\lib\\site-packages\\pil-1.1.7-py2.7-win32.egg',
 'C:\\Python27\\lib\\site-packages\\markdown-2.0.3-py2.7-win32.egg',
 'C:\\Python27\\lib\\site-packages\\boto-2.0b3-py2.7.egg',
 'C:\\Python27\\lib\\site-packages\\robhudson-django-debug-
toolbar-930f33b',
 'c:\\projects\\dasn\\django',
 'c:\\projects\\dasn\\dasn',
 'c:\\projects\\dasn\\dasn\\apps',
 'C:\\Windows\\system32\\python27.zip',
 'C:\\Python27\\DLLs',
 'C:\\Python27\\lib',
 'C:\\Python27\\lib\\plat-win',
 'C:\\Python27\\lib\\lib-tk',
 'C:\\Python27',
 'C:\\Python27\\lib\\site-packages',
 'C:\\Python27\\lib\\site-packages\\PIL']

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



Creating an imageField from a charField

2011-09-26 Thread Mehrms
Does anyone know how to instantiate an imageField using just the URL
of the image?

I am storing my URLs to images in a charField, but I am letting the
user interact with the imageField. Everything works fine to render the
imageField and I can use the imageField to upload an image. The url of
the stored image is safely stored in the database in a charField. The
only problem is I can't figure out how to pass the image url to the
imageField when I dynamicly create the imageField.

Is there a way to bind the data from the charField to the imageField.
I looked through all the data binding documentation and it doesnt show
how to bind data on a per field basis.

Any suggestions would help. The reason I have the url in a charField
is because its a property in a sudo triplestore.

Here is a sample of the code for my form.

class MetadataForm(ModelForm):
"""
Based upon the metatype create the correct field for this form.
"""
def __init__(self, *args, **kwargs):
super(MetadataForm, self).__init__(*args,**kwargs)

type_id = self.instance.metaType_id

if type_id != None:
self.fields['value'] = self.createField(type_id)

def createField(self,type):

metatype = MetaType.objects.get(id=type)

if (metatype.type == 'charField'):
return forms.CharField(widget = forms.Textarea,
required=False)
if (metatype.type == 'imageField'):
f = forms.ImageField(required=False)
   return f

Thanks for the help,

Brian

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



Re: [pinax-users] Learn DJango first, then learn Pinax; or just learn Pinax straight-off?

2011-09-26 Thread Alec Taylor
Thanks. I'll get the prereqs installed now.

On Tue, Sep 27, 2011 at 10:43 AM, Brian Rosner  wrote:
> On Sat, Sep 17, 2011 at 1:17 AM, Alec Taylor  wrote:
>> Would you recommend I follow the aforementioned Learning Plan, or
>> would you recommend a different method?
>
> Our getting started guide
> http://pinax.readthedocs.org/en/latest/gettingstarted.html shows you
> some reading you should do before diving into Pinax. NOTE: the
> documentation linked is for the development version of Pinax.
>
> --
> Brian Rosner
> http://twitter.com/brosner
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+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-users@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: Forms from models API example.

2011-09-26 Thread Russell Keith-Magee
On Tue, Sep 27, 2011 at 7:10 AM, Jack720  wrote:
> I'd just like to state that I did try and find this out on my own
> first but "django form model api" isn't a vary narrowing search. I've
> read through the documentation multiple times but I'm still a little
> stuck. It would appear most of the documentation/examples are
> outdated. I'm certain this has been answered before I just can't find
> the answer.
>
> First, is the current forms api solid? Or are major changes still
> planed? It seems like it went through a major change in 2007 and now
> 2010? The newforms versus forms gets a bit hairy.

I'm not sure what you're referring to with the 2010 change. The forms
API has been very much stable since 2007, and is covered by Django's
backwards compatibility policy.

> 2ndly, As a bit of constructive criticism the main tutorial should
> really have included a section on the forms api. At the very least the
> end of the tutorial should let you know it exists. I know how time
> keeps documentation from getting done. I get the whole learning to
> multiply before using a calculator thing but I didn't even know about
> that part of the API for a while and it's fairly major. When it comes
> to forms the tutorial leaves us at multiplication and didn't even tell
> us there was a calculator.

Thanks for the feedback -- we're certainly aware that more tutorials
are needed, we just haven't found the time (or the willing volunteers)
to write them. Forms would certainly be a good candidate for a new
tutorial.

> 3rd, and the main question. Does anyone have a simple working example!
> I'm trying to use the form api using my models but the code in the
> documentation seems to have a bit of a chicken egg problem. They seem
> to show a view that displays a new form or posts and saves a form but
> doesn't show how we got the form for a specific record id in the first
> place! I'm just trying to create a simple list of records with CRUD.
> simple enough just like the admin interface only I'll be putting a
> bunch of other code around this.

Well, the pieces are all there [1] [2]; it's just not obvious how to
put them all together. Here's an example of an update view:

from django import forms
from django.http import Http404, HttpResponseRedirect
from django.shortcuts import render
from myapp.models import MyModel

class MyForm(forms.ModelForm):
class Meta:
model = MyModel

def my_view(request, object_id):
try:
obj = MyModel.objects.get(pk=object_id)
except MyModel.DoesNotExist:
raise Http404

if request.method == 'POST':
form = MyForm(instance=obj, data=request.POST)
if form.is_valid():
form.save()
return HttpResponseRedirect('/some/url/')
else:
form = MyForm(instance=obj)

return render(request, 'example/template.html' {
'form': form
})

The only differences between this example and the simple form example are:
  * You start the view by retrieve an object matching the view
arguments, raising 404 if the object can't be found
  * You pass that instance to the form when you construct the form instance.

I know this isn't the same as a full length tutorial, but I hope it's
enough to get you going.

[1] https://docs.djangoproject.com/en/1.3/topics/forms/
[2] 
https://docs.djangoproject.com/en/1.3/topics/forms/modelforms/#the-save-method

Yours,
Russ Magee %-)

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



Re: can't get STATICFILES to work (Django dev version)

2011-09-26 Thread nara
Good news, my static files finally work. (I wanted to make
one last try before giving up). Bottom line, I did not
have to make any changes to my original settings.py or urls.py.
All I did: created a static dir. under my app's directory, placed
the css files under it, and put '/static/css/blueprint/screen.css' to
refer to the external css. That was it.

Here is the head section of my template file, list.html:

  
  
  


Thanks
Nara

On Sep 26, 6:02 pm, nara  wrote:
> Xavier,
>
> I followed the blog, and at the end, my css files were not getting
> pulled in.
> I then tried doing a ./manage.py collectstatic, and this does collect
> all
> static files. Unfortunately, running the server still does not serve
> my
> css files.
>
> I have spent too many cycles on this issue now. I will go back to my
> workaround of just placing css inline in the templates, and later,
> use Apache on my local machine to serve the css files.
>
> Thanks
> Nara
>
> On Sep 25, 2:44 pm, Xavier Ordoquy  wrote:
>
>
>
>
>
>
>
> > Hi,
>
> > > I have read and followed the docs on static files.
> > > django.contrib.staticfiles is in INSTALLED_APPS
> > > (by default), and I have set STATICFILES_DIRS to where my static files
> > > are (/home/nara/media). (I have
> > > tried with and without a slash at the end of this absolute file path).
>
> > Static files aren't media. You should keep them separated.
>
> > > I am confused about whether ./manage.py collectstatic is a necessary
> > > step for static files to work, I didn't think so, and have not done
> > > that.
>
> > It isn't if you aren't on production stage (ie, DEBUG=False).
>
> > I have started a post on how to setup static files. It isn't finished yet 
> > but might help you to set it 
> > up:http://www.linovia.com/blog/django-staticfiles-howto/
>
> > Regards,
> > Xavier.

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



Re: can't get STATICFILES to work (Django dev version)

2011-09-26 Thread Babatunde Akinyanmi
When you want to access say screen.css, how do you put it in your template??

On 9/26/11, nara  wrote:
> I am having trouble getting STATICFILES to work. I have read the docs,
> and followed the instructions, but I never get my css files to load.
> My current workaround is to put all the css inline in my template
> file, but that should not be a permanent solution.
>
> I am running the django dev version, and I am using the built-in
> server. Here are my changes:
>
> 1. I placed my media (css) files under /home/nara/media
> 2. I added '/home/nara/media' under STATICFILES_DIRS
> (django.contrib.staticfiles is already in INSTALLED_APPS)
> 3. I added {{STATIC_URL}} (no spaces) in front of the reference to
> static files in my template file.
> 4. I restarted the server.
>
> No further changes. I don't have additional copies of the static files
> anywhere else, such
> us under my project, or app.
>
> Looking at the result in firebug within firefox, I get an HTTP
> response of 200 on my css files
> (happen to be css/blueprint/screen.css and print.css), but the files
> are null. Clearing
> the cache, restarting Firefox etc. do not help.
>
> I have been fighting this issue for several days now, and have tried
> many things,
> but the above description is for my current state.
>
> Thanks
> Nara
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
Sent from my mobile device

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



Re: can't get STATICFILES to work (Django dev version)

2011-09-26 Thread Xavier Ordoquy
Hi,

Using a static directory like that on the development server sounds wrong and 
you'll most probably have issues when the site goes live.

>From what you said, it looks like you are confusing STATICFILES_DIRS and 
>STATICFILES_ROOT.

Regards,
Xavier.


Le 27 sept. 2011 à 05:29, nara a écrit :

> Good news, my static files finally work. (I wanted to make
> one last try before giving up). Bottom line, I did not
> have to make any changes to my original settings.py or urls.py.
> All I did: created a static dir. under my app's directory, placed
> the css files under it, and put '/static/css/blueprint/screen.css' to
> refer to the external css. That was it.
> 
> Here is the head section of my template file, list.html:
>   
>   type="text/css" media="screen, projection">
>   type="text/css" media="print">
>  
> 
> 
> Thanks
> Nara
> 
> On Sep 26, 6:02 pm, nara  wrote:
>> Xavier,
>> 
>> I followed the blog, and at the end, my css files were not getting
>> pulled in.
>> I then tried doing a ./manage.py collectstatic, and this does collect
>> all
>> static files. Unfortunately, running the server still does not serve
>> my
>> css files.
>> 
>> I have spent too many cycles on this issue now. I will go back to my
>> workaround of just placing css inline in the templates, and later,
>> use Apache on my local machine to serve the css files.
>> 
>> Thanks
>> Nara
>> 
>> On Sep 25, 2:44 pm, Xavier Ordoquy  wrote:
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>>> Hi,
>> 
 I have read and followed the docs on static files.
 django.contrib.staticfiles is in INSTALLED_APPS
 (by default), and I have set STATICFILES_DIRS to where my static files
 are (/home/nara/media). (I have
 tried with and without a slash at the end of this absolute file path).
>> 
>>> Static files aren't media. You should keep them separated.
>> 
 I am confused about whether ./manage.py collectstatic is a necessary
 step for static files to work, I didn't think so, and have not done
 that.
>> 
>>> It isn't if you aren't on production stage (ie, DEBUG=False).
>> 
>>> I have started a post on how to setup static files. It isn't finished yet 
>>> but might help you to set it 
>>> up:http://www.linovia.com/blog/django-staticfiles-howto/
>> 
>>> Regards,
>>> Xavier.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+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-users@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.