Django auto_now and auto_now_add

For Django 1.1. I have this in my models.py: class User(models.Model): created = models.DateTimeField(auto_now_add=True) modified = models.DateTimeField(auto_now=True) When updating a...

Good tool for automatic setup and deployment of Django projects

2021 update Today I'm using Ansible for this and other devops tasks. Along the way I've experimented with Chef, Puppet, Saltstack and Docker images, but I've found that for me, as a solo...

How to store Node.js deployment settings/configuration files?

I have been working on a few Node apps, and I've been looking for a good pattern of storing deployment-related settings. In the Django world (where I come from), the common practise would be to...

Django logout not working

I seem to have the same problem as in this question: https://stackoverflow.com/questions/2074980/django-logout-problem Mine is a bit weirder, it works in google chrome.... but not in...

Overridding Django Admin's object-tools bar for one Model

I am looking for the solution. I think a lot of different examples have confused me a little. I want to override the object-tools template in the Django admin. I have one button on my model's...

Disqus SSO - Not working

I am using Python and Django to log into Disqus. The admins have confirmed that the account has SSO enabled and their debug tools confirm that my login token is correct.. However my config seems...

Auto increament the invoice number in django backend for new invoice

I want to auto increament the invoice number which is 3 digits char and 4 digits number. class Invoice: invoice_no = models.CharField(max_length=500, null=True, blank=True,...

django admin panel add a confirmation window

I need to add a confirmation window on admin change model submit "save". Smth like this: "Do you really want to apply changes? Yes/No". I need it only for one model and only if the changed model...

Error in admin: __str__ returned non-string (type NoneType)

The admin returns this error when trying to add an instance to one of my models. The model itself has a correct str() method and contains no instances yet. Also tried replacing the str() method...

django-import-export not showing in admin

I have a problem with django import-export tool. Simmilat to the one described in This topic. Problem is there is no solution for the problem posted there and I need it badly. Buttons for...

'django.template.context_processors.request' issue with django-tables2 and django-admin-tools

I'm having an issue when trying to render a PDF through xhtml2pdf in Django(1.10.4) when using django-admin-tools(0.8.0) & django-tables2(1.5) together. I've done enough reading to understand the...

Hide Django logo/name in header Django admin tool

I want to hide/change the name displayed in the header bar, the label that I want to change is "DJANGO" word as the next image shows"

module 'importlib._bootstrap' has no attribute '_w_long'

I am trying to install django-adim-tools using pip, but this is what happens: C:\Users\hugo.villalobos>pip install django-admin-tools Could not import runpy module Traceback (most recent call...

ImportError: No module named 'config.settings'; 'config' is not a package

I'm trying to get my cookiecutter-django app running under Apache with mod_wsgi installed via pip. python3 manager.py runserver works. But after running it in Apache, I got an error saying Module...

Totaling inside a cart model the subtotal of each TabularInline entry in Django Admin

Not sure if this is possible, but in my Cart (model class) detail view in Django Admin, I'd like to total up all of my TabularInline Entry model class subtotals, and save that value to my Cart's...

Auto-generate model definitions from existing ArangoDB database

I'm using ArangoDB 3.4 and planning to use an MVC framework like Backbone.js (or whatever is recommended). Is there a way to auto-generate the models from the existing database to reduce the...

django-ckeditor failing due to template path problem

I just added django-ckeditor to my django project by installing it: pip install django-ckeditor adding it to INSTALLED_APPS, adding the upload path: CKEDITOR_UPLOAD_PATH =...

How do you log in when using django-rest-knox?

Django-Rest-Knox provides a view to give you the token to authenticate, but that view requires...

wrap_socket() got an unexpected keyword argument '_context'

I'm currently trying to put in production a django project using nginx and gunicorn for the first time. The project consist on a register page in which the user access, fills a form and the data...

Display a dropdown hidden in a css grid column with clip-path applied

I have an admin header from Django which is divided in 2 columns with css grid. I included a JavaScript dropdown effect on the user icon to show other elements like "Change Password" and "Log Out"...

Django, can't load json file due to UNIQUE constraint

I am new to python. I am cloning a project, and after migrating the models, I am trying to seed the database. Migrating was done with no issue. The file I am trying to seed, is basically an array...

Django admin 404 error when creating or editing a model instance

I'm currently debugging a weird problem with a Django site where one specific model is triggering a 404 error when creating a new instance or editing an existing one in the admin...

Throws "IntegrityError: duplicate key value violates unique constraint" while publishing a page in Django-cms

Recently I migrated my local django + django-cms site to production server using following methods: moved code to production server and populated db schema using makemigration and migrate...

Django Admin loading without css

I had created a new Django app, and I noticed it's admin page was loading without css. I set the STATIC_URL and the STATIC_ROOT in settings.py according to this solution, but it still does not...

Django admin page layout changed with new version

I am working on an existing django project where admin console is extensively used. With my latest run of package upgrade for my application admin page layout has changed. Models have started...

Celery task can't access volume file in docker

Admin page can get access to the image file saved in database but Celery task can't get access to that image file and shows error FileNotFoundError(2, 'No such file or directory')....

What is the recommended workflow for vue.js + i18n?

I have recently made the jump from developing using the Django framework to vue.js. One thing I am having a hard time wrapping my head around is the workflow for adding translations. In Django, my...

Django admin error ValidationError: ['ManagementForm data is missing or has been tampered with'] due to conditional inline use

I have a custom User model(AbstractUser) and a Stock model. Assume there's multiple user roles manager, supplier etc. The manager can be able to view other manager's details and supplier...

Django Administration: Delete record from custom user model

I have created a custom user model (users_user) which works for registering new users (creating new custom user records) and logging in. But if I go to the Admin page, and try to delete a user...

Can't figure out why I'm getting `Reverse for 'app_list' with keyword arguments '{'app_label': ''}' not found` in a django project

The project has 2 apps - accounts (very basic custom users) and portal. myproject/myproject/urls.py: from django.contrib import admin from django import urls from portal import admin as...