Re: Does Hostmonster support Django?

2007-11-11 Thread Mike Cantelon

> I personally use webfaction for public hosting, but its a major pain
>
> Just buy your own box

...or go the VPS route. Any hosting company offering Xen-based virtual
servers (I used provps.com, who have been great) can give you the
flexibility of your own server without the cost of a dedicated server.

Mike
-
http://mikecantelon.com


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



Re: Admin Dies With White Screen

2007-11-11 Thread Mike Cantelon

Postscript: I managed to fix this, funnily enough, by upgrading the
PHP on the same server to PHP 5. In the process of upgrading, MySQL
also got upgraded to 5 and the MySQL-python RPM got upgraded as well.

Mike

> I'm trying to run the latest Subversion version of Django on Centos
> 4.4 with MySQLdb 1.2.2, MySQL 4.1, Python 2.3.4, and mod_python 3.x.
>
> I've tested mod_python and it works, I've tested MySQLdb by doing a
> query from the Python command line and it works.
>
> I can get a Django URL to respond with a "Hello world", but I can't
> get the Django admin to come up... I get awhitescreen.


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



Re: Does Hostmonster support Django?

2007-11-11 Thread justquick

It is possible to install Django (of any version) onto a webserver if
you own it and have shell access, like a dedicated server. Other
webhosts have these features already installed and are "easily"
configurable. The complete list is here: 
http://code.djangoproject.com/wiki/DjangoFriendlyWebHosts

I personally use webfaction for public hosting, but its a major pain

Just buy your own box
Justin

On Nov 11, 8:50 pm, Hannus <[EMAIL PROTECTED]> wrote:
> Hi guys,
> I am going to buy the host services in host monster,does it support
> Django? If not, plz advice me some other hosting companies.
> Thank you very much
>
> Kind regards,
> Hannus


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



Re: Feeds

2007-11-11 Thread justquick

Try giving your model a get_absolute_url(self) method which returns
the absolute (http://...) url of the object for use in feed links. If
that does not work, reply with the complete traceback (usually found
by clicking 'Switch to copy-and-paste view' on a standard Django error
report)

Justin

On Nov 11, 9:03 pm, "Miguel Galves" <[EMAIL PROTECTED]> wrote:
> Hi,
>
> i'm new to Django, and I'm warming up building a simple job board app.
> I'm trying to put a feed system to work using the middleware bundled with
> Django.
>
> - url.py:
>
> feeds = {
> 'ads': AdFeed,
>
> }
>
> urlpatterns = patterns('',
> (r'^admin/', include('django.contrib.admin.urls')),
> (r'^$', index),
> (r'^jobs/$', list),
> (r'^jobs/(?P\d*)/$', list),
> (r'^view/(?P\d*)/$', view),
> (r'^feeds/(.*)$', 'django.contrib.syndication.views.feed', {'feed_dict':
> feeds}),
> )
>
> - feeds.py file:
>
> class AdFeed(Feed):
> title = "Chicagocrime.org  site news"
> item_link = "http://job4dev.com;
> description = "Updates on changes and additions to chicagocrime.org."
>
> item_author_name='Joe Blow'
> item_author_email='[EMAIL PROTECTED]'
> item_author_link='http://www.example.com'
>
> def items(self):
> return Vaga.objects.all()[0:100]
>
> I've read the docs and lots of examples, and It seems to me that it's
> correct.
> But each time I try to acess /feeds/ads, I get an Attribute Error, with
> value
> "NoneType" object has no attribute startwith.
>
> The error is raised by
> python2.4/site-packages/django/contrib/syndication/feeds.py
> in get_feed
>
> I just can`t figure out where this None is coming from. Any idea?
>
> thanks,
>
> Miguel
>
> --
> Miguel Galves - Engenheiro de Computação
> Já leu meus blogs hoje?
> Para geekshttp://log4dev.com
> Pra pessoas normaishttp://miguelcomenta.wordpress.com
>
> "Não sabendo que era impossível, ele foi lá e fez..."


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



Re: media directory for testing

2007-11-11 Thread Amit Ramon

Another solution is to use environment variables for the settings that are 
different. You can then use the same settings file for all different 
environments. All you have to do is to read the environment variables in the 
settings file, something like:

DATABASE_NAME = os.environ["DATABASE_NAME"]

Cheers,

Amit

ביום ראשון 11 נובמבר 2007, 02:43, נכתב על ידי Malcolm Tredinnick:
> 
> On Sat, 2007-11-10 at 16:52 -0500, Faheem Mitha wrote:
> > 
> > Hi.
> > 
> > I'm having the following problem while testing. I'm writing a unit test 
> > for a file upload (using newforms). This works. However, the file gets 
> > written to the same media directory as is used in normal work. I'd prefer 
> > this happened somewhere where it would have no impact on normal 
> > functioning, possibly /tmp. Does anyone have suggestions on what to do? 
> > One workaround would be to redefine the media directory in the tests 
> > themselves, if I can figure out how to do that...
> 
> The "normal" would be to have a settings file that is used specifically
> for testing. You can put "from normal_settings import *" at the top and
> then just override the settings you need to.
> 
> It's not always going to be the case that you development, production
> and testing settings are identical. So take advantage of the fact you
> can have multiple settings files.
> 
> Regards,
> Malcolm
> 
> -- 
> For every action there is an equal and opposite criticism. 
> http://www.pointy-stick.com/blog/
> 
> 
> > 
> 

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



Re: Django or Cheetah (why not both)?

2007-11-11 Thread justquick

Now the project is going under the name django_cheetahtemplates to
avoid contrib namespace confusion. Regardless of name, having cheetah
templates is very handy and increases the rendering times of your
templates. We are working on transferring over all the power of the
django tags/filters to cheetah syntax. More development, including
comparative benchmarks, will be available soon on our project site
http://code.google.com/p/django-cheetahtemplate/

Justin


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



Re: Configuring a Django Project for Intranet Deployment

2007-11-11 Thread Martin J Hsu

> could change!)? However, at the same time I want to be able to run the
> development environment at http://127.0.0.1/ and want any maintenance
> overhead e.g. managing two sets of url.py files or changing any urls

expanding on Stefan's solution:
  You probably want a separate settings.py or at least a settings.py
file that is 'production' vs 'non-production' aware.  I suggest using
hostname.  You wouldn't want to blast the production database from
your development machine!  Unfortunately, I don't think there is a way
to avoid (initially) updating every URL (not just urls.py), but also
any references in templates, views, get_absolute_url(), etc.

Just a thought, it is possible to deloy on a separate machine?  That
should pretty much eliminate Django URL related issues and might be
more economical.  The toil and trouble trade off might be worth it.



On Nov 11, 10:09 pm, "Stefan Matthias Aust" <[EMAIL PROTECTED]>
wrote:
> On Nov 11, 2007 1:44 PM, RichardH <[EMAIL PROTECTED]> wrote:
>
> > From researching posts and blogs, I know this is a difficult issue but
> > was wondering whether anyone has come up with simple solutions?
>
> I had a similar problem. My solution was to setup a context processor
> which adds a "root" variable to all contexts and then using that
> variable as in ... in all templates.
>
> Such a processor is easy to create, for example:
>
>  def add_root_url(request):
>from django.conf import settings
>return dict(root=('' if settings.DEBUG else settings.DEPLOYMENT_ROOT))
>
> You need to add the function name to the settings'
> TEMPLATE_CONTEXT_PROCESSORS tuple.
>
> HTH,
>
> --
> Stefan Matthias Aust


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



Re: Django or Cheetah (why not both)?

2007-11-11 Thread justquick

Thanks for the advise, we were a little up in the air about where to
put this module. I proposed a middleware module to process the
responses marked as cheetah templates with a provided context, but it
seemed more suited to put it in the contrib section so you could
process contexts/templates inside the view. What do you sugest we name
it? Dont want to step on your feet (or namespaces)

J

On Nov 12, 12:09 am, "James Bennett" <[EMAIL PROTECTED]> wrote:
> On 11/11/07, justquick <[EMAIL PROTECTED]> wrote:
>
> >I have been working with another developer to create a contrib
> > addon for cheetah template processing. The new django.contrib.cheetah
> > is now in production and can render django contexts and templates into
> > responses faster than django's builtin template engine.
>
> Just a minor procedural thing: unless something is committed to Django
> itself in the django/contrib directory, please don't label it
> 'django.contrib' or document it as if it lives in 'django.contrib';
> post-1.0 we plan to have an official process for submitting
> third-party applications as contrib candidates, and polluting that
> namespace right now with things that aren't actually distributed with
> Django will cause a lot of confusion down the road.
>
> Since Django applications can live anywhere that a Python module can
> live, and since Django will happily import components (including
> template loaders) from anywhere you specify, please consider giving
> this a more descriptive standalone name, and distributing it to be
> installed directly on the Python path instead of requiring people to
> insert it into their copies of Django.
>
> --
> "Bureaucrat Conrad, you are technically correct -- the best kind of correct."


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



Re: Django or Cheetah (why not both)?

2007-11-11 Thread James Bennett

On 11/11/07, justquick <[EMAIL PROTECTED]> wrote:
>I have been working with another developer to create a contrib
> addon for cheetah template processing. The new django.contrib.cheetah
> is now in production and can render django contexts and templates into
> responses faster than django's builtin template engine.

Just a minor procedural thing: unless something is committed to Django
itself in the django/contrib directory, please don't label it
'django.contrib' or document it as if it lives in 'django.contrib';
post-1.0 we plan to have an official process for submitting
third-party applications as contrib candidates, and polluting that
namespace right now with things that aren't actually distributed with
Django will cause a lot of confusion down the road.

Since Django applications can live anywhere that a Python module can
live, and since Django will happily import components (including
template loaders) from anywhere you specify, please consider giving
this a more descriptive standalone name, and distributing it to be
installed directly on the Python path instead of requiring people to
insert it into their copies of Django.

-- 
"Bureaucrat Conrad, you are technically correct -- the best kind of correct."

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



Django or Cheetah (why not both)?

2007-11-11 Thread justquick

Hi all,

   I have been working with another developer to create a contrib
addon for cheetah template processing. The new django.contrib.cheetah
is now in production and can render django contexts and templates into
responses faster than django's builtin template engine. I want to see
if any of you think this is useful? I think that cheetah is a very
useful tool for templating; it has been maintained longer than
django's and has more functionality at the template level. Using
either one or the other should be up to you, the end users/developers,
but we all should have the option to choose. This contrib addon
package provides this functionality and can be used to render
contexts, or render responses by shortcut. Templatetag/filter
compatibility is coming soon, drop me a line if you are interested in
helping out. The project is available at 
http://code.google.com/p/django-cheetahtemplate/


Justin Quick


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



Re: Catching Exceptions thrown in .save() / Best practice question

2007-11-11 Thread Malcolm Tredinnick


On Sun, 2007-11-11 at 20:44 -0800, marknca wrote:
> According to a previous (http://groups.google.com/group/django-users/
> browse_thread/thread/64a9558d5c02e39/c0c28daed410898d?lnk=gst=catch
> +save+exception#c0c28daed410898d) post it's bad practice to wrap a
> model's .save() in a try/except. Adrian suggests using manipulators
> instead.

Bear in mind that the thread you referenced is over two years old. A few
things have changed since then. The obvious one being that
IntegrityError is now in the django.db namespace, so you don't need to
write database-specific code. That wasn't true back in November '05.

Secondly, IntegrityError is one of the few exceptions save() can raise.
The problem is that there are some things you just can't tell until you
talk to the database. In particular, whether a particular set of
database column constraints will be satisfied (a unique combination, or
a check constraint). So sometimes the database will raise IntegrityError
for reasons you can't control that (what if another process altogether
had written to the database?). This isn't always going to happen and
most of the time, you, the developer, will know what sort of database
access patterns to expect and whether it's likely/possible something
else will have written to the database.

All being said, though, the principle Adrian espoused in that thread is
correct: validation errors that can be detected at the Python level
shouldn't ever be raised from save(). However, there are some errors we
can't detect until we talk to the db, which only happens in save(). I
think it'd be really nice to have validators able to also verify that
database constraints were true (and guarantee they will remain true
until you call save() and commit the data to the db), however that's not
always possible.

[...]
> The test case failes by raising an IntegrityError even though I'm
> trapping it and asserting success if this Exception  is thrown.

You're calling the save() method in a few places and only catching
IntegrityError in one of those cases (the last one). I'll wager that the
place raising the error is not the line you think it is.

>  I had
> re-written this sequence a few times with the same results.
> 
> 1) Why can't I trap the IntegrityError in my test case?
> 
> 2) What is the best practice for writing test cases to validate that
> only unique data is being saved to the database?

Whatever works is usually good enough. You can catch IntegrityError. Or
you can select all the rows matching that particular value out at the
end and confirm there is only one object returned (although presumably
that will raise IntegrityError when you tried to save).

> Bonus question:
> 
> 1) Does self.failUnlessRaises() work with Python 2.4? Replacing the
> bottom section of the test case with self.failUnlessRaises() does not
> work on my Ubuntu 6.06 server w/Python 2.4 and the latest Django SVN
> release.

"Does not work" could mean many things. Since we're not psychic, it's
difficult to divine what actually happened in your case.
failUnlessRaises() exists at least as far back as python 2.3, though (as
a quick check of the online Python docs confirms).

Regards,
Malcolm

-- 
Quantum mechanics: the dreams stuff is made of. 
http://www.pointy-stick.com/blog/


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



Catching Exceptions thrown in .save() / Best practice question

2007-11-11 Thread marknca

According to a previous (http://groups.google.com/group/django-users/
browse_thread/thread/64a9558d5c02e39/c0c28daed410898d?lnk=gst=catch
+save+exception#c0c28daed410898d) post it's bad practice to wrap a
model's .save() in a try/except. Adrian suggests using manipulators
instead.

I'm writing a test case for a very basic Tag model. I've flagged
the .name field as unique and want to test this in my test case.

Here's the model:

from django.db import models
from django.db import IntegrityError
import re

class Tag(models.Model):
date_added = models.DateTimeField(auto_now_add=True)
name = models.CharField(maxlength=100, unique=True, primary_key=True)
condensed = models.CharField(maxlength=100, unique=True, blank=True)

def condense_name(self, name):
condensing = name

# remove all punctuation and non-word characters
condensing = re.sub(r'[\W ]', "_", condensing)
# remove multiple underscores
condensing = re.sub(r'__+', '_', condensing)
# trim the beginning and end of the string of underscores
condensing = re.sub(r'(^_)|(_$)', '', condensing)

return condensing

def save(self):
self.condensed = self.condense_name(self.name)

try:
exists = 
Tag.objects.get(condensed__exact=self.condensed)
except:
raise IntegrityError('Condensed name is not unique, 
already saved
to the database.')

super(Tag, self).save()

def __str__(self):
return self.name

Here's the test case:

from django.test import TestCase
from django.db import IntegrityError
from tags.models import Tag

class TestTagModel(TestCase):
def test_init(self):
self.assert_(Tag())

def test_condensed(self):
data = [
{'data':'spaced tag', 'expected':'spaced_tag'},
{'data':', with punctuation!',
'expected':'tag_with_punctuation'},
{'data':u'tag wîth aççénts', 
'expected':'tag_w_th_a_nts'},
]

for item in data:
toTest = Tag(name=item["data"])
self.assertEqual(toTest.condense_name(toTest.name),
item["expected"])

def test_unique(self):
unique_data = [
'test 1',
'test 2',
'test 3',
]

duplicate_data = [
'test_1',
'test 2',
'test_3',
]

for item in unique_data:
toTest = Tag(name=item)
toTest.save()
self.assert_(toTest)

for item in duplicate_data:
toTest = Tag(name=item)
try:
try:
toTest.save()
except IntegrityError, e:
self.assert_(True)
finally:
self.assertEquals(len(unique_data), 
len(Tag.objects.all()))

The test case failes by raising an IntegrityError even though I'm
trapping it and asserting success if this Exception  is thrown. I had
re-written this sequence a few times with the same results.

1) Why can't I trap the IntegrityError in my test case?

2) What is the best practice for writing test cases to validate that
only unique data is being saved to the database?

Bonus question:

1) Does self.failUnlessRaises() work with Python 2.4? Replacing the
bottom section of the test case with self.failUnlessRaises() does not
work on my Ubuntu 6.06 server w/Python 2.4 and the latest Django SVN
release.

Thank you very much in advance for _any_ light you can shed on this.

Mark


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



Re: Does Hostmonster support Django?

2007-11-11 Thread James Bennett

On Nov 11, 2007 7:50 PM, Hannus <[EMAIL PROTECTED]> wrote:
> I am going to buy the host services in host monster,does it support
> Django? If not, plz advice me some other hosting companies.
> Thank you very much

You would need to ask them whether they support it; they're the ones
who would know.


-- 
"Bureaucrat Conrad, you are technically correct -- the best kind of correct."

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



Feeds

2007-11-11 Thread Miguel Galves
Hi,

i'm new to Django, and I'm warming up building a simple job board app.
I'm trying to put a feed system to work using the middleware bundled with
Django.

- url.py:

feeds = {
'ads': AdFeed,
}

urlpatterns = patterns('',
(r'^admin/', include('django.contrib.admin.urls')),
(r'^$', index),
(r'^jobs/$', list),
(r'^jobs/(?P\d*)/$', list),
(r'^view/(?P\d*)/$', view),
(r'^feeds/(.*)$', 'django.contrib.syndication.views.feed', {'feed_dict':
feeds}),
)

- feeds.py file:

class AdFeed(Feed):
title = "Chicagocrime.org  site news"
item_link = "http://job4dev.com;
description = "Updates on changes and additions to chicagocrime.org."

item_author_name='Joe Blow'
item_author_email='[EMAIL PROTECTED]'
item_author_link=' http://www.example.com'

def items(self):
return Vaga.objects.all()[0:100]

I've read the docs and lots of examples, and It seems to me that it's
correct.
But each time I try to acess /feeds/ads, I get an Attribute Error, with
value
"NoneType" object has no attribute startwith.

The error is raised by
python2.4/site-packages/django/contrib/syndication/feeds.py
in get_feed

I just can`t figure out where this None is coming from. Any idea?

thanks,

Miguel


-- 
Miguel Galves - Engenheiro de Computação
Já leu meus blogs hoje?
Para geeks http://log4dev.com
Pra pessoas normais
http://miguelcomenta.wordpress.com

"Não sabendo que era impossível, ele foi lá e fez..."

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



Does Hostmonster support Django?

2007-11-11 Thread Hannus

Hi guys,
I am going to buy the host services in host monster,does it support
Django? If not, plz advice me some other hosting companies.
Thank you very much

Kind regards,
Hannus


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



Re: admin-interface - 500 error - missing MEDIA_URL

2007-11-11 Thread Malcolm Tredinnick


On Sun, 2007-11-11 at 16:51 -0800, sime wrote:
> Now I expect this again is going to be defended religiously; but the
> fact that 500's don't run context processors, to me, serves as a nice
> little reminder that {% media_url %} or similar needs to be a core
> template tag. Where is the sense in bothering with a custom 500 if you
> can't conveniently use css, images, etc?

At the point you need a 500 page, things have completely and utterly
failed. It's called an "internal server error" for a reason. You need to
do the minimum possible and get out of there, because the code's in an
unstable state. Running more code is definitely not what the doctor
ordered there, and that includes running arbitrary template tags.

The point, since you asked, of having a custom 500 page is so that you
can display minimal related information that the user can report so you
can investigate via your logs and other external problem recording
mechanisms. there's no way a one-size-fits-all page could possibly meet
requirements there. The range obviously doesn't go immediately from
"everybody gets the same page" to "you must be able to run all this
complex customisation stuff".

Fortunately, with Django being a fully nicely extensible framework, you
can happily change this if you really want to. Simply override the
handler class to do something different when it receives a 500 error.

Malcolm

-- 
A conclusion is the place where you got tired of thinking. 
http://www.pointy-stick.com/blog/


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



Re: admin-interface - 500 error - missing MEDIA_URL

2007-11-11 Thread sime

Now I expect this again is going to be defended religiously; but the
fact that 500's don't run context processors, to me, serves as a nice
little reminder that {% media_url %} or similar needs to be a core
template tag. Where is the sense in bothering with a custom 500 if you
can't conveniently use css, images, etc?

On Nov 10, 5:40 am, "James Bennett" <[EMAIL PROTECTED]> wrote:
> On Nov 9, 2007 1:29 PM, Brot <[EMAIL PROTECTED]> wrote:
>
> > does this mean, that there is no solution for this problem or is there
> > a smart workaround?
>
> This means there is absolutely nothing in Django which will, in the
> server error view, attempt to run yourcontextprocessors. There is
> not a switch you can flip or a button you can press or an argument you
> can pass or a setting you can change to affect this: Django assumes
> that when things break badly enough to result in a500, it's not safe
> to rely on anything at all being in working condition.
>
> If you want to specify a different handler for 500s, that's up to you,
> but be prepared for the inevitable complete breaking of your site when
> something running inside it raises another exception.
>
> --
> "Bureaucrat Conrad, you are technically correct -- the best kind of correct."


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



Re: Model Validation - Best practices

2007-11-11 Thread [EMAIL PROTECTED]



On Nov 11, 4:51 pm, Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:
> On Sun, 2007-11-11 at 23:30 +, [EMAIL PROTECTED] wrote:
>
> > > At the moment this is work in progress. There is some development going
> > > on to finish upmodel-awarevalidationand complete some earlier work 
> > > onmodelvalidation. At that time, you'll be able to call
> > > my_model.validate() and have things work similarly to how they do with
> > > newforms.
>
> > are their open bugs or a branch where this work is being done?  I
> > would love to help move this work along or contribute in any way
> > possible to completing model validation.  In my project it is the #1
> > missing feature, requiring quite a few violations of DRY.  I have a
> > large backend set of functionality where I want to use my models and
> > define data validation on the model itself not through the forms.
>
> It's not being done on a branch, since it's very self-contained work.
> Jacob Kaplan-Moss is doing it. He and I and a few other people (Simon
> Willison, Jeremy Dunck, maybe Derek Willis was also there) sat down at
> various points during OSCON back in July and did the design work. Adrian
> poked some hole in some small places during the last sprint (Sep 15).
> Jacob now just needs to find some time to finish it (he's been pretty
> busy with Real Life lately, so let's not flame him).
>
> I realise this is frustrating, but I speak from experience when I say
> that sometimes this stuff can't be easily shared around for simultaneous
> development work. Until the back of the work is broken, multiple people
> would just be tripping over each other and I strongly suspect that would
> be the case here. Anyway, search the django-dev archives for a couple of
> recent threads where this came up and you'll see the latest story.
>
> Regards,
> Malcolm
>
> --
> How many of you believe in telekinesis? Raise my 
> hand...http://www.pointy-stick.com/blog/

Wasn't planning to flame anyone, just looking for a status update as I
had heard some rumors about it being worked on, but couldn't find
anything in trak, and the latest thread I could find on dev was from
2006.  I searched a little harder just now and found the short thread
from last month.  Thanks for the info.  I agree and understand needing
to keep things in a very limited sandbox at the beginning.  As soon as
anything is ready to test/break in this regard I'll be here.

-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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Model Validation - Best practices

2007-11-11 Thread Malcolm Tredinnick


On Sun, 2007-11-11 at 23:30 +, [EMAIL PROTECTED] wrote:
> 
> >
> > At the moment this is work in progress. There is some development going
> > on to finish upmodel-awarevalidationand complete some earlier work 
> > onmodelvalidation. At that time, you'll be able to call
> > my_model.validate() and have things work similarly to how they do with
> > newforms.
> 
> are their open bugs or a branch where this work is being done?  I
> would love to help move this work along or contribute in any way
> possible to completing model validation.  In my project it is the #1
> missing feature, requiring quite a few violations of DRY.  I have a
> large backend set of functionality where I want to use my models and
> define data validation on the model itself not through the forms.

It's not being done on a branch, since it's very self-contained work.
Jacob Kaplan-Moss is doing it. He and I and a few other people (Simon
Willison, Jeremy Dunck, maybe Derek Willis was also there) sat down at
various points during OSCON back in July and did the design work. Adrian
poked some hole in some small places during the last sprint (Sep 15).
Jacob now just needs to find some time to finish it (he's been pretty
busy with Real Life lately, so let's not flame him).

I realise this is frustrating, but I speak from experience when I say
that sometimes this stuff can't be easily shared around for simultaneous
development work. Until the back of the work is broken, multiple people
would just be tripping over each other and I strongly suspect that would
be the case here. Anyway, search the django-dev archives for a couple of
recent threads where this came up and you'll see the latest story.

Regards,
Malcolm

-- 
How many of you believe in telekinesis? Raise my hand... 
http://www.pointy-stick.com/blog/


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



Re: Error in the http module in trunk

2007-11-11 Thread Malcolm Tredinnick


On Sun, 2007-11-11 at 20:28 +0100, Antoni Aloy wrote:
> Hi!
> 
> I have filed a ticket
> http://code.djangoproject.com/ticket/5920#preview concerning an error
> in the trunk version of Django.
> 
> It get an function' object has no attribute 'status_code' error
> message in some pages when I run in the django trunk development
> server, but I don't get it in previous versions as in 6473.

Well, r6473 was quite a while ago (we're up to about 6670 at the
moment). How about doing a bisection to work out which revision the
problem starts occurring in? You know 6473 is good and 6661, say, is no
good. So what about r6597 -- halfway in between? Keep splitting by
halves until you've the critical point.

Just reading the bug report, though, I think there's some other problem
going on there. I can't think of any reason why "response" should be a
function in line 209 of django.core.handlers.wsgi and not an
HttpResponse. This will be easier to debug for you and us if you can
come up with a simple case that always fails (your bug report indicates
that you're currently only seeing it sometimes. So try to narrow down
what is required to always trigger the problem).

Regards,
Malcolm

-- 
Plan to be spontaneous - tomorrow. 
http://www.pointy-stick.com/blog/


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



Re: include('myapp....') -> Modified settings

2007-11-11 Thread Malcolm Tredinnick


On Sun, 2007-11-11 at 20:22 +0100, [EMAIL PROTECTED]
wrote:
> Hi,
> 
> the include method used in urls.py is very nice. Nevertheless I
> miss something: It would be nice if you could use some settings,
> which only get used, if the request follows this include.
> 
> It would be good, if you could activate some middleware and alter
> the TEMPLATE_DIR only, if the url starts with e.g. '/myapp/...'.
> 
> This would make django more flexible. The chance that template names
> clash could be reduced very much.
> 
> Maybe this is already possible, and I have not seen it.

This is a lot harder than it sounds to get right. Your settings file
controls a number of things that are imported into your global process
space, for example, so as soon as you allow stuff like this, the
potential (and practical likelihood) of inadvertent collision arises.
We're (well, I'm) doing some design on this for allowing multiple Django
projects to run under a single interpreter, but it is fiddly. I doubt
I'd be particularly interested in extending it to per-app or anything
like that, since it's too error-prone.

It might also be possible one day to have Django's URL configuration
delegate to another WSGI application if a particular pattern is matched,
which would allow you to embed entire other collections of Django
projects that way. However, that's probably a ways off yet (it's a nice
idea and I know somebody who's written a prototype, but I'm not going to
uncloak them here. So it's possible).

Template name collisions can be avoided either by using the
app_name/templates/app/ style of naming if you're using
the app_loader, or possibly better, picking likely-to-be-unique names
initially (such as app-.html) and then only using the
file-based template loader. At this level, it's exactly the same as not
having Python modules with the same name: it would be nice if it was
always possible to avoid collisions and ambiguity, but that's not
possible, so the developer has to take preventative measures, such as
not picking really common names for their templates.

Regards,
Malcolm

-- 
If it walks out of your refrigerator, LET IT GO!! 
http://www.pointy-stick.com/blog/


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



Re: Model Validation - Best practices

2007-11-11 Thread [EMAIL PROTECTED]


>
> At the moment this is work in progress. There is some development going
> on to finish upmodel-awarevalidationand complete some earlier work 
> onmodelvalidation. At that time, you'll be able to call
> my_model.validate() and have things work similarly to how they do with
> newforms.

are their open bugs or a branch where this work is being done?  I
would love to help move this work along or contribute in any way
possible to completing model validation.  In my project it is the #1
missing feature, requiring quite a few violations of DRY.  I have a
large backend set of functionality where I want to use my models and
define data validation on the model itself not through the 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: The Django admin interface optimized for iPhone/iPod touch

2007-11-11 Thread Jannis Leidel

Hi again!

This is only a short reminder that I just released django-mobileadmin
0.2, the Django admin interface optimized for iPhone/iPod touch and
other MobileSafari based devices.

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

It brings the following new features and bugfixes:

  * full filtering and searching (w00t)
  * mostly rewritten: css, javascript
  * faster loading, smaller images
  * nicer buttons
  * larger fonts
  * larger checkboxes and radiobuttons
  * larger tap targets
  * better widescreen capabilities
  * new toolbar and hiding mobilesafari toolbar
  * new paginator
  * easy access to media path with mobileadmin.MOBILEADMIN_MEDIA_PATH

Of course there is a Flickr Set with all features as live screenshots:
http://www.flickr.com/photos/jannis/sets/72157603091545876/

Hope you like it. Please don't hesitate to request features :)

Best,
Jannis



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



Commercial downloadable Django products

2007-11-11 Thread Hugh Bien
Hi all,
Out of curiosity, has anyone made commercial Django products that are
available for download/running on your own server?

I was wondering what you used for source code protection or if you went the
'full source code available' route (like haveamint.com and warehouseapp.com
).

Thanks!
- Hugh

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



Re: Django deployment à lá Capistrano

2007-11-11 Thread Panos Laganakos

I've put up the script I use for deploying our apps, on our internal
work server. It's pretty ugly, but It could be extended/improved
*alot*. It doesn't check about anything _at all_, it just works or
doesn't. :)

http://code.google.com/p/djdeliver

Anyone who feels like contributing, just let me know, so I can add
him.

p.s. Use it at your own risk!

On Sep 27, 2:36 pm, "Jon Atkinson" <[EMAIL PROTECTED]> wrote:
> Is anything happening with this project, or has it died on the vine?
>
> --Jon
>
> On 9/13/07, rex <[EMAIL PROTECTED]> wrote:
>
>
>
> > Hello.
>
> > I'd be interested in helping with writing aCapistranoreplacement for
> > Django in python (not a port!).
> > I'm relatively new to django sites, but quite an old hand at python.
>
> > Regarding names... surely this is the least important part of a
> > project like this  :)
>
> > My 2c though:   dojango! That's what it's doing.. it's doing my django
> > site... so i don't have to stuff around in an ssh session for 100
> > years to get the thing working :) Flame away.
>
> > Alex
>
> > Ps: Chris:  estas en españa? verdad?
>
> > On Sep 10, 3:05 am, qwerty <[EMAIL PROTECTED]> wrote:
> > > Well, I'm interesed in the project and as first idea from the bainstrom is
> > > the name:Capistrano'surl ishttp://www.capify.org/, why can we call it
> > > capipy, the py at the end is a clasic (tm) of projects coded in Python.
>
> > > Another good idea is to review the concept of the tool to draw what it
> > > should and what it should not do:
>
> > > "automating django's deployment tasks" sounds like a good start for me.
>
> > > --
> > > Angel
>
> > > 2007/9/8, Chris Hoeppner <[EMAIL PROTECTED]>:
>
> > > > Hi there,
>
> > > > This is just to make it a bit more obvious. I've decided to make up a
> > > > python application similar toCapistrano, for Django.
>
> > > > I plan it to be similar in the sense of "it uses the same goal, and a
> > > > few same ideas", and it's not going to be a port ofCapistranoto
> > > > Python.
>
> > > > I've called this project Djangostrano, though I'll come up with a better
> > > > name before the folks at 37signals run storms of fury on me :)
>
> > > > If anyone has done some steps in this direction, please let me know, as
> > > > we could join forces. Also, if anyone is *interested* in contributing a
> > > > bit, don't hesitate to contact me.
>
> > > > A few fundamental guidelines lay already, but I'm still in the
> > > > brainstorming stage. This is the right stage for anyone to join me.
>
> > > > I'll be glad to hear from you.
> > > > --
>
> > > > Saludos,
>
> > > > Chris Hoeppner,
> > > > Passionate about on-line interaction
> > > >  627 471 720
> > > >  [EMAIL PROTECTED]
> > > > www.pixware.org
>
> > > > -BEGIN PGP SIGNATURE-
> > > > Version: GnuPG v1.4.6 (GNU/Linux)
>
> > > > iD8DBQBG4uAdSyMaQ2t7ZwcRAt1NAKDMwg2Pt4PNNO3E3WcxGCJ7T82QAgCgx+25
> > > > hUzCBlmfaOU4xpcEIO67b2g=
> > > > =T5O4
> > > > -END PGP SIGNATURE-


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



icon request

2007-11-11 Thread vivacarlie

I would like to use the icon (or possibly a modification) you use for
the favicon on your site. I want to use it for a mac osx gui easy
installer for django [http://code.google.com/p/idjango/] the dj looks
better than the one we have. and i make it more mac like. I would just
like your permission


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



Re: Strange problem with flup response code

2007-11-11 Thread Jarek Zgoda

OK, it turns out, this middleware was removed in Flup 1.0. Will try
this one.

On 9 Lis, 21:12, Jarek Zgoda <[EMAIL PROTECTED]> wrote:
> I'm using Django-0.96.1 deployed on apache/mod_fastcgi and sometimes I
> see strange result of handling HTTP errors by flup 0.5.
> I started investigating the problem when I saw my app *never* returns
> any 404 nor 500 response, but the error log is full of tracebacks. In
> the code I often throw Http404 exception (either directly or as a
> result of get_object_or_404), but the response is always 200 OK. I
> found that the response content is the same as static page supposed to
> be returned by flup's own error middleware but in flup docs I found
> that such page would be returned only when this middleware is in use
> *and* the error/exception is not handled by the application. I cann't
> find any way of turning this "feature" off.
>
> Can anybody give any hint as to how to get rid of this "helper"?
>
> Cheers
> Jarek Zgoda


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



Error in the http module in trunk

2007-11-11 Thread Antoni Aloy

Hi!

I have filed a ticket
http://code.djangoproject.com/ticket/5920#preview concerning an error
in the trunk version of Django.

It get an function' object has no attribute 'status_code' error
message in some pages when I run in the django trunk development
server, but I don't get it in previous versions as in 6473.

Anybody has a similar problem?

-- 
Antoni Aloy López
Binissalem - Mallorca
http://www.trespams.com
Soci de Bulma - http://www.bulma.cat

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



include('myapp....') -> Modified settings

2007-11-11 Thread guettli . google

Hi,

the include method used in urls.py is very nice. Nevertheless I
miss something: It would be nice if you could use some settings,
which only get used, if the request follows this include.

It would be good, if you could activate some middleware and alter
the TEMPLATE_DIR only, if the url starts with e.g. '/myapp/...'.

This would make django more flexible. The chance that template names
clash could be reduced very much.

Maybe this is already possible, and I have not seen it.

 Thomas

-- 
Thomas Guettler, http://www.thomas-guettler.de/
E-Mail: guettli (*) thomas-guettler + de


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



Re: __str__(self) for ManyToManyField

2007-11-11 Thread Xan



On Nov 11, 1:16 am, Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:
> On Sat, 2007-11-10 at 11:26 -0800, Xan wrote:
>
> > On Nov 10, 6:01 am, Malcolm Tredinnick <[EMAIL PROTECTED]>
> > wrote:
> > > On Fri, 2007-11-09 at 08:19 -0800, Xan wrote:
>
> > > > On Nov 9, 2:36 am, Malcolm Tredinnick <[EMAIL PROTECTED]>
> > > > wrote:
> > > > > On Thu, 2007-11-08 at 09:11 -0800, Xan wrote:
> > > > > > Hi,
>
> > > > > > I have these models:
>
> > > > > > class A(models.Model):
>
> > > > > > [...]
> > > > > >def __str__(self):
> > > > > >return "(%s, %s)" % (self.estudi, self.curs)
>
> > > > > >class Admin:
> > > > > >pass
>
> > > > > > and
>
> > > > > > class B(models.Model):
>
> > > > > >estudi_oferit = models.ManyToManyField('A', blank=True, 
> > > > > > null=True)
>
> > > > > >class Admin:
> > > > > >list_display = ('tipus', 'codi', 'nom', 'adreca', 
> > > > > > 'localitat', 'cp',
> > > > > > 'zona_concurs', 'ordre_concurs', 'estudi_oferit')
>
> > > > > > and when I list B elements in admin mode, in puts me address memory 
> > > > > > of
> > > > > > objects instead of displaying field A as I define in __str__
>
> > > > > You have not defined __str__ on B, so this isn't entirely unexpected
> > > > > (although I am not completely sure what you're seeing, but anything is
> > > > > not unexpected here).
>
> > > > > Note that the estudi_oferit field is many-to-many, so it has no
> > > > > "natural" way to be represented as a string. After all, it could be
> > > > > referring to 10,000 objects at the other end. There's no way to 
> > > > > display
> > > > > that naturally.
>
> > > > I'mt not agree with you: there is a natural way for displaying
> > > > "estudi_oferit": list all of estudi_oferit's that has one instance.
>
> > > Since it's a many-to-many relationship, there could be millions of
> > > related objects for a single B instance, so this would be a very poor
> > > default representation.
>
> > Yes, but I mean that it should be that way.
> > We could be restrict the number of objects displaying in admin mode
> > by:
> > list_display = ('tipus', 'codi', 'nom', 'adreca', 'localitat',
> > 'cp', 'zona_concurs', 'ordre_concurs', 'estudi_oferit':30)
>
> > and admin mode only show almost 30 first objects of estudi_oferit?
>
> > It's the natural way for displaying it I think. For the problem of
> > millions of objects we could put a restriction of displaying in list.
> > It could be done?
>
> I've explained why this wouldn't be a good idea (and the documentation
> extends that explanation). You want to impose extra database hits and
> computation on every single Django user just so that you don't have to
> write on extra method. That's not going to happen.
>
> Django provides you with a sensible default and also documents how you
> can change this. You really have the best of both worlds here.

Can you pointing me where is the exact location of this documentation?

I think I will change it

Xan.
>
> Best wishes,
> Malcolm
>
> --
> If it walks out of your refrigerator, LET IT 
> GO!!http://www.pointy-stick.com/blog/


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



Re: django and s3

2007-11-11 Thread Adam Fast
The one thing I'd note is that EC2 is not the most price-effective solution
if you're just getting into Django and wanting to play.  It's a lot of
resources and a fair price for those resources, but with a basic site it's
absolute overkill.  I would recommend Webfaction as a good starter plan.  I
don't want this to become another of the many "what hosting should I use"
threads (see the archives) but it's generally agreed that for a small to
mid-sized site (and especially for a Django beginner) that Webfaction is
hard to beat.



On Nov 11, 2007 8:18 AM, sebey <[EMAIL PROTECTED]> wrote:

>
> ok so I will have a look at EC2 thanks very much for that anything
> else I may encounter  useing amazon elastic computing service
>
> On Nov 11, 1:01 am, "Adam Fast" <[EMAIL PROTECTED]> wrote:
> > Sebastian,
> >
> > S3 is simply a storage service.  There is no way to run scripts (such as
> > django) against it.  If you just want to host the static content of your
> > site (such as images and CSS) you'll find info on that all throughout
> the
> > list's history.  But from how I read your question, you want to upload
> your
> > files to Amazon and let them be your web host - that is not possible.
>  With
> > Amazon's EC2 you can configure it to run Django since it is a Linux
> virtual
> > machine - but not S3.
> >
> > Adam
> >
> > On Nov 10, 2007 5:18 PM, sebastian stephenson <[EMAIL PROTECTED]> wrote:
> >
> >
> >
> > > I am considering using amazon s3 as a web-hosting service and I would
> > > like to know do django or python itself prevent this from happening?
> > > see ya
> >
> > > sebey
>
>
> >
>

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



Re: newforms-admin fieldsets classes question

2007-11-11 Thread Karen Tracey
On 11/11/07, Matthias Urlichs <[EMAIL PROTECTED]> wrote:
>
> IMHo it makes sense to usee a tuple there. I'd go so far as to
> recommend *not* to concatenate that (three lines down...); the
> subsequent test in line 81 will cause false positives otherwise.


? I don't see how false positives will arise on line 81 here:

http://code.djangoproject.com/browser/django/branches/newforms-admin/django/contrib/admin/options.py#L72

as the code is now written?  I'm not planning to open a ticket to change
code in this area (opted for updating the wiki instead), so if there is a
problem it's likely to be forgotten unless you open one.

Karen

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



Re: newforms-admin fieldsets classes question

2007-11-11 Thread Karen Tracey
On 11/11/07, Joseph Kocherhans <[EMAIL PROTECTED]> wrote:
>
>
> On 11/10/07, Karen Tracey <[EMAIL PROTECTED]> wrote:
> > Was it intended to change the type of the 'classes' value in an Admin
> field
> > (now fieldset in newforms-admin) specification from string to tuple?
> 
> >
> Yes, it was intentional, but I don't feel particularly strong about
> the change. I don't think that backwards compatibility is a good
> reason to keep it the same as so many other things are changing
> anyhow. That said, it should be documented on the newforms-admin wiki
> page, and I apologize for not doing so. Would you mind updating the
> wiki or starting a thread on the dev list if you'd like to see the
> change reversed?


I don't feel strongly about it one way or the other.  The quiet nature of
the failure bothers me a little, but as you say, so much else is changing
that people are going to have to be reading the doc to do the migration, so
as long as it is noted there most people won't get tripped up by it.  So
I'll update the wiki page.

Thanks,
Karen

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



Re: django and s3

2007-11-11 Thread sebey

ok so I will have a look at EC2 thanks very much for that anything
else I may encounter  useing amazon elastic computing service

On Nov 11, 1:01 am, "Adam Fast" <[EMAIL PROTECTED]> wrote:
> Sebastian,
>
> S3 is simply a storage service.  There is no way to run scripts (such as
> django) against it.  If you just want to host the static content of your
> site (such as images and CSS) you'll find info on that all throughout the
> list's history.  But from how I read your question, you want to upload your
> files to Amazon and let them be your web host - that is not possible.  With
> Amazon's EC2 you can configure it to run Django since it is a Linux virtual
> machine - but not S3.
>
> Adam
>
> On Nov 10, 2007 5:18 PM, sebastian stephenson <[EMAIL PROTECTED]> wrote:
>
>
>
> > I am considering using amazon s3 as a web-hosting service and I would
> > like to know do django or python itself prevent this from happening?
> > see ya
>
> > sebey


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



Re: Configuring a Django Project for Intranet Deployment

2007-11-11 Thread Stefan Matthias Aust

On Nov 11, 2007 1:44 PM, RichardH <[EMAIL PROTECTED]> wrote:

> From researching posts and blogs, I know this is a difficult issue but
> was wondering whether anyone has come up with simple solutions?

I had a similar problem. My solution was to setup a context processor
which adds a "root" variable to all contexts and then using that
variable as in ... in all templates.

Such a processor is easy to create, for example:

 def add_root_url(request):
   from django.conf import settings
   return dict(root=('' if settings.DEBUG else settings.DEPLOYMENT_ROOT))

You need to add the function name to the settings'
TEMPLATE_CONTEXT_PROCESSORS tuple.

HTH,

-- 
Stefan Matthias Aust

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



Re: Not Required Field

2007-11-11 Thread James Bennett

On 11/11/07, Ronaldo Z. Afonso <[EMAIL PROTECTED]> wrote:
> I'd like to know how I set a field of a Model to be not required when
> someone is inserting data in the model using the admin interface?

The documentation on creating models covers this:

http://www.djangoproject.com/documentation/model-api/

-- 
"Bureaucrat Conrad, you are technically correct -- the best kind of correct."

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



Re: Configuring a Django Project for Intranet Deployment

2007-11-11 Thread Malcolm Tredinnick


On Sun, 2007-11-11 at 04:44 -0800, RichardH wrote:
> The problem: How do you best configure a Django project so that it can
> be deployed in a production Intranet environment where you don't "own"
> the domain root url, i.e. the Django project appears at
> http://www.mydomain.com/some/url/path/to/django/project/name (and it
> could change!)? However, at the same time I want to be able to run the
> development environment at http://127.0.0.1/ and want any maintenance
> overhead e.g. managing two sets of url.py files or changing any urls
> stored in the database (flat files).

Since a database and flat files are two different things, I'm not sure
what you mean about the overhead.

At the moment, there's no brilliantly ideal solution to this problem.
We'll fix it "soon", though. The ideal solution here means you make no
changes whatsoever at the Django level and it will work in both
locaitons. That is, Django will understand the web server root it is
installed under. This is gradually creeping higher on my list, as I
cross off existing items, so either I or somebody else will deal with it
soon.

One workaround for now is to define a variable somewhere that is either
"/path/to/production/install/" for production or "" in development.
Include this variable at the start of each of your root URL patterns.

Since this involves adding something for each pattern if you do it by
hand, you could write simple function to do it for you. You pass the
function the same parameters you would normally put into a tuple in
urlpatterns and it can return the data with the prefix appended.

Regards,
Malcolm

-- 
A clear conscience is usually the sign of a bad memory. 
http://www.pointy-stick.com/blog/


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



Not Required Field

2007-11-11 Thread Ronaldo Z. Afonso

Hi all,

I'd like to know how I set a field of a Model to be not required when 
someone is inserting data in the model using the admin interface?
Thanks.

Ronaldo.

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



Re: User Authentication and Models

2007-11-11 Thread Darryl Ross
Patrick Ohearn wrote:
> I have tried adding the following lines to by models.py.
> 
> author = models.ForeignKey(User)
> author = models.ForeignKey(django.contrib.auth.models.User)
> 
> Both to no avail, thank you for your help so far :)

Perhaps a more complete example might help you:

{{{
from django.contrib.auth.models import User
from django.db import models

class Article(models.Model):
author = models.ForeignKey(User)
}}}

Note that you need to import the User model at the top of the file.

Regards
Darryl



signature.asc
Description: OpenPGP digital signature


Configuring a Django Project for Intranet Deployment

2007-11-11 Thread RichardH

The problem: How do you best configure a Django project so that it can
be deployed in a production Intranet environment where you don't "own"
the domain root url, i.e. the Django project appears at
http://www.mydomain.com/some/url/path/to/django/project/name (and it
could change!)? However, at the same time I want to be able to run the
development environment at http://127.0.0.1/ and want any maintenance
overhead e.g. managing two sets of url.py files or changing any urls
stored in the database (flat files).

>From researching posts and blogs, I know this is a difficult issue but
was wondering whether anyone has come up with simple solutions?

Richard


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



Re: Unsubscribing from this group... impossible?

2007-11-11 Thread Nils-Hero Lindemann


Hey Guys, i can't unsubscribe too.

Nils

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



Can I customize RelatedManagers?

2007-11-11 Thread Stefan Matthias Aust

Hi,

I wonder whether there's a way to achieve the following: Let's assume
I've two models User and Fav with a 1-to-many relation. Favs have a
rating.

Now, I'm interested in a User's highest rated Fav. I could create a
custom function or User instance method to call
"user.favs.filter(..).order_by(...)[0]", but can I also create a
function in such a way that the call will look like
"user.favs.best()"?

For models, I can overwrite the Manager and create custom methods. Can
I also customize the RelatedManager "user.favs"?

Thanks,


PS: I looked into the source and guessing from that rather complex
meta-programming code, I'm afraid, it cannot be done.  The
RelatedManager of a ForeignRelatedObjectsDescriptor is based on the
related object's default manager. A way to extend this might be this:

 class Fav(models.Model):
user = models.ForeignKey(User, related_name='favs')
class user_favs_mixin:
   def best(self): ...

The ForeignRelatedObjectsDescriptor would the look for the innerclass
and add it to the list of superclases of its dynamic RelatedManager
class definition. But it might be too much magic...

-- 
Stefan Matthias Aust

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



Re: User Authentication and Models

2007-11-11 Thread Patrick Ohearn

On Sun, 2007-11-11 at 04:05 -0600, James Bennett wrote:
> On Nov 11, 2007 3:57 AM, Patrick Ohearn <[EMAIL PROTECTED]> wrote:
> > I have tried adding the following lines to by models.py.
> >
> > author = models.ForeignKey(User)
> > author = models.ForeignKey(django.contrib.auth.models.User)
> >
> > Both to no avail, thank you for your help so far :)
> 
> 
> In order to use a class, function or any other piece of data defined
> in a different Python file, you must use Python's import mechanism.
> Perhaps you should pause and read a good Python tutorial before
> proceeding, as it will help you to understand what's going on when you
> use Django.
> 
> 
Thank you, I know the basics of python and should have picked up on
this, its just been a long day :)
-- 
Email: [EMAIL PROTECTED]
Jabber: [EMAIL PROTECTED]
Site: http://ge3k.net
PGP Key: 66A612C6


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



Re: User Authentication and Models

2007-11-11 Thread James Bennett

On Nov 11, 2007 3:57 AM, Patrick Ohearn <[EMAIL PROTECTED]> wrote:
> I have tried adding the following lines to by models.py.
>
> author = models.ForeignKey(User)
> author = models.ForeignKey(django.contrib.auth.models.User)
>
> Both to no avail, thank you for your help so far :)


In order to use a class, function or any other piece of data defined
in a different Python file, you must use Python's import mechanism.
Perhaps you should pause and read a good Python tutorial before
proceeding, as it will help you to understand what's going on when you
use Django.


-- 
"Bureaucrat Conrad, you are technically correct -- the best kind of correct."

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



Re: User Authentication and Models

2007-11-11 Thread Malcolm Tredinnick


On Sun, 2007-11-11 at 19:57 +1000, Patrick Ohearn wrote:
> On Sun, 2007-11-11 at 20:39 +1100, Malcolm Tredinnick wrote:
> > 
> > On Sun, 2007-11-11 at 01:30 -0800, Patrick Ohearn wrote:
> > > I am writing a simple blog application with Django 0.96. I intend to
> > > use
> > > the built in Admin page to manage my blog, so I wish to use Django's
> > > User Authentication system. In my Blog model I need to make a
> > > relationship for my 'user' field to the auth_user table, but I can not
> > > find the model name to link it to.
> > 
> > django.contrib.auth.models.User
> > 
> > You're creating a link to the User model.
> > 
> > Regards,
> > Malcolm
> > 
> I have tried adding the following lines to by models.py.
> 
> author = models.ForeignKey(User)
> author = models.ForeignKey(django.contrib.auth.models.User)
> 
> Both to no avail, thank you for your help so far :)

Where "no avail" means you got an error because you forgot to import the
remote code, or nothing happened at all, or you got some other Django
error (or Python error), or your machine caught on fire, or ...?

With more clues come more answers.

Malcolm

-- 
Experience is something you don't get until just after you need it. 
http://www.pointy-stick.com/blog/


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



Re: User Authentication and Models

2007-11-11 Thread Patrick Ohearn

On Sun, 2007-11-11 at 20:39 +1100, Malcolm Tredinnick wrote:
> 
> On Sun, 2007-11-11 at 01:30 -0800, Patrick Ohearn wrote:
> > I am writing a simple blog application with Django 0.96. I intend to
> > use
> > the built in Admin page to manage my blog, so I wish to use Django's
> > User Authentication system. In my Blog model I need to make a
> > relationship for my 'user' field to the auth_user table, but I can not
> > find the model name to link it to.
> 
> django.contrib.auth.models.User
> 
> You're creating a link to the User model.
> 
> Regards,
> Malcolm
> 
I have tried adding the following lines to by models.py.

author = models.ForeignKey(User)
author = models.ForeignKey(django.contrib.auth.models.User)

Both to no avail, thank you for your help so far :)
-- 
Email: [EMAIL PROTECTED]
Jabber: [EMAIL PROTECTED]
Site: http://ge3k.net
PGP Key: 66A612C6
-- 
Email: [EMAIL PROTECTED]
Jabber: [EMAIL PROTECTED]
Site: http://ge3k.net
PGP Key: 66A612C6


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



Re: User Authentication and Models

2007-11-11 Thread Malcolm Tredinnick


On Sun, 2007-11-11 at 01:30 -0800, Patrick Ohearn wrote:
> I am writing a simple blog application with Django 0.96. I intend to
> use
> the built in Admin page to manage my blog, so I wish to use Django's
> User Authentication system. In my Blog model I need to make a
> relationship for my 'user' field to the auth_user table, but I can not
> find the model name to link it to.

django.contrib.auth.models.User

You're creating a link to the User model.

Regards,
Malcolm

-- 
Plan to be spontaneous - tomorrow. 
http://www.pointy-stick.com/blog/


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



App for rendering and far future caching of css and js files

2007-11-11 Thread Itai Tavor

Hi all,

I made one of them apps, like the subject says...

 From the README (which is as well as I can explain it, if I could  
say it better I'd edit the README, right?):

The app provides two main functions:

1. Render and serve css files based on django templates.

 To aid in generating css code, the context of templates rendered  
by this app includes urls for accessing site media, as well as  
developer-specified custom variables.

 Css content is served with caching tags instructing browsers to  
cache the files for one year, needed to make the link tags generated  
by the app effective (see below).

2. Render  and 

User Authentication and Models

2007-11-11 Thread Patrick Ohearn

I am writing a simple blog application with Django 0.96. I intend to
use
the built in Admin page to manage my blog, so I wish to use Django's
User Authentication system. In my Blog model I need to make a
relationship for my 'user' field to the auth_user table, but I can not
find the model name to link it to.

I have read the authentication documentation to no avail, can someone
please point me in the right direction.
--
Email: [EMAIL PROTECTED]
Jabber: [EMAIL PROTECTED]
Site: http://ge3k.net
PGP Key: 66A612C6


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



Re: newforms-admin fieldsets classes question

2007-11-11 Thread Matthias Urlichs

IMHo it makes sense to usee a tuple there. I'd go so far as to
recommend *not* to concatenate that (three lines down...); the
subsequent test in line 81 will cause false positives otherwise.


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