pinax-blog icon indicating copy to clipboard operation
pinax-blog copied to clipboard

Wrong URL for images (via pinax-images)

Open sumpfralle opened this issue 5 years ago • 2 comments

I am using pinax-blog (7.0.4) and pinax-images (3.0.1).

After creating a blog post and uploading an image to the image-set (attached to that blog post), the image does not show up.

The cause seems to be a wrong image URL: https://example.org/blog/2019/03/11/blog-post-slug/pinax-images/image-set-1/4f0917bd-3392-41e8-9100-a44d9bc75c92.png

The list of blog-related configured URLs is the following (announced as part of an 404 in development mode):

blog/ ^$ [name='blog']
blog/ ^section/(?P<section>[-\w]+)/$ [name='blog_section']
blog/ ^post/(?P<post_pk>\d+)/$ [name='blog_post_pk']
blog/ ^post/(?P<post_secret_key>\w+)/$ [name='blog_post_secret']
blog/ ^feed/(?P<section>[-\w]+)/(?P<feed_type>[-\w]+)/$ [name='blog_feed']
blog/ ^manage/posts/$ [name='manage_post_list']
blog/ ^manage/posts/create/$ [name='manage_post_create']
blog/ ^manage/posts/(?P<post_pk>\d+)/update/$ [name='manage_post_update']
blog/ ^manage/posts/(?P<post_pk>\d+)/delete/$ [name='manage_post_delete']
blog/ ^ajax/markdown/preview/$ [name='ajax_preview']
blog/ ^(?P<year>\d{4})/(?P<month>\d{2})/(?P<day>\d{2})/(?P<slug>[-\w]+)/$ [name='blog_post']
ajax/images/ 

Only the second to last line matches the date/slug path prefix. But it does not match the full image path.

Thus I cannot understand, how the above image URL is supposed to work.

Maybe I am missing some configuration setting? (none are specified)

Thank you!

sumpfralle avatar Mar 12 '19 04:03 sumpfralle

The following nginx snippet works around this issue (in a dirty way):

    location ~ /pinax-images/image-set-(.*)$ {
        alias /home/foo/project/pinax-images/image-set-$1;
    }

sumpfralle avatar Mar 12 '19 04:03 sumpfralle

Any way we can get some insight from pinax team on how this is supposed to work?

tdxdave avatar Nov 25 '19 02:11 tdxdave