When Trying to perform:
python manage.py makemigrations, Im having this console output:
Traceback (most recent call last):
File "manage.py", line 21, in <module>
main()
File "manage.py", line 17, in main
execute_from_command_line(sys.argv)
File "/usr/local/lib/python3.6/dist-packages/django/core/management/__init__.py", line 419, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python3.6/dist-packages/django/core/management/__init__.py", line 413, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python3.6/dist-packages/django/core/management/base.py", line 354, in run_from_argv
self.execute(*args, **cmd_options)
File "/usr/local/lib/python3.6/dist-packages/django/core/management/base.py", line 393, in execute
self.check()
File "/usr/local/lib/python3.6/dist-packages/django/core/management/base.py", line 423, in check
databases=databases,
File "/usr/local/lib/python3.6/dist-packages/django/core/checks/registry.py", line 76, in run_checks
new_errors = check(app_configs=app_configs, databases=databases)
File "/usr/local/lib/python3.6/dist-packages/django/core/checks/urls.py", line 40, in check_url_namespaces_unique
all_namespaces = _load_all_namespaces(resolver)
File "/usr/local/lib/python3.6/dist-packages/django/core/checks/urls.py", line 57, in _load_all_namespaces
url_patterns = getattr(resolver, 'url_patterns', [])
File "/usr/local/lib/python3.6/dist-packages/django/utils/functional.py", line 48, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File "/usr/local/lib/python3.6/dist-packages/django/urls/resolvers.py", line 602, in url_patterns
patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
File "/usr/local/lib/python3.6/dist-packages/django/utils/functional.py", line 48, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File "/usr/local/lib/python3.6/dist-packages/django/urls/resolvers.py", line 595, in urlconf_module
return import_module(self.urlconf_name)
File "/usr/lib/python3.6/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 994, in _gcd_import
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 678, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/home/jaodev/ftp/files/CallServiceBackEnd/callservices/urls.py", line 19, in <module>
from callserviceapp.views import Buscar, addRubro, agregarFotoOrden, askPersonalInfo, cambiarEstadoOrden, chatMensaje, chatSinLeer, chatVer, completeInfo, completeInfoRubros, consultarOrdenParticular, consultarOrdenes, consultarTodasLasOrdenes, consultarTodasLasOrdenesCanceladas, consultarTodasLasOrdenesCurso, consultarTodasLasOrdenesFinalizadas, datosCliente, datosProveedor, deleteRubro, finalizarOrdenCliente, finalizarOrdenProveedor, homeCliente, homeClientePedirDatos, login, masInfoOrdenCliente, masInfoOrdenProveedor, modificarRubro, nuevaInfoPersonal, pedirOrdenEmergencia, pedirOrdenGeneral, presupuestoCliente, presupuestoProveedor, proveedorUbicacion,register, requestRubros, restarPassword, setNewPassword, verReseñas
File "/home/jaodev/ftp/files/CallServiceBackEnd/callserviceapp/views.py", line 359
de
^
SyntaxError: invalid syntax
At views.py, line 359, there is this function:
@csrf_exempt
def nuevaInfoPersonal (request):
if request.method == 'POST':
if(request.POST.get("tipo")=="1"):
objetos=client.objects.filter(email=request.POST.get("email"))
if not objetos:
return HttpResponse("no ha sido posible")
else:
email=objetos.first().email
password=objetos.first().password
objetos.first().delete()
new=client()
new.email=email
new.password=password
new.name=request.POST.get("nombre")
new.last_name=request.POST.get("apellido")
new.picture= request.FILES.get("image")
new.qualification=request.POST.get("calificacion")
new.save()
return HttpResponse("ok")
if(request.POST.get("tipo")=="2"):
objetos_=serviceProvider.objects.filter(email=request.POST.get("email"))
if not objetos_:
return HttpResponse("no ha sido posible")
else:
email=objetos_.first().email
password=objetos_.first().password
objetos_.first().delete()
new=serviceProvider()
new.email=email
new.password=password
new.name=request.POST.get("nombre")
new.last_name=request.POST.get("apellido")
new.picture= request.FILES.get("image")
# new.imagen_promocional= request.FILES.get("imagenPromocional")
new.save()
return HttpResponse("ok")
if(request.POST.get("tipo")=="3"):
objetos=company.objects.filter(email=request.POST.get("email"))
if not objetos:
return HttpResponse("no ha sido posible")
else:
email=objetos.first().email
password=objetos.first().password
objetos.first().delete()
new=company()
new.email=email
new.password=password
new.company_name=request.POST.get("nombre")
new.company_description=request.POST.get("descripcion")
new.picture= request.FILES.get("image")
# new.imagen_promocional= request.FILES.get("imagenPromocional")
new.save()
return HttpResponse("ok")
else:
return HttpResponse("bad")
But I can’t see what is wrong with it.