Admin template for flatpages - django

I need to plug in reach text editor to admin page of flatpages. And I don't know, what the template are used to falatpages administration?

Update:
One way is to use the django-tinymce app which supports the TinyMCE rich text editor. There's also an example of using the widget with a flatpage form.
Old:
The default template should reside at "flatpages/default.html" but you can customize this through the admin interface. See the Flatpage templates section in the django docs for more information.

In addition to answer to my question. For admin panel of flatpage used default chenge_form.html. But if you customized it for your app, it wouldn't be work for flatpages without explicit destination.

Related

Django admin customization (without using themes like jet,suit)

I wish to do some Django admin customization, on which I require the filter panel to be placed at top of the page. Can we also update the other templates as well in some fashion? I have read the official docs for Django admin, but I am unable to implement as I am new to Django and frontend.
You can override and extend the default Django admin template files, and do any sort of changes to the UI, by writing your own admin template files.
As you know, there are several admin themes available for Django, you can go through them, and refer to how these themes are implemented (reading their code) and try making up one for your own as per your needs.
You can read about overriding Django templates -
Already answered question - How to Override and extend basic django admin templates?
Django Documentation - https://docs.djangoproject.com/en/2.0/ref/contrib/admin/#admin-overriding-templates
You can also refer to the following directory on GitHub, which contains all the original Django admin template files, which you can override/extend - https://github.com/django/django/tree/master/django/contrib/admin/templates/admin

Adding Wagtail to an existing Django app

I'm quite new to Django and Wagtail, and I'm having some difficulty with what I think is a very basic use.
How do I allow Wagtail to edit an existing view's template, while serving that template using Django's serving mechanism?
Assume I have an app (HomePage) created to serve the site's main index (/). I have the HomePage's views set up to render template and certain elements dynamically. Now I want that template to be editable via Wagtail's CMS interface. Something as simple as an image on the frontpage, or a headline.
The closest I've gotten so far has been to follow the Wagtail beginner's tutorial to override the base HomePage class in my app's models.py. That only made my pages available via the /pages/ URL.
Thank you for any help.
Since your site's home page is not a Page object in the Wagtail sense, I'd suggest looking at Wagtail's facilities for managing non-page content - snippets and ModelAdmin would be possible candidates, but I reckon the site settings module would be the best fit.
A Setting model gives you a set of fields which can be configured for display in the Wagtail admin using a 'panels' definition, just like you'd get for a page model - with the important property that only one settings record exists per site. You can retrieve this record within your homepage view or template as shown in the docs, and output it on your template as desired.
One way do that, is to let Wagtail serve your homepage. You will need to change your project's url configuration accordingly, to make wagtail's urls serve the root of your site.
Then, you can pack your dynamic content into a custom template_tag and include in your homepage html template.

Is it possible to completely override Django's auto admin theme?

I want to use one of the many bootstrap responsive themes to override Django's auto admin style. I've only donde the tutorial but I'm not sure if messing with the CSS will break the tool. Is it possible?
Django documents have a section on overriding admin templates.
There is someone also has port twitter bootstrap for Django admin. You should take a look at django-admin-bootstrap. Works on Django 1.7+.

How to make customized admin template work with grappelli?

I am sing grappelli, the admin pages look good, but now I need modify some pages, for example, I created templates/admin/index.html under my app, it works, but grappelli doesn't apply the style on this customized template, any idea how I can make it work as the default admin templates?
figured out, I need customize on the grappelli template files not the default admin template files

Django model layout with multiple columns

My admin page for a specific model has two stackedInlines. Currently they display one under the other. I would like them to display side by side so The page would look like this (don't have enough reputation to embed the image :[ )
Any easy way to go about this without having to write my own admin page?
If that's the only solution, how exactly would I go about that?
you can override Django admin template for each app in your project.
you just have too create same folder as your app in template directory and overriding html.
How to override and extend basic Django admin templates?
You can add CSS/Javascript to admin page by defining class Media.
You'll have to override the admin template to accomplish this. See roshan's answer for more info.