Advertisement
Guest User

Untitled

a guest
Apr 24th, 2014
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. Page not found (404)
  2. Request URL: http://0.0.0.0:6666/the_image.jpg
  3.  
  4. class Image(models.Model):
  5. product_image = models.ForeignKey(Product)
  6. image = models.ImageField(upload_to='/')
  7.  
  8. MEDIA_ROOT = '/'
  9. MEDIA_URL = '/'
  10.  
  11. class InlineImage(admin.TabularInline):
  12. model = Image
  13.  
  14. class ProductAdmin(admin.ModelAdmin):
  15. inlines = [InlineImage]
  16.  
  17. MEDIA_ROOT = /var/www/example.com/media/
  18. MEDIA_URL = /media
  19.  
  20. image = models.ImageField(upload_to='image')
  21.  
  22. from django.conf import settings
  23. from django.conf.urls.static import static
  24.  
  25. urlpatterns = patterns('',
  26. # ... the rest of your URLconf goes here ...
  27. ) + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement