When is the formfield() method called in Django?

This is a question on making custom fields in Django. I'm making a field called EditAreaField, which inherits from TextField. Here's what my code looks like: class...

Extending User profile in Django 1.7

I know, this question has been already asked many times in SO, but most of the answers I read were either outdated (advising the now deprecated AUTH__PROFILE_MODULE method), or were lacking of a...

Django : make_aware expects a naive datetime

I started to work on a project built with Django and I can't figure something out. I have in my settings.py : TIME_ZONE = 'UTC' USE_I18N = True USE_L10N = True USE_TZ = True In my models.py,...

How to deal with "SubfieldBase has been deprecated. Use Field.from_db_value instead."

On upgrade to Django 1.9, I now get the warning RemovedInDjango110Warning: SubfieldBase has been deprecated. Use Field.from_db_value instead. I see where the problem arises. I have some custom...

Django 1.9 TemplateSyntaxError Could not parse the remainder: '==' from 'game.status=='

I am having trouble figuring out where the problem is here. Essentially I am trying to pass a Context, which is a dictionary of named keys mapped to a list of Game objects, to an html snippet via...

Django Querysets - Relations match all subqueries OR refer to joined table's field in a second filter

I'm trying to construct a Django queryset for a model where all of that model's relations are represented by some subquery or subqueries. For example, Bands have Musicians and Instruments through...

How to mark deprecated fields in Django 1.4?

What is the best way to mark deprecated fields in Django 1.4 models if I don't want to delete them right away?

How can I filter a DateField or a DateTimeField in Django using a string?

I am using DataTables for my front end and it allows a global search (iterating through all the fields to find matches). This is what I want to be able to do in django (version 1.9.1): use...

LOGIN_REDIRECT_URL in django

I am very new to Django and I'm nearing the end of the django girls tutorial. I have added "@login_required" above my post_detail in views (view for clicking on a specific post) and added a...

How can I support AutoField(primary_key=False) in django?

I need to add an autoinc field that is not the primary key. I am in the process of migrating a very large production database that uses autoincrementing fields to models.UUIDField. I have been...

How to submit POST request data to a TemplateView function?

I want to do a POST request from a form in a django template and use the posted values in a TemplateView to change which data is sent to the template. The only thing that doesn't work is using the...

Django REST Framework Swagger 2.0

Having a hard time configuring Swagger UI Here are the very explanatory docs: https://django-rest-swagger.readthedocs.io/en/latest/ YAML docstrings are deprecated. Does somebody know how to...

How Android POST to Django Rest Framework Json or API?

I have a web written in Django framework and created Rest Framework for the API. I am required to write an android application based on the Django framework (Android and Django newbie). However I...

Django - Sort Queryset by Date instead of Datetime

I have a model (representing a 'job') that contains a DateTimeField called date_created. I have another called date_modified. I would like to sort by -date_modified so that the most recently...

How can I specify the parameter for POST requests while using APIView with django-rest-swagger

In the latest version on Django REST Swagger (2.1.0) YAML docstrings have been deprecated. I cannot get swagger to show the POST request parameters. Here is my view class...

Deprecating fields in django model

I'm normalizing a database associated with a Django project and will be moving fields to different tables. As part of the implementation process, I'd like to throw a deprecation warning to my...

Django ORM get return value of model-class method in values()-modified QuerySet

I'm programming a farming game to learn Django. For one of my views, I would like both the fields of an Object, as well as the result value of one of its methods. Preferrably in the same...

merge django's auth_user with existing user table

Currently I have a legacy app which refers to a user table with all the custom fields. Since there is a good amount of legacy code referring to that table I cannot simple rename that table as...

django-graphene alter column name deprecation

I would like to alter a column name in a table my database, deprecate the old field in django-graphene and add the new field. How or can I do this without creating the same column twice in my...

Moving multiple models from one django app to another

I'm building a project using django v2.0.2 that consists of 3 apps with 24 models. One of the apps has 14 models. Having so many models in one app is becoming complicated, and I'd like to create a...

Sort objects in Django admin by a model @property?

I have two models - a Task model, and a Worker model. I have a property on Worker that counts how many tasks they have completed this month. class Task(models.Model): # ... completed_on =...

Soft deleting objects in django

I am trying to implement a general soft deletion pattern for Django models. Models are given a is_deleted field, which keeps deleted objects in DB, but hides them for all practical purposes: all...

How to remove custom field without breaking Django migrations?

I work on a Django 1.8 project that uses the old django-json-field library. I want to remove the library, update to Django 1.9 and use the native JSONField, but I have migrations that rely on the...

Error NET::ERR_CERT_COMMON_NAME_INVALID from google when using Django 2.0 for password recovery through email

I am creating a "password recovery" system using django 2.0 auth and "Heroku" handles my SSL Certificate. When I send the email containing the password reset link, I get redirected to a google...

Creating a models.UniqueConstraint in abstract model

I am creating an abstract model for my django app, SrdObject. One of the characteristics of my model is that it has a pair of fields that, taken together, must be unique: 'name' and the foreign...

Passing user.id to class FormWizardView in Django form-tools

I am trying to create a multi-step form in django2.2. Apparently, the native FormWizard was deprecated in previous django versions so the only solution I have ran into is django-formtools. I have...

ModuleNotFoundError: No module named 'django_popup_view_field'

You see that all is installed, but when I run runserver I got this error : ModuleNotFoundError: No module named 'django_popup_view_field' [[email protected] Invest_App]$ sudo pip...

How to store Google Auth Credentials object in Django?

I'm trying integrate Google Tag Manager into my project. In official document, Google suggests oauth2client library. Unfortunately, this library deprecated. I used google_auth_oauthlib. I can get...

Rel.to deprecated in Django 2.0

I am trying to upgrade the django-accounting (https://github.com/dulacp/django-accounting) to the last version of django as I would like to use it in my app. One item, I am trying to resolve that...

Django/Wagtail ImportError: cannot import name 'FieldDoesNotExist' from 'django.db.models.fields'

I am using Django and Wagtail to create a site, which had been working well for some time. However, after some problems with anaconda, reinstalling etc, I now get this problem when I run python...