Re: VERY cheap django hosting?

2011-06-09 Thread Aaron Madison
I put all my projects on Google AppEngine ...
works pretty well with
django-nonrel
although sometimes there are some fairly significant concessions you might
have to live with to go this route. AppEngine is free if you stay under the
generous quotas, or a nominal charge if you go over.

On Thu, Jun 9, 2011 at 9:48 AM, Cal Leeming [Simplicity Media Ltd] <
cal.leem...@simplicitymedialtd.co.uk> wrote:

> Just as a side note guys, I know there are tons of PHP hosting providers
> out there which offer dirt cheap hosting, but Python hosting is *extremely*
> different to PHP. A lot of providers simply don't have any concept of how to
> properly manage a webapp deployment in production.
>
> I'd really question why you'd want a cheap host in the first place. If it's
> for development/learning, then a VPS is a great choice. However, if this is
> for a production site, then this might not be the best idea.
>
> My apologies if I've duplicated what's already been said (I haven't seen
> all the replies yet).
>
> Cal
>
>
>
>
> On Thu, Jun 9, 2011 at 5:50 AM, raj  wrote:
>
>> Actually, I might reconsider,
>> What do you guys think of hostgator? They also have django hosting
>> with fastcgi, And there's is shared hosting. Pros, cons?
>> Thanks
>> -Raj
>> On Jun 9, 12:27 am, raj  wrote:
>> > Ya, i think as a first timer, I'm gunna go with something that is non-
>> > vps. I'll learn about preconfiguring stuff when the time comes. I
>> > think djangohosting.ch looks the best. But asmallorange and alwaysdata
>> > also look appealing. Thanks all.
>> >
>> > On Jun 8, 8:58 pm, ApogeeGMail  wrote:
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> > > +1 for webfaction
>> > > On Jun 8, 2011, at 8:29 PM, Bobby Roberts wrote:
>> >
>> > > > i've been using webfaction.com for a while for $9/mo with one click
>> > > > django installs.  You can also checkoutwww.slicehost.comifyou want
>> > > > your own vps and more control.
>> >
>> > > > --
>> > > > 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 athttp://
>> groups.google.com/group/django-users?hl=en.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+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: Cascade delete not entirely correct in 1.3?

2011-04-06 Thread Aaron Madison
oh. got it... thanks!

On Wed, Apr 6, 2011 at 2:46 PM, Jacob Kaplan-Moss wrote:

> On Wed, Apr 6, 2011 at 2:41 PM, Aaron Madison 
> wrote:
> > I'm not sure if attaching files straight through email will work or
> not...
>
> I meant on the ticket. django-users is so high traffic that it's
> likely that developers could miss stuff posted here, so giving all the
> information needed on the ticket is useful. I took the liberty of
> posting your traceback there; thanks!
>
> Jacob
>
> --
> 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: Cascade delete not entirely correct in 1.3?

2011-04-06 Thread Aaron Madison
and the model setup:

class Policy(models.Model):
policy_number = models.CharField(max_length=10)

class Version(models.Model):
policy = models.ForeignKey(Policy)

class Location(models.Model):
version = models.ForeignKey(Version, blank=True, null=True)

class Item(models.Model):
version = models.ForeignKey(Version)
location = models.ForeignKey(Location, blank=True, null=True)

class ItemRateCode(models.Model):
item = models.ForeignKey(Item)

class PropertyItem(models.Model):
item_rate_code = models.ForeignKey(ItemRateCode)

class Coverage(models.Model):
version = models.ForeignKey(Version)
item_rate_code = models.ForeignKey(ItemRateCode)


And to see it fail:
*tests.py*

from django.test import TestCase

from myapp.models import Policy, Version, Location, Item
from myapp.models import ItemRateCode, PropertyItem, Coverage

class DeletePolicyTests(TestCase):

def setup_models(self):

policy = Policy.objects.create(pk=1, policy_number="1234")
version = Version.objects.create(policy=policy)
location = Location.objects.create(version=version)

item1 = Item.objects.create(version=version, location=location)
item2 = Item.objects.create(version=version, location=location)

# one for each item
item_rate_code1 = ItemRateCode.objects.create(item=item1)
item_rate_code2 = ItemRateCode.objects.create(item=item2)

# one for each item_rate_code
Coverage.objects.create(version=version,
item_rate_code=item_rate_code1)
Coverage.objects.create(version=version,
item_rate_code=item_rate_code2)

# one for each item_rate_code
PropertyItem.objects.create(item_rate_code=item_rate_code1)
PropertyItem.objects.create(item_rate_code=item_rate_code2)

def test_deletes_policy_successfully(self):
self.setup_models()
policy = Policy.objects.get(pk=1)
self.assertEqual(None, policy.delete())
self.assertEqual(0, len(Policy.objects.all()))

On Wed, Apr 6, 2011 at 2:41 PM, Aaron Madison wrote:

> I'm not sure if attaching files straight through email will work or not...
> but I'll give it a go. The attached zip file is a sample project that
> re-creates the situation.
> The output is as follows:
>
> (delete_bug)amadison@dev-aaron:~/projects/delete_bug/project$ ./manage.py
> test myapp
> Creating test database for alias 'default'...
> E
> ==
> ERROR: test_deletes_policy_successfully (myapp.tests.DeletePolicyTests)
> --
> Traceback (most recent call last):
>   File "/home/amadison/projects/delete_bug/project/myapp/tests.py", line
> 34, in test_deletes_policy_successfully
> self.assertEqual(None, policy.delete())
>   File
> "/home/amadison/projects/delete_bug/lib/python2.6/site-packages/django/db/models/base.py",
> line 581, in delete
> collector.delete()
>   File
> "/home/amadison/projects/delete_bug/lib/python2.6/site-packages/django/db/models/deletion.py",
> line 63, in decorated
> func(self, *args, **kwargs)
>   File
> "/home/amadison/projects/delete_bug/lib/python2.6/site-packages/django/db/models/deletion.py",
> line 254, in delete
> query.delete_batch(pk_list, self.using)
>   File
> "/home/amadison/projects/delete_bug/lib/python2.6/site-packages/django/db/models/sql/subqueries.py",
> line 44, in delete_batch
> self.do_query(self.model._meta.db_table, where, using=using)
>   File
> "/home/amadison/projects/delete_bug/lib/python2.6/site-packages/django/db/models/sql/subqueries.py",
> line 29, in do_query
> self.get_compiler(using).execute_sql(None)
>   File
> "/home/amadison/projects/delete_bug/lib/python2.6/site-packages/django/db/models/sql/compiler.py",
> line 735, in execute_sql
> cursor.execute(sql, params)
>   File
> "/home/amadison/projects/delete_bug/lib/python2.6/site-packages/django/db/backends/mysql/base.py",
> line 86, in execute
> return self.cursor.execute(query, args)
>   File
> "/home/amadison/projects/delete_bug/lib/python2.6/site-packages/MySQLdb/cursors.py",
> line 174, in execute
> self.errorhandler(self, exc, value)
>   File
> "/home/amadison/projects/delete_bug/lib/python2.6/site-packages/MySQLdb/connections.py",
> line 36, in defaulterrorhandler
> raise errorclass, errorvalue
> IntegrityError: (1451, 'Cannot delete or update a parent row: a foreign key
> constraint fails (`test_delete_test`.`myapp_item`, CONSTRAINT
> `version_id_refs_id_15106961` FOREIGN KEY (`version_id`) REFERENCES
> `myapp_version` (`id`))')
>
> -

Re: Where to put custom classes

2011-04-06 Thread Aaron Madison
that seems like the way i'd do it

On Wed, Apr 6, 2011 at 12:13 PM, Mazery Smith  wrote:

> Hello,
> I have a project with a few application folders in it. One of those
> applications houses all the views for the website. I've built some
> utility classes placed in an entirely different application folder
> (utility_app helper module) that assist in processing requests in each
> view. Is this the best place for such a utility class -- meaning
> housing it in another applicaiton all together and importing it (from
> utility_app.helpers import *) in my views?
>
> Maybe there's a more logical place for it.
>
> I realize this question is subjective seems ridiculous but hey...I'm
> new and I'm ridiculous.
>
> Just want to see what others do
>
>
> --
> 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.