Questions tagged as 'django'

1
answer

Disconnect another django user

Good Morning I made a control of user sessions through login and logout: In login before logging it does an insert in my table: cursor.execute("INSERT INTO usuarios_sessoes (usuario, datahorainicio) VALUES ('%s', '%s')" % (str(username),timezo...
asked by 23.10.2018 / 15:09
0
answers

Calling HTML snippet in JavaScript

I'm using Django FrameWork for an application that searches videos on youtube. But there is an excerpt from JS, which calls an html where you "embed" the searched video. And I'm not sure how to create this route in Django. JS looking for the...
asked by 16.10.2018 / 01:08
0
answers

Search with GET not working

To make a system that looks for items in the system's internal database, and in API's like Youtube. The search should return videos (youtube) and data (internal database). The Youtube API is in JavaScript, and when I click Search, it only return...
asked by 22.10.2018 / 18:59
0
answers

Problem making a GET on my site when it is entered via www (react + django)

I have a django application that uses React on some of its pages (not two separate servers). In my pages in React, I make HTTP requests to django by api using Django Rest Framework. This application is already in the air, and in it I noticed...
asked by 10.10.2018 / 21:48
0
answers

Delete item from list in tempate

Hello, I have a template that shows me the items I want to donate and a final step where I confirm or delete any of these items views.py def confirm_donation(request, id): donation = get_donation(id, request.user) if n...
asked by 09.10.2018 / 18:40
0
answers

Deploy in Heroku with error for Django 2.0

Hello, I have been trying to deploy my web app for a few days, but it is giving the following error in the heroku logs: 2018-10-04T17:20:13.712363+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/django/apps/registry.p...
asked by 04.10.2018 / 19:35
0
answers

Make a sum of the items in the shopping cart

I need to sum the prices of all shopping cart items to appear on the cart page, follow the link in my application on Heroku - link I wanted some help to do this in the best way. Follow the models and my View just below. Models Add Ite...
asked by 03.10.2018 / 21:18
0
answers

'UserAdminCreatinForm' object has no attribute 'get' Django

I was trying to send data from a user to the database and received the following error. fromdjangoimportformsfromdjango.contrib.auth.formsimportUserCreationForm#fromdjango.contrib.authimportget_user_modelfromdjango.contrib.auth.formsimportReadO...
asked by 09.10.2018 / 21:40
0
answers

Display relationship field 0x1, object of a filter, in a Django view

I am not able to access a field of a relationship in filter, I am bringing the objects through the context of a DetailView.    View Server class HistoricoProgressoes(DetailView): model = Servidor def get_context_data(self, **kwargs):...
asked by 01.10.2018 / 22:14
1
answer

How to capture multiple HTML values with django forms

In order for html to send a field of type select with multiple values selected it is necessary to put the [] notation in the name attribute of html : <select name="categories[]" multiple="multiple" class="form-input__se...
asked by 26.09.2018 / 15:59