Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
How to map to request.post json key to model serialializer field in django?
I am newbie in djnago-rest-framework. I am leaning about creating instance with serializer in DRF. Let suppose I have models who look like this (models.py) : from django.db import models class Reporter(models.Model): first_name = models.CharField(max_length=30) last_name = models.CharField(max_length=30) email = models.EmailField() class Article(models.Model): headline = models.CharField(max_length=100) reporter = models.ForeignKey(Reporter, on_delete=models.CASCADE) My serializer look like this (serializers.py) : Class AricleSerializer(serializers.ModelSerializer): reporter = PkDictField(model_class=Reporter) class Meta: model = Article field = ('headline', 'reporter') If I post the data like this: $ curl -H "Content-Type: application/json" -X POST -d '{"headline":"NewHeadline", "reporter":1}' http://localhost:8000/create-article/ In this case everything work fine, It create new entry of article. But actually I want to rename field reporter to article_reporter so actual post request look like this $ curl -H "Content-Type: application/json" -X POST -d '{"headline":"NewHeadline", "article_reporter":1}' http://localhost:8000/create-article/ Yes I understand I can rename key "article_reporter" to "reporter" in views.py before to send data to serializer and It will work fine. But I want to handle this in serializer class, AricleSerialize. can someone tell me how can I solve this in serializer? Any help would be appreciater. Thanks -
django template css files not imported URL
My css and js files are not imported for some the url http://demo.in:8001/dj/dev/userlogin/725/92dc73fa435ec9d727a987a763d309 but the same files are imported for url http://demo.in:8001/dj/dev/userlogin/725 They extend same base file. The path static files are hitting are : http://demo.in:8001/dj/static/.. whereas with the static tag, the should hit following path http://demo.in:8001/static/.. -
best language for dynamic drag n drop gui creation
I want to create an application to schedule tasks, with dynamic GUI where i can create elements, drag and drop them, shuffle and create rows and columns within table, so that it will be very flexible. Ideally I would like to be able to print out my designed schedule. Very similar behavior to my needs has an existing web based app - Shotgun software, where I can create color blocks and move/drag/stretch them around. I am familiar with python and basic QT but I could not find any elegant QT examples/solutions that would not require custom widges creation. (There are examples of dynamic tables or movable objects but they have to exist on its own, separate qt Window) Preferably I would like to avoid learning new language like Java or PHP for such purpose (if possible). I have even tried mixing python with django/flask to create dynamic tables but even in those solutions I could not find drag/drop, drag, create, move possibilities. (http://examples.flask-admin.org/sqla/simple/admin/user/) Is there any specific language or package that you would suggest? -
Django: 'myapp' is not a registered namespace
I have this error during template rendering. What i'm trying to do is allow the user to upload a csv then process the data into models. error at line 109 'myapp' is not a registered namespace This is my line 109 code <form action="{% url "myapp:upload_csv" %}" method="POST" enctype="multipart/form-data" class="form-horizontal"> urls.py in mysite urlpatterns = [ url(r'^admin/', admin.site.urls), url(r'', include('anomaly.urls')), ] urls.py in anomaly urlpatterns = [ url(r'^$', views.post_list, name='post_list'), url(r'^upload/csv/$', views.upload_csv, name='upload_csv'), ] -
How to add a pager to the pages that load many records in the wagtail manager?
Is that I have a project where many records are loaded but do not page like the images and documents that Wagtail brings, that when the documents and images are many it starts to show a pager. I would like to know how to add functionality to the pages that load many records because when loading it becomes slow. -
Cannot connect Celery to RabbitMQ on Windows Server
I am trying to setup rabbitMQ to use as a message broker for Celery. I am trying to set these up on a Windows Server 2012 R2. After I start the rabbitMQ server using the RabbitMQ start service on the applications menu, I try to start the celery app with the command. celery -A proj worker -l info I get the following error after the above command. [2018-01-09 10:03:02,515: ERROR/MainProcess] consumer: Cannot connect to amqp:// guest:**@127.0.0.1:5672//: [WinError 10042] An unknown, invalid, or unsupported option or level was specified in a getsockopt or setsockopt call. Trying again in 2.00 seconds... So, I tried debugging, by check the status of the RabbitMQ server, for which I went into the RabbitMQ command prompt and typed rabbitmqctl status, on which I got the following response. These are the services that I used to start RabbitMQ and the RabbitMQ command line Here's my Django settings for Celery. I tried putting ports and usernames before and after the hosts, but same error. CELERY_BROKER_URL = 'amqp://localhost//' CELERY_RESULT_BACKEND = 'amqp://localhost//' What is the issue here? How do I check if the RabbitMQ service started or not? What setting do I need to put on the Django Settings file. -
I cannot use pylint in VSC using pipenv & bash for windows 10
While proceeding Django Project Now, I'm having trouble with linter in VSC, pylint. First I'm using virtual environments with pipenv. and I'm using Visual Studio Code Version 1.19.1 with Windows 10. The trouble that I'm having is even though I installed pylint with pipenv and pip commands, VSC can't recognize it and Installation with Visual Studio Code can't work First I figured out that python path settings pointed global setting, not virtual envs. so I edit settings.json for VSC like following way. { "python.pythonPath": "C:\\Users\\seungjinlee\\AppData\\Local\\lxss\\home\\seungjinlee\\.local\\share\\virtualenvs\\seungjingram-6b3oTnkI\\bin\\python", } from but It didn't work as well. Is it problem with bash for windows? I guess bash shell create virtual enviorments for Ubuntu. but I'm using editor VSC with windows 10 so it can't find pylint for windows,.,.,, plz help me..! -
Django & Mongoengine get data from embedded document?
I am having trouble retrieving data from the embedded document in mongoengine. models.py from mongoengine import Document, EmbeddedDocument, fields class ProductFields(EmbeddedDocument): key_name = fields.StringField(required=True) value = fields.DynamicField(required=True) class Product(Document): name = fields.StringField(required=True) description = fields.StringField(required=True, null=True) fields = fields.ListField(fields.EmbeddedDocumentField(ProductFields)) views.py class ProductListView(APIView): def get(self, request): # list_products = Product.objects.all() result=[] productfields = ProductFields for product in Product.objects: data={ "name":product.name, "description":product.description, # "key":product.fields.key_name, # "value":ProductFields.value, } print (data) # print(productfields.key_name) result.append(data) return Response({"products":result,"message":"list of products.","requestStatus":1},status=status.HTTP_200_OK) Output: { "description": "test description", "name": "product1" "fields":[ { "key_name" : value}, { "key_name" : value}, ] } How do I get the above-desired output? Print function doesn't work because mongoengine returns object and not the value. -
How can I set the created instance's property in Django-Rest-Framework CreateAPIView?
How can I set the created instance's property in Django-Rest-Framework? class ServerTaskCreateAPIView(CreateAPIView): serializer_class = PhysicalServerTaskCreateSerializer permission_classes = [] queryset = ServerTask.objects.all() def perform_create(self, serializer): # I want to set the ServerTask instance to be `Initialed` # like instance.task_type = "Initialed" serializer.save() You see, I tried to rewrite the perform_create method, and find there is no instance's param. how to access the requirement? -
Django staticfile not working with java
I am new using Django and I am having difficulties being able to implement javascript into my html file. <head> <title>Home Page</title> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0"> {% load staticfiles %} <link rel="stylesheet" href="{% static personal/css/bootstrap.min.css'%}" type = "text/css"/> <link rel="stylesheet" href="{% static 'personal/customcss/custom.css' %}" type="text/css" /> <script src="{% static 'personal/jquery/jquery-3.2.1.min' %}" type="text/javascript"></script> <script src="{% static 'personal/js/bootstrap.min.js' %}" type="text/javascript"></script> </head> All my files are on the static folder. The CSS is working fine but whenever I try to use javascript for a button, it isn't working. <button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbar2SupportedContent" aria-controls="navbar2SupportedContent" aria-expanded="false" aria-label="Toggle navigation"> <span class="navbar-toggler-icon"></span> </button> Thanks in advance. -
How to use `and` filter condition in queryset?
How to add other filter condition in queryset? In general, I only can filter with one condition like bellow: queryset = PhysicalServerTask.objects.filter(task_status=TASK_STATUS.GOOD) Can we filter with another condition like and? I want to filter the tast_status equals TASK_STATUS.GOOD and TASK_STATUS.WELL. How to do with that? I know I can filter TASK_STATUS.GOOD and TASK_STATUS.WELL, then merge them. But if there is a better way to access that? -
file location is broken in to characters and converted to directory when using PrivateFileField to save a file in django
I'm trying to use PrivateFileField to automatically save the file. However, I notice that the file location is broken into characters and each character is converted to a folder. Below is my model code and screenshot of the filename generated. How do i make the file location like this austrialian-capital/filename.pdf? THanks in advance model.py quote_file = PrivateFileField( _('Quote File'), help_text=_('PDF file of the quote'), upload_to='sales_quote', upload_subfolder=file_quote, blank=True, null=True, ) screenshot of the generated filename -
Django Form Wizard Render to Response on Step
I am working with the Django form wizard and i am trying to emulate the typical render_to_response('index.html',{'name', name}) but without redirect and only in the steps. So the idea would be i have a form wizard like this TEMPLATES = {"0": "MyApp/checkout_template1.html", "1": "MyApp/checkout_template2.html", "2": "MyApp/checkout_template3.html", } class MyWizard(SessionWizardView): def get_template_names(self): return [TEMPLATES[self.steps.current]] def get_context_data(self, form, **kwargs): context = super(MyWizard, self).get_context_data(form=form, **kwargs) if self.steps.current == '3': data_1 = self.get_cleaned_data_for_step('1') ((HERE I NEED TO PASS THE data_1["first_name"] TO SHOW ON NEXT TEMPLATE)) print(data_1["first_name"]) return context def done(self, form_list, **kwargs): if self.request.method == 'POST': process_form_data(form_list) return render(self.request,'MyApp/congratulations.html') then in templates id have something like this {% extends "MyApp/base.html" %} {% load staticfiles %} {% load humanize %} {% block head %}{{ wizard.form.media }}{% endblock %} {% endblock %} {% block body_block%} <div class="confirmation-body"> <div class="confirmation-body-container"> <div class="form-title-container"> <h1>Information</h1> <p>Step {{ wizard.steps.step1 }} of {{ wizard.steps.count }}</p> <form action="/checkout/" method="post">{% csrf_token %} <table> {{ wizard.management_form }} {% if wizard.form.forms %} {{ wizard.form.management_form }} {% for form in wizard.form.forms %} {{form}} {% endfor %} {% else %} <div class="checkout-title">Information</div> ////////////////////// {{ name }} #something like this that prints in the next step ////////////////////// {{wizard.form.name_on_card}} {% endif %} </table> <hr /> <div class="checkout-nav-controls"> <div> {% … -
ImportError after successful pip install
I install some lib in docker pip3.4 install after installation I received MSG Successfully installed <lib> I checked install by pip3.4 list and was in list I write code in setting MIDDLEWARE_CLASSES += (<lib>,) INSTALLED_APPS += (<lib>,) Runserver in Pycharm and I got MSG Unhandled exception in thread started by <function check_errors.<locals>.wrapper at 0x7f1b69b9b400> Traceback (most recent call last): File "/usr/local/lib/python3.4/site-packages/django/utils/autoreload.py", line 226, in wrapper fn(*args, **kwargs) File "/usr/local/lib/python3.4/site-packages/django/core/management/commands/runserver.py", line 109, in inner_run autoreload.raise_last_exception() File "/usr/local/lib/python3.4/site-packages/django/utils/autoreload.py", line 249, in raise_last_exception six.reraise(*_exception) File "/usr/local/lib/python3.4/site-packages/django/utils/six.py", line 685, in reraise raise value.with_traceback(tb) File "/usr/local/lib/python3.4/site-packages/django/utils/autoreload.py", line 226, in wrapper fn(*args, **kwargs) File "/usr/local/lib/python3.4/site-packages/django/__init__.py", line 18, in setup apps.populate(settings.INSTALLED_APPS) File "/usr/local/lib/python3.4/site-packages/django/apps/registry.py", line 85, in populate app_config = AppConfig.create(entry) File "/usr/local/lib/python3.4/site-packages/django/apps/config.py", line 90, in create module = import_module(entry) File "/usr/local/lib/python3.4/importlib/__init__.py", line 109, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 2254, in _gcd_import File "<frozen importlib._bootstrap>", line 2237, in _find_and_load File "<frozen importlib._bootstrap>", line 2224, in _find_and_load_unlocked ImportError: No module named 'silk' -
Django Conditional User Profiles
I am trying to implement multiple user roles in my Django app using a profile-like model linked to the User model. The intent is to enable/disable functionality based on the class of the linked profile. I have read examples of using the post_save signal to create a user profile linked back to the User model. What I can't figure out is how to send the post_save signal from the User model to multiple receivers with a keyword or some other attribute to perform a conditional check against. models.py --------- class AgencyOwner(models.Model): user = models.OneToOneField( User, primary_key=True, related_name='owner', on_delete=models.CASCADE ) ... @receiver(post_save, sender=User) def update_owner(sender, instance, created, **kwargs): if created and kwargs.get("owner") is True: # This fails AgencyOwner.objects.create(user=instance) instance.owner.save() I don't know if this is the appropriate solution, I looked into Groups and permissions as well but I am unsure how to create them programmatically outside of the Django admin interface. The intent is to have the roles set either at account creation or possibly by a user with the 'is_staff' flag set to True. -
Python 3.6 - Deployment to Heroku - Using Pipenv lock to add requirements falis because of a mismatch in subdependencies for the celery library
I am trying to configure my Django app for deployment to Heroku. When I attempt to lock my Pipfiles using pipenv lock --verbose I get the following error, saying that I have a mismatch in my sub-dependencies, and celery 4.1.0 could not be found. Here is the error: Finding the best candidates: found candidate amqp==2.2.2 (constraint was >=2.1.4,==2.2.2,<3.0) found candidate anyjson==0.3.3 (constraint was ==0.3.3) found candidate arrow==0.12.0 (constraint was ==0.12.0) found candidate beautifulsoup4==4.6.0 (constraint was ==4.6.0) found candidate billiard==3.5.0.3 (constraint was >=3.5.0.2,==3.5.0.3,<3.6.0) found candidate blessed==1.14.2 (constraint was ==1.14.2) found candidate bs4==0.0.1 (constraint was ==0.0.1) Warning: Your dependencies could not be resolved. You likely have a mismatch in your sub-dependencies. You can use $ pipenv install --skip-lock to bypass this mechanism, then run $ pipenv graph to inspect the situation. Could not find a version that matches celery<4.0,<5.0,==4.1.0,>=3.1.15,>=4.0 When I run pipenv graph I see that Django-celery, and Django-celery-beat both use celery as dependencies django-celery==3.2.2 - celery [required: >=3.1.15,<4.0, installed: 3.1.25] django-celery-beat==1.1.0 - celery [required: <5.0,>=4.0, installed: 3.1.25] The dependencies of these libraries call an older version of celery, when I have Celery 4.1.0. I assume that when I attempt to lock my requirements, that these must be the same? I've … -
Dynamic Django-Javascript [Beginner]
This is what I am trying to accomplish for my project. Context: Education math site Goal: When the user clicks on the "Beginners" section, he will be asked a question. The question will be processed and if it is corrcet he can press "Again" and then, another random question is asked. Each question is dynamically generated, it is stored in a view NOT a model/database. Thus I have one .html file which renders multiple views that are randomly selected (i.e. the questiosn are randomly selected to be displayed). Each question is different. Sample question "Mary has 8 apples, she eats 3. How much does she have left?" In this question, I want to make JavaScript print out 8 pictures of apples. Another question "Bob has 6 cars and buys 4 more..." In this question, I want to make JavaScript print out 4 cars etc, etc... Is it ok to have one javascript file which detects the type of question answered and generates the appropriate graphcis, or would that be bad practice as the file could get really big really fast and I'm concerned it might slow down the server. IS there a better way of doing this Can I send … -
Is including a script in the middle of a document considered an inline script?
For some reason, my CSP rejects the following as an inline script: <script src="{% static 'js/my-script.js' %}"></script> Can external scripts also be inline scripts? -
Django Q lookup search in title for strings from a list returns duplicates
sorry if my question is weird or incoherent. What I'm trying to do is this: I take the string that the user has typed out as his search input and create a list of strings from that input, and then create a loop that goes over the list and searches for each item in that list in database, let me make it a bit clearer with some code: #I take the string that the user inputs as his search query = request.GET.get('q') # I create a list by spliting the original search string query_srch = query.split() # Create a list which will later hold the items returned by the db lookup searchnews = [] #start the loop to lookup for word in query_srch: if word: searchnews += NewsPost.objects.filter( Q(title__icontains=word) ).distinct().order_by('-date') The reason why I do this is because if the title of an article in your website is "Obama: blablabla", but the user searches for "Barack Obama", the article "Obama: blablabla" will not actually come up at all. The problem is that when I do this for loop search thing, if my search query is "Obama Obama Obama", I will get a list with each article not duplicated but triplicated … -
Django - Show updated session variables in template
I'm trying to be as concise as possible in this post because I have another detailed post that has not received answers yet (trying to stay more conceptual in this post): Return updated session variables (while page is loading) through Ajax call using Django I want my webpage to load updated session variables into my index.html template while those session variables are updated server side. Currently, not until after an HttpResponse has been rendered by my view do I have access to the updated session variables. Is there a way in Django to make updated session variables available to the client before the HttpResponse is rendered? These bits of code / settings are not working to make this happen: settings.py SESSION_SAVE_EVERY_REQUEST = True views.py request.session.modified = True request.session.save() -
Save user Graphql Apollo Client
I am trying to save a user id to a new biz. I keep getting a 400 error and can not figure out why. I am using django for the backend with graphql and apollo client for the front with vue js. On my request the user ID is sent but for some reason throws a 400 bad request error. Create Biz Mutation Apollo export const CREATE_BIZ_MUTATION = gql` mutation CreateBizMutation($name: String!, $owner: ID!) { createBiz(name: $name, ownerId: $owner) { name } }` Create Biz mutation Django class CreateBiz(graphene.Mutation): id = graphene.Int() name = graphene.String() code = graphene.String() owner = graphene.Field(UserType) class Arguments: name = graphene.String() def mutate(self, info, name): user = get_user(info) or None code = ''.join(random.SystemRandom().choice(string.ascii_uppercase + string.digits + string.ascii_lowercase) for _ in range(6)) biz = Biz( code = code, name = name, owner = user ) biz.save() return CreateBiz( id= biz.id, name = biz.name, code = biz.code, owner = biz.owner ) Create Biz Component createBiz () { const owner = localStorage.getItem(DJANGO_USER_ID) if (!owner) { console.error('No user logged in') return } const { name } = this.$data this.$apollo.mutate({ mutation: CREATE_BIZ_MUTATION, variables: { name, owner } }).catch((error) => { console.log(error) }) } } -
Django 1.11: combine fields for QuerySet using Q
I'm using the DataTable Plugin to render a list of reference for "nanas" (spanis for babysitters). Right now I can filter on: nana's nombre(name) or reference's nombre(name). In adition to this I want to filter on nana's nombre + nana's apellido_paterno Doing this doesn't work: if search_value: queryset = queryset.filter( Q(nana__nombre__icontains=search_value) & Q(nana__apellido_paterno__icontains=search_value), Q(nana__numero_de_documento__exact=search_value) ) Model: class Referencia(models.Model): nombre_apellido = models.CharField(blank=False, null=False, max_length=200) telefono = models.CharField(blank=False, null=False, max_length=15) correo = models.EmailField(blank=True, null=True) direccion = models.TextField(blank=True, null=True) estado_referencia = models.IntegerField(blank=False, null=False, choices=ESTADO_REFERENCIA, default=0) nana = models.ForeignKey(Nana) comentario = models.CharField(blank=True, null=True, max_length=400) def query_referencia_by_args(**kwargs): draw = int(kwargs.get('draw', None)[0]) length = int(kwargs.get('length', None)[0]) start = int(kwargs.get('start', None)[0]) search_value = kwargs.get('search[value]', None)[0] order_column = kwargs.get('order[0][column]', None)[0] order = kwargs.get('order[0][dir]', None)[0] order_column = ORDER_COLUMN_CHOICES[order_column] # django orm '-' -> desc if order == 'desc': order_column = '-' + order_column queryset = Referencia.objects.all() total = queryset.count() if search_value: queryset = queryset.filter( # Q(nombre_apellido__icontains=search_value) | Q(nana__nombre__icontains=search_value) | Q(nana__apellido_paterno__icontains=search_value) | Q(nana__numero_de_documento__exact=search_value) ) count = queryset.count() queryset = queryset.order_by(order_column)[start:start + length] return { 'items': queryset, 'count': count, 'total': total, 'draw': draw } -
How to log GET/POSTS requests to a localfile?
I want to log the below data which is printing on console to local file. The below data is the GETS and POSTS of the apps of website and its printing on the console. I want to write it to a local log file. I am new to Django. Anyone Please guide me. [08/Jan/2018 22:25:05] "GET / HTTP/1.1" 200 5533 [08/Jan/2018 22:25:05] "GET /static/personal/css/bootstrap.min.css HTTP/1.1" 304 0 [08/Jan/2018 22:25:05] "GET /static/personal/img/logo.jpg HTTP/1.1" 304 0 [08/Jan/2018 22:25:05] "GET /static/personal/img/img_avatar2.png HTTP/1.1" 304 0 [08/Jan/2018 22:25:08] "GET /blog/ HTTP/1.1" 200 1909 [08/Jan/2018 22:25:11] "GET /contact/ HTTP/1.1" 200 1833 [08/Jan/2018 22:25:13] "GET / HTTP/1.1" 200 5533 I am using the below logging file. Am i proceeding in the right way or not. Please Guide me Thank you in advance. LOGGING = { 'version': 1, 'disable_existing_loggers': False, 'handlers': { 'console': { # Log to stdout 'level': 'INFO', 'class': 'logging.StreamHandler', }, 'file': { 'level': 'INFO', 'class': 'logging.FileHandler', 'filename': os.path.join(LOG_DIR, 'django_debug.log'), } }, 'root': { # For dev, show errors + some info in the console 'handlers': ['file'], 'level': 'INFO', }, 'loggers': { 'django.request': { # debug logging of things that break requests 'handlers': ['file'], 'level': 'INFO', 'propagate': True, }, }, } -
Django scheduler like facebook post schedule
What is the best way to schedule like a facebook post schedule in django ? Any idea or example can you guys give me ? -
RelatedObjectDoesNotExist at /admin/login/ User has no scuser
I have another site that I created which does not have this problem and is to the best of my knowledge setup the same way. Here is my models.py from the users app: from django.db import models from django.utils import timezone from django.contrib.auth.models import User from users.choices import * from django.db.models.signals import post_save from django.dispatch import receiver from listings.models import University # Create your models here. class SCUser(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE) first_name = models.CharField(max_length=50,blank=False,default='User') join_date = models.DateTimeField(default=timezone.now) university = models.ForeignKey(University,related_name='u_university',null=False,blank=False) def __str__(self): return self.user.username @receiver(post_save, sender=User) def create_user_profile(sender, instance, created, **kwargs): if created: SCUser.objects.create(user=instance) @receiver(post_save, sender=User) def save_user_profile(sender, instance, **kwargs): instance.scuser.save() Here is the error: RelatedObjectDoesNotExist at /admin/login/ User has no scuser. Here is the traceback: Internal Server Error: /admin/login/ Traceback (most recent call last): File "/anaconda3/envs/dev/lib/python3.6/site-packages/django/core/handlers/exception.py", line 41, in inner response = get_response(request) File "/anaconda3/envs/dev/lib/python3.6/site-packages/django/core/handlers/base.py", line 187, in _get_response response = self.process_exception_by_middleware(e, request) File "/anaconda3/envs/dev/lib/python3.6/site-packages/django/core/handlers/base.py", line 185, in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/anaconda3/envs/dev/lib/python3.6/site-packages/django/views/decorators/cache.py", line 57, in _wrapped_view_func response = view_func(request, *args, **kwargs) File "/anaconda3/envs/dev/lib/python3.6/site-packages/django/contrib/admin/sites.py", line 393, in login return LoginView.as_view(**defaults)(request) File "/anaconda3/envs/dev/lib/python3.6/site-packages/django/views/generic/base.py", line 68, in view return self.dispatch(request, *args, **kwargs) File "/anaconda3/envs/dev/lib/python3.6/site-packages/django/utils/decorators.py", line 67, in _wrapper return bound_func(*args, **kwargs) File "/anaconda3/envs/dev/lib/python3.6/site-packages/django/views/decorators/debug.py", line 76, in sensitive_post_parameters_wrapper …