Note that there are some explanatory texts on larger screens.

plurals
  1. POError when deploying django app
    primarykey
    data
    text
    <p>I built an app using Django 1.3 and am now attempting to deploy to ubuntu 10.10 on linode using postgresql. I am using nginx on the front end and for static media and sending app requests to the app served with apache/mod_wsgi. Everything works fine on my local dev machine which is also Ubuntu 10.10 and I can install the app on my web server however when I try to access the home page I get the following error: 'str' object has no attribute '_default_manager'</p> <p>According to the error messages it appears that it is having trouble with a modelform where I subclassed a field, changing it from a FK field to a URLField and performing the validation manually. This is the form that throwing the error:</p> <pre><code>class TopicResourceForm(ModelForm): resource = URLField(label='Resource URL') class Meta: model = TopicResource fields = ('title', 'rtype', 'note') </code></pre> <p>And these are the models.</p> <pre><code>class TopicResource(models.Model): added = models.DateTimeField(auto_now_add=True) updated = models.DateTimeField(auto_now=True) title = models.CharField(max_length=140, blank=True) note = models.TextField(blank=True) resource = models.ForeignKey('aresource.Resource') rtype = models.ForeignKey('aresource.ResourceType', verbose_name="Resource Type", blank=True, null=True) topic = models.ForeignKey('mystudy.Topic') def __unicode__(self): return '%s on %s' % (self.resource, self.topic) def get_absolute_url(self): return '/topics/%s/%s/%s' % (self.topic.slug, self.resource.id, self.id) class Resource(models.Model): added = models.DateTimeField(auto_now_add=True) updated = models.DateTimeField(auto_now=True) url = models.URLField(unique=True) rtype = models.ForeignKey(ResourceType, verbose_name="Resource Type", blank=True, null=True) def __unicode__(self): return '%s' % self.url def get_absolute_url(self): return '/resources/%s' % self.id </code></pre> <p>Any help would be appreciated, thanks.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload