User Profile

Collapse

Profile Sidebar

Collapse
imhomer
imhomer
Last Activity: Apr 11 '12, 10:58 PM
Joined: Feb 29 '12
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • imhomer
    started a topic Django: 404 page not found

    Django: 404 page not found

    I met "404" page not found when I try to enter 127.0.0.1:8000/cn/bedroom . It says on the webpage that "C:/Django/final/media/bedroom" does not exist". Why would this happen?

    urls.py:
    Code:
    from django.conf.urls.defaults import *
    from final import settings
    
    from django.contrib import admin
    
    admin.autodiscover()
    
    urlpatterns = patterns('',
    ...
    See more | Go to post

  • imhomer
    started a topic Django base.py: 'str' object is not callable

    Django base.py: 'str' object is not callable

    I met this problem (Django base.py: 'str' object is not callable) when I go through a Django tutorial:

    photo/models.py:
    Code:
    from django.db import models
    from django.contrib.auth.models import User
    from django.contrib import admin
    
    class Album(models.Model):
        title = models.CharField(max_length=60)
        public = models.BooleanField(default=False)
        def __unicode__(self):
    ...
    See more | Go to post

  • imhomer
    started a topic Django: Why cannot I use the custom file field?

    Django: Why cannot I use the custom file field?

    I have been tortured by this problem for a whole week. I really hope a superman can help me solve it. I tried to create a new file field called "ThumbnailImage Field". The following is my model.py:

    Code:
    from django.db import models
    from django.contrib import admin
    from cn.han import ThumbnailImageField
    from django.db.models.fields.files import ImageField, ImageFieldFile
    # Create your models here.
    ...
    See more | Go to post

  • Okay. Thanks for your help but my code still contains other error.. As a beginner I am very sad
    See more | Go to post

    Leave a comment:


  • I figure it out by myself... Just store it in my application file, then I can import it by using "from ProjectName.App Name import FileName"
    See more | Go to post

    Leave a comment:


  • Oh.. It is a stupid error.. Thanks for your help. By the way, I tried to runserver again, and a name error happened in line 26, which says "ThumbnailImage FieldFile is not defined". Could you please help me again?
    See more | Go to post

    Leave a comment:


  • imhomer
    started a topic Django: Indentation Error: Unexpected indent

    Django: Indentation Error: Unexpected indent

    The tutorial taught me to build a new file field. However, when I run the server, Indentation Error happened on line 37:

    Code:
    from django.db.models.fields.files import ImageField, ImageFieldFile
    from PIL import Image
    import os
    
    def _add_thumb(s):
        """
        Modifies a string (filename, URL) containing an image filename, to insert
        '.thumb' before the file extension (which
    ...
    See more | Go to post

  • Where should I store the code when I build "custom file field"?

    I am going through a tutorial book titled "Python Web Development with Django". This tutorial taught me how to create my custom file field, but it did not indicate where should I store the code. Could you please help me?
    See more | Go to post

  • I changed the settings of region in control panel and it worked. Thanks all the same!
    See more | Go to post

    Leave a comment:


  • Django error: django.db.utils.DatabaseError: You mustnot use 8-bit bytesrings

    When I run "python manage.py syncdb" and after I input that I want to create a superuser, cmd told me the error below:

    django.db.utils .DatabaseError: You mustnot use 8-bit bytesrings unless you use a text_factory that can interpret 8-bit bytestings (like text_factory = str). It is highly recommend that you instead just switch your application to Unicode strings.

    Could you help me solve the problem? Thanks!
    See more | Go to post

  • unsupported operand type(s) for +: 'instance' and 'int'

    Hi:
    I tried to make two buttons that when I click it, the text in the label will increase or decrease. But python told me that "unsupporte d operand type(s) for +: 'instance' and 'int'" on "labeltext1.set (labeltext1 + 1)" and "labeltext1.set (labeltext1 - 1)". Could you help me solve it? Thanks very much!!

    Code:
    def Increase(labeltext1):
        for a in range (0, 100): 
            labeltext1.set(labeltext1
    ...
    See more | Go to post
No activity results to display
Show More
Working...