Image resizing with django?

I'm new to Django (and Python) and I have been trying to work out a few things myself, before jumping into using other people's apps. I'm having trouble understanding where things 'fit' in the...

Django admin: Format fields in list, but keep sortable?

I keep numeric fields like "size", "width", "height" in my database. Now I would attach units like "KiB" or "pixels" to them when showing them in the change list. This could easily be achieved by...

Django admin: how to sort by one of the custom list_display fields that has no database field

# admin.py class CustomerAdmin(admin.ModelAdmin): list_display = ('foo', 'number_of_orders') # models.py class Order(models.Model): bar = models.CharField[...] customer =...

Django admin sort order

i have went through the Poll tutorial on http://docs.djangoproject.com. I would like to know if it is possible to add a sort order to the 'Choice' Model when editing a Poll and how would i...

Improving Performance of Django ForeignKey Fields in Admin

By default, Django's admin renders ForeignKey fields in admin as a select field, listing every record in the foreign table as an option. In one admin-accessible model, I'm referencing the User...

django admin sort foreign key field list

Is there an option in the django admin view for ordering of foreign key fields? i.e. I have a foreign key to a "School" model, which shows as a dropdown, sorted on pk-- I would like it to be...

Store Django Log messages in a database?

Django (the python web framework) uses python's logging system to store logs. Is there an easy way to store log messages in a database, and then allow admin users to look over them via the web?...

How to stream video in a django app

I'm looking to stream video's as part of a django app, but I've never done anything with video and don't really know where to start. I don't have all the details of the project yet, but I'm...

How can I turn off column sorting in Django-admin tables or specify WHICH columns are sortable?

Is there an easy way to turn off sortability for for some/all columns in the django admin and/or specify which columns are sortable? I know I can manually disable sorting via javascript, but...

Django delete unused media files

I have a django project in which the admins are able to upload media. As items sell, they are deleted from the site, thus removing their entry in the MySQL database. The images associated with the...

Django Admin without Authentication

Is there a ready way to use the Django admin page without any form of authentication? I know I can use this method, but that was for Django 1.3. Are there any changes that would let me do this...

Column Sorting in Django Admin

Hey I have a model UserProfile which has a OneToOneField relationship to the model User. In the adminpage I use list_display property to display some of the fields of UserProfile in the same place...

Uploading files using Django Admin

I want to be able to upload .PDF files using the Django Admin interface and for those files to be reflected in a page on my website. Is this at all possible? If so, how do I do that? Otherwise,...

How to disable sorting by primary key in Django Admin?

Django admin sorts by primary key in addition to sorting fields specified in the model "ordering" record, thus, making it necessary to have composite indexes on a model just to allow sorting,...

Sort CommaSeparatedIntegerField in Django Admin

I'm working on a model which has an CommaSeparatedIntegerField in which I store the order of some Images which I'm getting from filers FolderField. class Gallery(models.Model) […] folder...

Django Admin, sort with custom function

How can I sort a column in Django admin by some simple custom method? (All the answers I got through was by using annotate but I don't know how to use it my case). Assume the model class...

limiting the number of displayed instances of a model in Django Admin

I have a model which over timer will have several thousand to tens of thousands of instances. Each of those is unique. In the Django Admin interface I can see all the instances and access them...

My django blog isn't detecting the HTML/CSS files i added

Edit 1: I am building a blog with django and i recently added some html/css files to a template folder but its not loading. These are my html codes base.html: {% load static %} <!DOCTYPE...

dajngo-admin-sortable2 doesn't sort order of SortableAdminMixin

I created an app with django and python3 containing several tutorials, which in turn contain multiple content entrys that are saved in another table. Each tutorial is represented by an entry in...

Django Allauth / User Model Encrypt Username and Email For PII Compliance

Is it possible to encrypt the username and email for Allauth to be PII compliant? If so, how would you do that? If this is possible, how would a site admin go about decrypting the username and...

Reorder nav bar from django admin

So I am currently working on a project and the client has asked for this requirement. Basically, I have to provide some sort of mechanism in the admin panel so that the admin can order the navbar...

How to make Django Admin TabularInline sortable by custom field?

In Django Admin, it's easy to create a custom field on the model list page, e.g.: @admin.register(MyModel) class MyModelAdmin(admin.ModelAdmin): list_display = ('id', 'field1',...

How to display Historical table of django-simple-history in Django admin site?

I have implemented Historical tracking of changes to objects in Django using django-simple-history https://django-simple-history.readthedocs.io/en/2.10.0/index.html I have mentioned a field...

How to solve an error on django admin interface

dashboardmy django dshboardHi i am using Django admin to work on some task. i have created a model and added project name. so whenever i am creating a project say 'project5' and adding details and...

How to display Data in Ascending and Descending Order in Django?

I am creating my custom admin panel in Django, i don't want to use django default admin panel, But i want sorting filters in dajngo, If a user click on email then email should be in ascending...

Unable to override both contrib.admin.AdminSite and django.contrib.auth.admin.UserAdmin simultaneously

Using Django 3.1 and Python 3.6, I'm trying to both override the default AdminSite class, and the UserAdmin. I'm trying to combine the examples from two different sections of the...

How to fix “ '" is not a valid UUID.”

I want to let user re-order/sort table of content with drag and drop. And whene I push "Submit order" button (after re-order) I have error: ValidationError at /save-group-ordering/ ['“” is not...

Best way to integrate OpenId connect / (Keycloak) with Django and Django Rest framework

I'm looking for advice on the best way to integrate Django / Django Rest Framework with OpenId connect (we're using Keycloak but I think using the protocol is probably more flexible). There seems...

403 Forbidden: AWS S3, Django, S3Boto3Storage, CKEditor

After several days of continuous attempts, I'm nearly ready to give up. I have a popular setup and I see many people have similar issues, but there is no comprehensive (and working!) answer. I get...

Django admin inline change fields on new row

Background I'm customizing the admin pages for an inventory system with a lot of ManyToMany relationships and other complex data. I want to display these relationships using Inlines, but I don't...