Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Where can I get a mod_wsgi.so file?
I've spent the past 3 days trying to install mod_wsgi. After finding out that it was a more complex process on Windows, I decided to do it with Linux, but I still haven't figured out how to install it into my Apache/Xampp server because I can't find any .so files in the latest release for mod_wsgi. My httpd.conf file is already configured and ready to load the module but for obvious reasons doing sudo /opt/lampp/lampp start yields Starting XAMPP for Linux 5.6.30-0... XAMPP: Starting Apache...fail. httpd: Syntax error on line 523 of /opt/lampp/etc/httpd.conf: Syntax error on line 11 of /opt/lampp/apache2/conf/httpd.conf: Cannot load /usr/lib/apache2/modules/mod_wsgi.so into server: /usr/lib/apache2/module /mod_wsgi.so: cannot open shared object file: No such file or directory XAMPP: Starting MySQL...ok. because there's no file there. So where do I actually get said file? I've seen some of them on older websites, but I'm reluctant to use them because of compatibility issues or those versions of the module having less features and fixes. -
How to annotate a distinct Count over multiple relationships in Django?
Given a model that has more than one kind of connection to a related model (I will call the "parent" model), how could I annotate a queryset with a count of parent model objects that are linked through either connection without counting duplicates? Example model definitions Consider an Article model that has 2 links to a parent Publication model that are very similar in meaning. from django.db import models class Publication(models.Model): pass class Article(models.Model): publication = models.ForeignKey(Publication, related_name='publications') owner = models.ForeignKey(Publication, related_name='owned_articles') Objective I want to serve a page that is a list of publications. A business requirement is that the number of articles that the publication wishes to take credit for are shown (these publications prefer a generous metric for counting). An article is considered part of the organization if either the "owner" or "publication" field points to it, but no articles should be counted more than once for a single publication. An article may be included in the count of 2 publications if publication points to a different object than owner. I don't want to execute a query for every publication in the list. The problem with Count annotations here Publication.objects.annotate(Count('publications'), Count('owned_articles')) would be trivial. Then I will … -
Using ajax in django to update image with matplotlib
Not sure if it is possible but I am trying to update the image of the default matplotlib image and use ajax to update the chart. in my views.py, I have a function that just generates a candlestick plot, another function that gets called from ajax and a default index. my plot def stock_chart(request, start_date=None, end_date=None): #bunch of stuff... fig, ax = plt.subplots() fig.subplots_adjust(bottom=0.1) candlestick_ohlc(ax, stock, width=0.6) ax.autoscale_view() ax.xaxis_date() plt.setp(plt.gca().get_xticklabels(), rotation=30) canvas=FigureCanvas(fig) response = HttpResponse(content_type='image/png') canvas.print_png(response) return response this gets called from ajax. I get an error here 500 (Internal Server Error) def data_selection(request): if request.is_ajax(): start_date = datetime.strptime(request.POST.get('start_date'), '%m/%d/%Y').strftime('%Y-%m-%d') end_date = datetime.strptime(request.POST.get('end_date'), '%m/%d/%Y').strftime('%Y-%m-%d') #not sure what to do here return render(request, {'chart':reverse('stock_chart', kwargs={'start_date':start_date,'end_date':end_date})}) else: return HttpResponse(status=400) and my html and ajax call: <img id="stock_chart" src="{{chart}}" alt="chart"> <script> $(function () { $("#date_range").click(function () { $.ajax({ type: 'POST', url: '/data_selection/', data: $("form").serialize(), cache: false, success: function (data, status) { $('#stock_chart').attr('src', data); } }); return false; e.preventDefault(); }); }); </script> my url path url(r'^stock_chart/(?P<start_date>[\w\-]+)/(?P<end_date>[\w\-]+)/$', views.stock_chart, name='stock_chart') -
Django Filter Object with created_at between now and the last 3 hours
start_date = datetime.date(2017, 1, 1) end_date = datetime.date(2017, 2, 28) camera_logs = CameraLog.objects.filter(camera_id=camera_id, created_at__range=(start_date, end_date)) I see how to filter by days, but how might I filter by certain hour periods? I need to filter by 3, 6, 12, 24 hours. -
Django template tag inside HTML input tag (value attribute)
Is there any way for template tags of the {% %} sort to work in the <input type="submit"> HTML tag? For instance, imagine the variable text contains You're cool :-), and I have a custom template tag that turns :-) into the corresponding custom emoji I've designed. Then, the following wouldn't work, would it: <input type="submit" name="text" value="{% emoticons %}{{ text }}{% endemoticons %}"> I understand I can also use <button type="submit" name="text">{% emoticons %}{{ text }}{% endemoticons %}</button>, but a button fundamentally doesn't overflow elegantly to the next line like regular text does, hence I'm trying to avoid it. Anyone got a neat workaround to this? Much appreciated. -
Django, how to pass variable to exception middleware?
In django 1.10, how do I pass a variable to the middleware exception handler? In the below example, I want to access the passed list ([1,2,3]) in process_exception(). views.py class my_exception(Exception): def __init__(self, value): self.value = value def __str__(self): return repr(self.value) def my_view(request): ... my_var = [1,2,3] # Want to pass this to exception middleware raise my_exception(my_var) middleware.py from django.utils.deprecation import MiddlewareMixin class ExceptionMiddleware(MiddlewareMixin): # Has been added to settings.py middleware list def process_exception(self, request, exception): if type(exception) == my_exception: # How to access my_var here? ... -
django runserver startup using local settings when production was identified in .env file
I created a new project with cookiecutter django. I set the environment variable DJANGO_READ_DOT_ENV_FILE=True (setting it to False also causes the .env file to be read btw. I think that python assumes that the environment variable of True is a string not bool). In the .env file there is the following line: DJANGO_SETTINGS_MODULE=config.settings.production When I run python manage.py runserver I get the following output: Loading : /home/bucket/src/b2b/.env The .env file has been loaded. See common.py for more information Loading : /home/bucket/src/b2b/.env The .env file has been loaded. See common.py for more information Performing system checks... System check identified no issues (0 silenced). February 14, 2017 - 20:20:55 Django version 1.10.5, using settings 'config.settings.local' Starting development server at http://127.0.0.1:8000/ Quit the server with CONTROL-C. According to the above, the server config is config.settings.local. I know that the .env file is being loaded as the DATABASE_URL variable is correct and it connects to the database. It also looks like the code to load variables from the .env file is being run twice. I put some print statements in common.py and local.py to trace execution with the results below. Loading : /home/bucket/src/b2b/.env The .env file has been loaded. See common.py for more information … -
How to continue testing/adding to django project after deployment
I have a django website that was deployed to heroku, and in order to do so there had to be various changes to different files. Once that was done it was no longer possible to see the project on my own localhost due to all the changes. Is there any way around that? -
django- how to serve an image in all templates of django app?
i want to show user's avatar in all pages of my django project. i use an <img> tag in base.html and in the href i write: {{ request.user.profile.get_avatar }}. but it does not work properly. in the first page of project it works but in another pages does not work. the problem is for addresses. for example in index page with url www.mysite.com/index the image shows. but in www.mysite.com/v1/v2/v3 image does not show. this is the get_avatar method of profile class: def get_avatar(self): if self.avatar: return os.path.join(settings.MEDIA_URL + str(self.avatar)) else: return os.path.join(settings.MEDIA_URL + str('avatars/student.jpg')) how can i fix this? tanx -
Wagtail CMS Snippet Model Objects Based on Boolean Object
I am using Wagtail CMS for a local restaurants new site and Snippets for creating their menu items. They, like many restaurants, offer similar items on lunch and dinner menus, but typically at different price points. I've created a simple model for them to add menu items and two boolean fields (lunch, dinner). Instead of offering all the fields for every menu item inputed, I'd like to do display panels based on the menu selected, i.e. if lunch == True display these panels... Below are my model Snippets; any help is greatly appreciated. Thank you. Product Model (similar items that will be used on all menu sections) class ProductFields(models.Model): title = models.CharField(null=True, blank=True, max_length=250) intro = models.CharField(null=True, blank=True, max_length=500) description = models.TextField(null=True, blank=True) lunch = models.BooleanField(default=False, verbose_name='Lunch Menu') dinner = models.BooleanField(default=False, verbose_name='Dinner Menu') lunch_price = models.DecimalField(blank=True, null=True, max_digits=5, decimal_places=2) dinner_price = models.DecimalField(blank=True, null=True, max_digits=5, decimal_places=2) panels = [ FieldPanel('title'), FieldPanel('description'), FieldPanel('lunch'), FieldPanel('dinner'), FieldPanel('lunch_price'), FieldPanel('dinner_price'), ] class Meta: abstract = True starter product (There will also be salad product, pastas, etc..) class ProductTag(TaggedItemBase): content_object = ParentalKey('app.StarterProduct', related_name='tagged_items') @register_snippet class StarterProduct(ProductFields, ClusterableModel): menu_tag = TaggableManager(through=ProductTag, blank=True, help_text='Starter, Salads, Pastas etc...') class Meta: verbose_name = 'Starter' panels = [ MultiFieldPanel( [ FieldPanel('title'), FieldPanel('description'), … -
Django cannot insert duplicate key value NULL
I need to allow NULL in enc_id, but if values are not null, I need those values to be unique. Here's my model: class Intake(models.Model): id = models.AutoField(primary_key=True) enc_id = models.IntegerField(blank=True, null=True, unique=True) enc_date = models.DateField(null=True) enrollment = models.ForeignKey('Enrollment') Error when trying to add another instance without an enc_id: django.db.utils.IntegrityError: ('23000', "[23000] [FreeTDS][SQL Server]Violation of UNIQUE KEY constraint 'UQ__caseload__E136D21F4222D4EF'. Cannot insert duplicate key in object 'dbo.caseload_intake'. The duplicate key value is (<NULL>). (2627) (SQLExecDirectW)") According to what I've read (including this and a few resolved Django issues), having blank=True, null=True, unique=True should allow me to have duplicate NULLs, but no go. I've recreated my DB just in case and it still raises the integrity error. I'm running Django 1.10 and MS SQL Server 10. Any ideas? -
Getting a Django project up and running on AWS
I am very new to web development in general, even though I have some background in computer science. I have been having an issue getting my (very basic) Django project running on a webpage online (non-locally). I am using Amazon Web Services(AWS) with an EC2 instance running Ubuntu. I am trying to get the Django project running with a combination of nginx, supervisor, and gunicorn. I tried following this tutorial, but ran into issues when binding gunicorn to my IP address (specifically, I run into an invalid address error and I am not sure what exactly my AWS IP address is) + when running nginx I would get a 502 gateway error. I feel like this is a relatively simple task that I am struggling an immense amount with. Any help would be appreciated! -
django error on migration: "There is no unique constraint matching given keys for referenced table
So I have seen that a lot of these kinds of questions have popped up (few answered) and none in a Django aspect that I saw. I am confused why I am getting the error, I am guessing i am missing something on my field decorator or what not in my model definition. Here are the two models... (one abbreviated). I thought I did everything right with unique and primary key set to true in the one table that the foreign key gives reference to but upon migrate I get this error: django.db.utils.ProgrammingError: there is no unique constraint matching given keys for referenced table "swsite_zoneentity" class ZoneEntity(models.Model): zone_number = models.CharField(max_length=100, unique=True, primary_key=True) mpoly = models.PolygonField() #this should grow and shrink for the most representative one... objects = models.GeoManager() created_at=models.DateField(auto_now_add=True) updated_at=models.DateField(auto_now=True) class CesiumEntity(models.Model): be_number = models.CharField(max_length=100) #the number assigned to a foot print to distinguish #zone_id = models.CharField(max_length=100, null=True, blank=True) zone_id = models.ForeignKey('ZoneEntity', to_field = 'zone_number', null=True, blank=True) image_id = models.CharField(max_length=100,null=True, blank=True) mission_id = models.CharField(max_length=100,null=True, blank=True) product_type = models.CharField(max_length=100,null=True, blank=True) polarization = models.CharField(max_length=256,null=True, blank=True) mode_id = models.CharField(max_length=100,null=True, blank=True) mode_name = models.CharField(max_length=100,null=True, blank=True) acquisition_type = models.CharField(max_length=100,null=True, blank=True) image_size_samples = models.CharField(max_length=100,null=True, blank=True) image_size_lines = models.CharField(max_length=100,null=True, blank=True) sample_spacing_range = models.CharField(max_length=100,null=True, blank=True) line_spacing_azimuth = models.CharField(max_length=100,null=True, … -
supervisord refuses to run command as user (always runs as root)
For some reason, supervisor refuses to start the command as user - it always runs it as root - and this is an issue for me since I am activating a virtualenv and running commands specific to that particulat virtualenv. So, my conf looks like so: [program:site] command = /home/some/virtual/env/dir/run/start.sh user = foo stdout_logfile = /home/some/etc/supervisor/logs/logging.log redirect_stderr = true environment=LANG=en_US.UTF-8,LC_ALL=en_US.UTF-8 stopsignal=KILL killasgroup=true autostart=true start.sh looks like so: #!/bin/bash cd source /home/foo/some/virtual/env/bin/activate cd /home/foo/.ve/dj_solar/dj_solar/ SOCKFILE01=/home/some/etc/supervisor/site.sock exec /home/some/virtual/env/bin/gunicorn -b unix:$SOCKFILE01 site.wsgi:application -w 2 -k gevent --worker-connections=2000 exit 0 when I inspect the log, I see: start.sh: line 2: cd: /root: Permission denied which means this is still running as root. I am totally baffled by this. I start supervisor as root. The even weirder part is that the above code works totally fine on my local machine, but shows me the above log on a server. I have run out of ideas... :(( -
Binding a FormSet in a ModelForm in Django
I'm writing an app for managing health care plans which manages things like Allergies, Diabetes, etc. I have a form that I can successfully create new records with, but I'm running into problems when it comes to updating that data. My problem is that I'm not sure how to bind my formsets to the saved data when the UpdateView is opened. My current strategy is to follow the answer found here, but I'm not sure if it's the right one in this context. Right now, when I try to go to the PlanUpdateView url, I get the following error on medication_form_set = MedicationFormSet()(queryset=medication_queryset): builtins.TypeError TypeError: 'MedicationFormFormSet' object is not callable forms.py from django import forms from django.forms.models import inlineformset_factory from .models import Allergy, Medication, Allergen class AllergyPlanForm(forms.ModelForm): class Meta: model = Allergy widgets = { 'asthma': forms.RadioSelect, 'allow_carry': forms.RadioSelect, 'self_carry_admin': forms.RadioSelect, } fields = ('asthma', 'allow_carry', 'self_carry_admin', 'hc_provide_sign', 'par_provide_sign') MedicationFormSet = inlineformset_factory(Allergy, Medication, fields=('dose', 'med_type', 'name_brand', 'side_effects'), extra=1) AllergenFormSet = inlineformset_factory(Allergy, Allergen, fields=('allergen', 'insect_stings', 'other_text'), extra=1,) models.py from django.db import models from django.urls import reverse class Allergy(models.Model): id = models.AutoField(primary_key=True) student = models.ForeignKey('powerschool_schema.Student', db_column='studentsdcid') asthma = models.BooleanField(choices=( (True, 'Yes (if yes, high risk for severe reaction, please also complete IHP101.1 … -
Django migration breaks with Postgres 9.6
I have upgraded version of Postgres to 9.6. It doesn't accept UTC as value for timezone and throws following error. ERROR: invalid value for parameter "TimeZone": "UTC" Django's (1.9.2) python manage.py migrate fails as it executes SET TIME ZONE 'UTC'; There is a thread about this which says restarting postgres instance will resolve, but it does not. As postgresql 9.6 doesn't have support for 'UTC' value. How can it be fixed at django side to make migrations work with Postgresql 9.6. -
Connect django-user-accounts to already existing users
I've installed and added django-user-accounts to an existing project as wanted an easy way to set up things like user account pages and the ability to request a new password etc. After setting it up there now is a new section in the admin panel called "ACCOUNTS". However there are no account objects. Is there a way to connect it to my existing users in my existing app? I don't want existing users to create a new account. I was looking to extend my current user model and build upon it. I hope someone can help. I'm using Python 3.5 and Django 1.10. -
Django find relationship "route" between two Vertexes in a Network
This is mostly a logical question, but the context is done in Django. In our Database we have Vertex and Line Classes, these form a (neural)network, but it is unordered and I can't change it, it's a Legacy Database class Vertex(models.Model) code = models.AutoField(primary_key=True) lines = models.ManyToManyField('Line', through='Vertex_Line') class Line(models.Model) code = models.AutoField(primary_key=True) class Vertex_Line(models.Model) line = models.ForeignKey(Line, on_delete=models.CASCADE) vertex = models.ForeignKey(Vertex, on_delete=models.CASCADE) Now, in the application, the user will be able to visually select TWO vertexes (the green circles below) The javascript will then send the pk of these two Vertexes to Django, and it has to find the Line classes that satisfy a route between them, in this case, the following 4 red Lines : Business Logic: A Vertex can have 1-4 Lines related to it A Line can have 1-2 Vertexes related to it There will only be one possible route between two Vertexes What I have so far: I understand that the answer probably includes recursion The path must be found by trying every path from one Vertex untill the other is find, it can't be directly found Since there are four and three-way junctions, all the routes being tried must be saved throughout the recursion(unsure … -
What is the correct http verb for Django REST partial_update
Im trying to perform partial update in DRF using angular $http. In my DRF model viewset i override the partial_update function (server side). def partial_update(self, request, pk=None): instance = self.get_object() serializer = self.serializer_class(instance, data=request.data, partial=True) if serializer.is_valid(): serializer.save() return Response(serializer.data, status=status.HTTP_200_OK) return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST) In the client side angular handle the user request. $http.patch('/api/my_viewset_url/1', data); But i got this response Method Not Allowed (PATCH): /api/my_viewset_url/1 When using $http.get() request with DRF model viewset list(self, request) it works well for getting a list same goes for $http.post() with def create(self, request) for creating object and $http.put() with def update(self, request) for updating object. What's wrong? or what is the correct http verb for partial_update in DRF model viewset -
Django Template not preserving OrderedDict
The function returns an ordered list my_olist = OrderedDict() my_olist['bananas'] = 3 my_olist['apples'] = 1 .. return my_olist in the view.py I confirmed the order is maintained returned_ordered_list = mylist() # this is still ordered request.session['results'] = {... 'ordered_list': returned_ordered_list } return render(request, HttpResponseRedirect(reverse('myapp:resultspage',)) However in the HTML template resultspage, the order is no longer maintained {% for key, value in ordered_list.items %} <b>{{key}}:</b> {{value}} <br> {% endfor %} I've seen a solution working for orderedDict but they did not use HttpResponseRedirect. -
Django exception middleware: TypeError: object() takes no parameters
I'm using Django 1.10 and trying to catch all exceptions with exception middleware. The code below causes an internal server error: mw_instance = middleware(handler) TypeError: object() takes no parameters views.py from django.http import HttpResponse def my_view(request): x = 1/0 # cause an exception return HttpResponse("ok") settings.py MIDDLEWARE = [ 'django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', 'myproject.middleware.ExceptionMiddleware', ] middleware.py from django.http import HttpResponse class ExceptionMiddleware(object): def process_exception(self, request, exception): return HttpResponse("in exception") I have seen these object() takes no parameters in django 1.10 and other questions talking about middleware versus middleware_classes, but I'm not sure how that applies to this case, or what I'd actually need to change to fix the issue. -
Installing TinyMCE on Django (And using it on forms)
Hi Im trying to install TinyMCE on a Django project and Im totally lost about static files, MEDIA, and the world itself. I want to use TinyMCE in one of the fields of a form: class MovieForm(forms.ModelForm): class Meta: model = Movie fields = ['title', 'language', 'description'] widgets = { 'languages': forms.SelectMultiple(), 'description': TinyMCE({'cols':80, 'rows':30}), } I installed django-tinymce pip install django-tinymce Then I added it to the installed apps INSTALLED_APPS = ( ... 'tinymce', ... ) And then added the urls in my project urls.py urlpatterns = patterns('', ... (r'^tinymce/', include('tinymce.urls')), ... ) Great. So what do I do next? I read the Configuration part on http://django-tinymce.readthedocs.io/en/latest/installation.html#configuration but I dont get it. Should I add TINYMCE_JS_URL = os.path.join(MEDIA_URL, "path/to/tiny_mce/tiny_mce.js") to my project settings.py? Where do I put tiny_mce.js? Should I configure MEDIA_URL somewhere? Would be awesome if someone can point me in the right direction. Thanks! :) -
Too packages when create the virtualenv in Django with Anaconda
When I create the virtualenv in django. Because I have installed Anoconda. So my virtualenv has too lots of packages. Is there any way to reset all packages in the new virtualenv? -
Multi-tenant issue using django-rest-framework
We have an issue to make a multi-tenancy SaaS application using Django and django-rest-framework. We would like to route to the correct database according to the url, and using django-rest-framework serializers. But with django-rest-framework, we cannot specify the database we want to save to with serializers. We are able to request data by overriding the get_queryset method, and with the using(<database>) function. class SomeSerializer(serializers.ModelSerializer): def get_queryset(self): return SomeModel.objects.using(self.database) If we want to save an instance to a custom database, we cannot use ModelSerializer, we have to write each serializer using the Serializer class. We can make a pull request to add the option to django-rest-framework Multiple databases support #65 - django-rest-framework Or, we can do something similar to this snippet : Database Routing by URL, it's quite old (2010) but still working. But we are not very comfortable with the idea of using the local thread to transfer variables. How do we do this properly in 2017 ? Are there other options ? -
UnicodeError: encoding with 'idna' codec failed (UnicodeError: label empty or too long)
I'm hosting a Python bloglike website on Heroku, using free dynos and free PostgreSQL. I have Media Files hosting on Amazon S3. I have finished the site and deployed on Friday evening and everything worked well. Unfortunately when today I wanted to start manage content Admin panel greeted me with error 500 on image upload. Traceback (most recent call last): 2017-02-14T16:53:23.182651+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/django/core/handlers/exception.py", line 39, in inner 2017-02-14T16:53:23.182652+00:00 app[web.1]: response = get_response(request) 2017-02-14T16:53:23.182653+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/django/core/handlers/base.py", line 187, in _get_response 2017-02-14T16:53:23.182653+00:00 app[web.1]: response = self.process_exception_by_middleware(e, request) 2017-02-14T16:53:23.182654+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/django/core/handlers/base.py", line 185, in _get_response 2017-02-14T16:53:23.182654+00:00 app[web.1]: response = wrapped_callback(request, *callback_args, **callback_kwargs) 2017-02-14T16:53:23.182655+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/django/views/decorators/cache.py", line 43, in _cache_controlled 2017-02-14T16:53:23.182656+00:00 app[web.1]: response = viewfunc(request, *args, **kw) 2017-02-14T16:53:23.182656+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/wagtail/wagtailadmin/decorators.py", line 24, in decorated_view 2017-02-14T16:53:23.182657+00:00 app[web.1]: return view_func(request, *args, **kwargs) 2017-02-14T16:53:23.182658+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/wagtail/wagtailadmin/utils.py", line 103, in wrapped_view_func 2017-02-14T16:53:23.182658+00:00 app[web.1]: return view_func(request, *args, **kwargs) 2017-02-14T16:53:23.182659+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/django/views/decorators/vary.py", line 21, in inner_func 2017-02-14T16:53:23.182660+00:00 app[web.1]: response = func(*args, **kwargs) 2017-02-14T16:53:23.182660+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/wagtail/wagtailimages/views/multiple.py", line 72, in add 2017-02-14T16:53:23.182661+00:00 app[web.1]: image.save() 2017-02-14T16:53:23.182661+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/django/db/models/base.py", line 796, in save 2017-02-14T16:53:23.182662+00:00 app[web.1]: force_update=force_update, update_fields=update_fields) 2017-02-14T16:53:23.182663+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/django/db/models/base.py", line 824, in save_base 2017-02-14T16:53:23.182663+00:00 app[web.1]: updated = self._save_table(raw, cls, force_insert, force_update, using, update_fields) …