App name error in django

0

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!

    
asked by anonymous 04.02.2017 / 04:48

1 answer

1

It seems that Django 1.10 is not installed properly, because the render does not even have this current_app argument in this version. Uninstall Django, and install again, but not using the cache, with the following commands:

$ pip uninstall -y Django

$ pip install Django --no-cache-dir
    
06.02.2017 / 19:55