In order to set/update media url in sitecore 7.x apart from setting mediapath attribute for the image field MediaID has to be set.
At first for your model you should create an image field and in there you should define where you want to upload your image: class mymodel(models.Model): name = models.CharField(max_length=50) my_image = models.ImageField(blank=True, null=True,upload_to='/home/user/webapps/project/uploads/') After that in your template when you want to show your image after getting your model object...
python,django,debugging,media,media-url
This is by design: https://docs.djangoproject.com/en/1.7/howto/static-files/#serving-static-files-during-development If you use django.contrib.staticfiles as explained above, runserver will do this automatically when DEBUG is set to True. That being said, you can use the following workaround by modifying your urls.py: from django.conf import settings from django.conf.urls.static import static urlpatterns = patterns('', # ... the...
python,django,database,hyperlink,media-url
Finally i got the problem! The problem was in the filebrowser module. In filebrowser/functions.py there is a method named url_join that was defined like: def url_join(*args): """ URL join routine. """ if args[0].startswith("http://"): url = "http://" else: url = "/" for arg in args: arg = arg.replace("\\", "/") arg_split =...
django,django-class-based-views,media-url
Django 1.8 moved the configuration of TEMPLATE_CONTEXT_PROCESSORS to the TEMPLATES setting. Beyond that I don't think you shouldn't need to access MEDIA_URL in the template. It's a bad code smell to me. You should be using the url generated from the file storage api (i.e. {{ model.field.url }}).