Posts by Rafael • 477 points
36 posts
-
0
votes1
answer77
viewsQ: How to run a Script using AJAX
I have a form on a "pagina1.php" page, so: <form id="form1" action="pagina2.php" </form> After running an Ajax function, I add the following script into this form with . append():…
-
1
votes0
answers292
viewsQ: How do I refresh a page without losing the content typed in a form?
I am developing a web application using Python and Django, and at some point I need the page to be updated, but without losing the information that was typed in a form. I tried to use the script…
-
3
votes0
answers100
viewsQ: How to export . csv with Django-Tables2?
I am trying to export a table with Django-Tables2, I have done the following so far. Tables py. class ClienteTable(ColumnShiftTable): class Meta: model = Cliente sequence = ('id',…
-
1
votes1
answer50
viewsQ: Correct way to execute query in Django?
I need to execute the query SELECT pg_database_size('mydatabase'), how do I do this in Django with the SGBD Postgres? This is what I’ve tried from django.db import connection cursor =…
-
3
votes2
answers79
viewsQ: Creating routers for multiple databases in Django
I am developing a Django application where I need several Databases, one for each user of the system. For this I set the Databases like this: DATABASES = { 'default': {}, 'primary': { 'NAME':…
-
2
votes0
answers182
viewsQ: Problem with success_url in Django
In views I have the following classes class AdicionarPessoaView(CustomCreateView): template_name = "cadastro/adicionar.html" form_class = PessoaForm model = Pessoa obj = Pessoa.objects.all().count()…
-
1
votes0
answers43
viewsQ: How to know how much storage was occupied by a Python/Django application?
I developed a web application with Python and Django. I would like to limit the amount of space used for each user, because in the application it is possible to insert images and documents. I use…
-
1
votes0
answers33
viewsQ: Create Django app backup automatically
I developed a web application in Python and Django and I need to backup the data daily. Currently, I used the Postgres like SGBD. To perform the backup I discovered the module django-dbbackup, but…
-
1
votes0
answers15
viewsQ: Problem reading . csv in Python/Django
I am trying to create a new person from a .csv. file My code is as follows:. models TIPO_PESSOA = [ ('PF', 'Pessoa Física'), ('PJ', 'Pessoa Jurídica'), ] class Pessoa(models.Model):…
-
1
votes0
answers357
viewsQ: Import . csv file with Python/Django
models TIPO_PESSOA = [ ('PF', 'Pessoa Física'), ('PJ', 'Pessoa Jurídica'), ] class Pessoa(models.Model): nome_razao_social = models.CharField(max_length=255) tipo_pessoa =…
-
1
votes3
answers222
viewsQ: Show div after a certain amount of input digits
$(document).ready(function () { $('#textFind').click(function () { $('.pesquisas').toggle(200); }); }); $(function () { $.expr[":"].contains = $.expr.createPseudo(function (a) { return function (e)…
-
1
votes2
answers56
viewsQ: Show div containing search content
I created a search button and some search options within the Divs .opcao. How do I make it so that only the divs where the contents of the button contain the words typed in the search field? For…
-
5
votes1
answer742
viewsQ: Difficulty performing data CRUD with Fullcalendar and Django/Python
I’m trying to use the FullCalendar in my project Django and I’m having a hard time doing the data crud. I would like everything to work on the same screen, that is, when the user selects dates in…
-
0
votes1
answer330
viewsQ: Change chart language Amcharts
I have the following chart // Themes begin am4core.useTheme(am4themes_animated); // Themes end // Create chart instance var chart = am4core.create("chartdiv", am4charts.XYChart); // Add data…
-
1
votes0
answers32
viewsQ: Select multiple in Python and Django
I have a class Lancamento and a class Plano de conta. Plano de conta is a secondary Launch key, ie I register account plans and when registering a launch I select an account plan. For that, I did so…
-
0
votes1
answer233
viewsQ: Delete Intellij file permanently
I created a file File of the kind Text when it should be a file .py. After trying to rename the file to .py or delete it the IDE cannot identify the extension by not identifying my code. How do I…
-
0
votes1
answer112
viewsQ: Create database and superusers automatically with Django
I developed a system with Python and Django. Now I would like to make it available on the web so that users can create accounts on the system, for this it would be necessary that each user has their…
-
1
votes0
answers61
viewsQ: Amcharts chart with two lines and zoom
I’m using this chart on my page: // Themes begin am4core.useTheme(am4themes_animated); // Themes end // Create chart instance var chart = am4core.create("chartdiv", am4charts.XYChart); // Add data…
-
0
votes0
answers109
viewsQ: Problem with Static files in Django project deploy on Digitalocean
I deployed a project Python and Django in the Digitalocean, but I’m having trouble with static files Inside my project, in the folder static when typing the command pwd to see the full file path, I…
-
0
votes1
answer85
viewsQ: Show specific attribute in Select using Python and Django
In models.py created the following tables: class UsuarioAdicionalPlano(models.Model): quantidade = models.PositiveIntegerField(primary_key=True) preco = models.DecimalField(decimal_places=2,…
-
0
votes1
answer245
viewsQ: Save . doc file in database with Django
I’m developing an application with Djando and Python. In models.py, to create an object cliente with a name, for example, I do the following: class Cliente(models.Model): nome =…
-
3
votes1
answer359
viewsQ: How to use back-end information on the front end with Python and Django?
In my code Python I create an object called status as follows: In Forms/status.py class StatusForm(forms.ModelForm): class Meta: model = Status fields = ('status', 'posicao') widget = { 'status':…
-
0
votes1
answer44
viewsQ: Python code in html is not working properly
I’m using Python and Django for a web application, at a certain point I make the following code in the html: {% for oportunidade in all_oportunidades %} <a>{{oportunidade.categoria}}</a>…
-
1
votes1
answer267
viewsQ: How to transform the width of an 'infinite' div?
I’m creating an application with multiple columns, each column with multiple labels. On the screen fit approximately 5 columns, at most, after that they start again under the others, like this.…
-
1
votes1
answer98
viewsQ: Show value, not form ID
I’m making a system using Python and Django. At one point, I’m showing a table with database information. Follow my html: <tbody> {% for oportunidade in all_oportunidades %} <tr…
-
2
votes0
answers125
viewsQ: How to create a view in a Django project with Python? I’m having errors
I’m a beginner in Django. I’m continuing a ready-made project in Django. I’m looking to add a schedule to the project using Full Calendar. For this I already developed the template with the html…
-
3
votes2
answers278
viewsQ: Change the size of a chart with JS
I have the following chart: window.onload = function() { var can = document.getElementById('canvas'), spanProcent = document.getElementById('procent'), c = can.getContext('2d'); var posX = can.width…
-
4
votes1
answer1486
viewsQ: Encoding problem in Python
At one point in my code I receive a variable var of type str containing SENTEN\u00c7A. in making var2 = var.encode() print(var2) is printed b'SENTEN\\u00c7A' The original word would be 'SENTENCE' In…
-
1
votes1
answer1258
viewsQ: How to fix the percentage on top of the chart using Chartjs?
I have the following chart: var chartData = [{"visitor": 39, "visit": 1}, {"visitor": 18, "visit": 2}, {"visitor": 9, "visit": 3}, {"visitor": 5, "visit": 4}, {"visitor": 6, "visit": 5}, {"visitor":…
-
1
votes1
answer552
viewsQ: How to add caption to a chart using Chartjs?
I created the following chart: var data = [ { value: 300, color:"#F7464A", highlight: "#FF5A5E", label: "Red", subtitle: "texto" }, { value: 590, color: "#46BFBD", highlight: "#5AD3D1", label:…
-
0
votes2
answers311
viewsQ: Deploy Python project to Heroku with error
I’m trying to deploy a Python project using Django on Heroku. deploy is fine, but when trying to do heroku run python manage.py migrate the following error occurs. Traceback (most recent call last):…
-
1
votes0
answers162
viewsQ: Django project deploy on Heroku with errors
When trying to deploy my Python project using Django on Heroku, I am getting the following error. Counting objects: 3, done. Delta compression using up to 4 threads. Compressing objects: 100% (2/2),…
-
1
votes1
answer347
viewsQ: Scraping data using Robobrowser
I’m trying to scrape a form, to insert an attachment and submit, using Robobrowser. To open the page I do: browser.open('url') To get the form I make: form = browser.get_form(id='id_form') To enter…
-
1
votes1
answer818
viewsQ: Boostrap overwriting CSS. How to avoid?
I took a CSS ready template from the internet to choose a payment method for my site. Below is the link to it. https://codepen.io/cusx/pen/aNqQdQ However, when importing the header and footer (I am…
-
-1
votes1
answer121
viewsQ: Online software hosting using python and Django
I am developing a small ERP management software in Python and using the Django framework, so I had to install some requirements. How do I host this system? Is it like a website? What are the…
-
0
votes1
answer500
viewsQ: Change the value of the checked attribute of an input type='radio'
I have two radio inputs <input id="tab-1" type="radio" value="juridica" name="tab" class="sign-in"><label for="tab-1"class="tab">Jurídico</label> <input id="tab-2" type="radio"…