I am newbie of django user.I trying to learn django webframework. because of that I meet interesting error and I couldn't solve it. I want save image to sqlite.When I upload an image it's working but when I try to display the picture I meet an error. I tried other answers but its didn't work.I am waiting your help.Thank you
error
Request Method: GET
Request URL: http://127.0.0.1:8000/admin/info/airimage/1/media/Ataturk_Havalimani_2.jpg/
airimage object with primary key u'1/media/Ataturk_Havalimani_2.jpg' does not exist.
You're seeing this error because you have DEBUG = True in your Django settings file. Change that to False, and Django will display a standard 404 page.
my settings.py
import os
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
SECRET_KEY = 'amln51jyuo*wj2@g6k3vdd^@2)&84i#1@n2xvgx7hh#bpf7(l!'
DEBUG = True
TEMPLATE_DEBUG = True
ALLOWED_HOSTS = [] .......
urls.py
from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'tav.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^admin/', include(admin.site.urls)),
)
and my content of folder
>tav
>info
__init__.py
admin.py
models.py
tests.py
views.py
>media
>tav
__init__.py
settings.py
urls.py
wsgi.py
db.sqlite3
manage.py
model for airimage
class airimage(models.Model):
stuff_image = models.FileField(upload_to="media/")
airno=models.ForeignKey(airandoto)
def __unicode__(Self):
return self.airno
class Meta:
verbose_name_plural="AirImage"