eachone
eachone

Reputation: 577

Tell me the way to use Django's models.FileField

I'm using models.FileField like this below.

enter image description here

It's a fantastic django function. Because, it makes user can upload within Django administration page without any code.

enter image description here

So, I clicked Part image url Link. But, I got a error message below.

enter image description here

my urls pattern is below.

urls.py

urlpatterns = [
    url(r'^parts/', include('parts.urls', namespace='parts')),
    url(r'^admin/', include(admin.site.urls)),
    url(r'^$', views.MW_Hello.as_view(), name='Hello'),
]

Do I have to add url mapping in url patterns?

Upvotes: 0

Views: 131

Answers (1)

Y.N
Y.N

Reputation: 5257

You need to configure your urls and settings for managing the static files

https://docs.djangoproject.com/en/1.8/howto/static-files/

https://docs.djangoproject.com/en/1.8/topics/files/

Upvotes: 2

Related Questions