Questions tagged as 'django'

2
answers

How to call a method of views in html?

I created the following method in the views.py file: def home(request): name = 'Jacinto' args = {'myName' : name} return render(request, 'accounts/home.html', args) I want to now call this function that redirects me to the home.htm...
asked by 11.01.2018 / 16:29
1
answer

Search with OR in Django

Hello, I'm developing my 1st application in Django and I'm having difficulty with more complex DB queries. Here's my MODEL: class Tag(models.Model): objects = GChartsManager() idtag = models.IntegerField(db_column='idTAG', primary...
asked by 17.06.2015 / 00:07
1
answer

Error in CSS - Django FormField

I'm giving the following error in my Django 1.9 form Notice that the label has the :> at the end. I DO NOT WANT THE GREATEST SIGN (>) AT THE END OF LABEL Ex: Nome: > Followmycodeforms.pyclassFormContact(forms.Form...
asked by 17.02.2016 / 02:04
1
answer

Creating generic log table for various Django models

I have 30 models. Each one contains information from a calculator and each record is information from sub calculators. I need to create a table of logs of each calculation made by the user. Currently I'm saving JSON what the guy says and savi...
asked by 29.10.2018 / 16:18
1
answer

Django map dynamically generated tables by another application

I will develop an application with Django where you will need to query data in a database that is powered by an ERP (desktop). This ERP generates some movement tables by adding at the end of the table name the month and the year, as a kind of...
asked by 02.10.2018 / 03:05
1
answer

Integrate RDStation with Django + Python to send lead

Good morning guys, I have a problem: I have an LP that has to save the lead in the Postgres database and automatically send that lead to the RD platform using their API. Using the curl I do as follows: curl -v \ -X POST \...
asked by 26.09.2018 / 16:12
1
answer

TimeField presentation format in Django

class Passagem(models.Model): inscricao = models.ForeignKey(Inscricao, verbose_name='inscricao', related_name='passagem', on_delete=models.CASCADE) hora_passagem = models.TimeField('Tempo', auto_now_add=True)...
asked by 05.11.2018 / 17:59
2
answers

Password Validation with Python

I have the following requirement to validate a password in the registry: Size: 10 characters Uppercase: 2 Lower case: 2 Number: 1 Symbol: 2 How do I do this with python? For the time being I have only been able to do this, sinc...
asked by 08.03.2018 / 14:52
1
answer

Start a virtualenv with .bat file

I have the following .bat cd C:\Users\SERVIDOR-ARQUIVOS\Documents\workspace\email\.venv\Scripts activate.bat cd C:\Users\SERVIDOR-ARQUIVOS\Documents\workspace\email\src python manage.py (comando personalizado) It goes to the folder but clos...
asked by 19.02.2018 / 21:49
1
answer

Total values in django template

I'm developing a forum that in the index page I need to show the subject, how many topics have this subject and how many posts, I even get back number of topics, but only shows the topic with the subject id 1, for example if you have subject 2 w...
asked by 26.11.2017 / 03:26