In my views, from django 1.10, I have the code:
from django.shortcuts import *
from appcrud.forms import *
def inicial(request):
if request.method == "POST":
form = FormCrud(request.POST)
if form.is_valid():
form.save()
else:
form = FormCrud()
return render(request, "index.html", {"form": form})
O forms:
from django import forms
from appcrud.models import *
class FormCrud(forms.Form):
name = forms.CharField(max_length = 150)
profissao = forms.CharField(max_length=150)
and the model:
from __future__ import unicode_literals
from django.db import models
from mongoengine import *
class Cruds(Document):
name = StringField(max_length=150,required=True)
profissao = StringField(max_length=150)
The server works normally but this error appears on return:
__init__() got an unexpected keyword argument 'current_app'
Request Method: GET
Request URL: http://localhost:8000/inicio/
Django Version: 1.10.3
Exception Type: TypeError
Exception Value:
__init__() got an unexpected keyword argument 'current_app'
Exception Location: C:\Anaconda2\lib\site-packages\django\shortcuts\__init__.py in render, line 49
I'm setting up the project to use mongodb, would you know to answer me?
Thank you for your attention!