Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 586187
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T15:04:52+00:00 2026-05-13T15:04:52+00:00

I have an articles entry model and I have an excerpt and description field.

  • 0

I have an articles entry model and I have an excerpt and description field. If a user wants to post an image then I have a separate ImageField which has the default standard file browser.

I’ve tried using django-filebrowser but I don’t like the fact that it requires django-grappelli nor do I necessarily want a flash upload utility – can anyone recommend a tool where I can manage image uploads, and basically replace the file browse provided by django with an imagepicking browser?

In the future I’d probably want it to handle image resizing and specify default image sizes for certain article types.

Edit: I’m trying out adminfiles now but I’m having issues installing it. I grabbed it and added it to my python path, added it to INSTALLED_APPS, created the databases for it, uploaded an image. I followed the instructions to modify my Model to specify adminfiles_fields and registered but it’s not applying in my admin, here’s my admin.py for articles:

from django.contrib import admin
from django import forms
from articles.models import Category, Entry
from tinymce.widgets import TinyMCE
from adminfiles.admin import FilePickerAdmin

class EntryForm( forms.ModelForm ):

    class Media:
    js = ['/media/tinymce/tiny_mce.js', '/media/tinymce/load.js']#, '/media/admin/filebrowser/js/TinyMCEAdmin.js']

    class Meta:
        model = Entry

class CategoryAdmin(admin.ModelAdmin):
    prepopulated_fields = { 'slug': ['title'] }


class EntryAdmin( FilePickerAdmin ):
    adminfiles_fields = ('excerpt',)
    prepopulated_fields = { 'slug': ['title'] }
    form = EntryForm

admin.site.register( Category, CategoryAdmin )
admin.site.register( Entry, EntryAdmin )

Here’s my Entry model:

class Entry( models.Model ):
    LIVE_STATUS = 1
    DRAFT_STATUS = 2
    HIDDEN_STATUS = 3
    STATUS_CHOICES = (
    ( LIVE_STATUS, 'Live' ),
    ( DRAFT_STATUS, 'Draft' ),
    ( HIDDEN_STATUS, 'Hidden' ),
    )
    status = models.IntegerField( choices=STATUS_CHOICES, default=LIVE_STATUS )
    tags = TagField()
    categories = models.ManyToManyField( Category )
    title = models.CharField( max_length=250 )
    excerpt = models.TextField( blank=True )
    excerpt_html = models.TextField(editable=False, blank=True)
    body_html = models.TextField( editable=False, blank=True )
    article_image = models.ImageField(blank=True, upload_to='upload')
    body = models.TextField()
    enable_comments = models.BooleanField(default=True)
    pub_date = models.DateTimeField(default=datetime.datetime.now)
    slug = models.SlugField(unique_for_date='pub_date')
    author = models.ForeignKey(User)
    featured = models.BooleanField(default=False)

    def save( self, force_insert=False, force_update= False):
    self.body_html = markdown(self.body)
    if self.excerpt:
        self.excerpt_html = markdown( self.excerpt )
    super( Entry, self ).save( force_insert, force_update )

    class Meta:
    ordering = ['-pub_date']
    verbose_name_plural = "Entries"

    def __unicode__(self):
    return self.title

Edit #2: To clarify I did move the media files to my media path and they are indeed rendering the image area, I can upload fine, the <<<image>>> tag is inserted into my editable MarkItUp w/ Markdown area but it isn’t rendering in the MarkItUp preview – perhaps I just need to apply the |upload_tags into that preview. I’ll try adding it to my template which posts the article as well.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T15:04:52+00:00Added an answer on May 13, 2026 at 3:04 pm

    Try django-adminfiles – it’s awesome. You can upload images or choose existing ones, and insert them anywhere within the text, where they will be displayed as <<<placeholders>>>. You fully control how the placeholders are resolved on the actual site, using special templates – allowing you to control how images are displayed on the site (that includes scaling, using for example sorl.thumbnail template tag).

    The app can easily support inserting files of other types – you just create a templates for a given file type, showing how it should be presented on your website. It even supports inserting from Flicker and YouTube.

    As you can see I’m still really stoked about finding it 🙂

    It will look something like this in your admin panel (although the screenshot is from a really old version):

    django-adminfiles http://lincolnloop.com/legacy/media/img/django-admin-uploads.png

    Update: You have full control over when and how images are displayed. Some examples:

    1. For the main article page I want the default image display style, so that’s what I write in my template (this will render the images according to rules I defined in my default adminfiles/render/image/default.html template):

      {{ article.content|render_uploads }}

    2. But let’s say in my e-mail newsletter I don’t want to embed the image – I just want to link to it. I will write this in the template (this will render the images according to rules I defined in my adminfiles/render_as_link/default.html template):

      {{ post.content|render_uploads:"adminfiles/render_as_link" }}

    3. I don’t want to have image embed code (or any other HTML for that matter) in my search index, so in my django-haystack template I just do this to remove all HTML:

      {{ article.content|render_uploads|striptags }}

    4. Or I can do this to index images’ captions (but not images themselves; again, this assumes you’ve got adminfiles/only_caption/default.html template with the right code in place):

      {{ article.content|render_uploads:"adminfiles/only_caption" }}

    5. Ok, but what if I want to preserve all other HTML formatting, but don’t want to display the images? I’ll create an empty adminfiles/blank/default.html file and to this:

      {{ article.content|render_uploads:"adminfiles/blank" }}

    There are some other ways you could achieve the same effect (for example by choosing right ADMINFILES_REF_START and ADMINFILES_REF_END and not using the filter at all), but I think this post is too long already 😉

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this xml <entry id=1008 section=articles> <excerpt><p>&#8230; in Richtung „Aus für Tierversuche. Kosmetik-Fertigprodukte
I have articles on my site, and I would like to add tags which
~ On my articles page ( http://www.adrtimes.squarespace.com/articles ) I have each entry start with
I have this query SELECT articles.*, users.username AS `user` FROM `articles` LEFT JOIN `users`
I have one model for different types of entries: POST = 1 PAGE =
I have a form which contains a whole heap of data entry fields that
I have several articles on a Joomla (1.5) site. These articles are public --
I have Table: ARTICLES ID | CONTENT --------------- 1 | the quick 2 |
I have a WordPress website that needs to have its articles in multiple languages.
I have two tables: articles and articletags articles: id, author, date_time, article_text articletags: id,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.