Most voted "django" questions
Django is an open source Web 2.0 application framework written in Python. Its main objective is to facilitate the creation of complex database websites.
Learn more…1,067 questions
Sort by count of
-
0
votes0
answers202
viewsCreate a table in Django’s User models!
Well, I would like to create a column in the User models table of Django, because I would like to get the password before Django turns into sha256, because I want to display it in the browser…
-
0
votes1
answer744
viewsUsing search and pagination field with Function Based View in Django
I have the following code: #decorators.py from django.contrib.auth.decorators import user_passes_test def superuser_required(func): return user_passes_test( lambda u: u.is_authenticated() and…
-
0
votes1
answer62
viewsGrouping only by Manytomany’s first item in Django
I have two tables: Author and Book where Book has an Author = ManyToManyField Note the examples with A1 (author one) and L1 (book one), so on. Author - Book A1 - L1, L2, L3 A2 - L1 A1 - L3 A1 - L1…
-
0
votes1
answer80
viewsDjango-import-export outside Admin
Does anyone know how I would use the Django-import-export outside the Admin? That is, I wanted the button to export this library in a template of mine, outside of Admin. Which way to the stones? I…
djangoasked 8 years, 3 months ago Regis Santos 1,574 -
0
votes0
answers35
viewsDoubt on converting SQL to Django ORM
Hello! I am studying starting in Django ORM and would like help to convert the SQL below as I am not able to perform the necessary junctions. Follows: SELECT P.nome, T.nome FROM professor as D INNER…
-
0
votes0
answers20
viewsDjango Rest Framework retrieves Empty values Instead of null when using Oracle DB
I’m using Django Rest Framework, so when i Insert a field with null value [POST Model], it retrieves it with an Empty value [Get Object Detail]. Why does it happen?
-
0
votes1
answer738
viewsPassing an array via Ajax to view Django
I plan to pass an array via Ajax to my Django view, but there is always an error stream_or_string = stream_or_string.read() Attributeerror: 'Nonetype' Object has no attribute 'read' $.ajax({ url:…
-
0
votes1
answer354
viewsInner Join ORM Django
I have 2 models: class MdlCourse(models.Model): id = models.BigAutoField(primary_key=True) category = models.ForeignKey(MdlCourseCategories, on_delete=models.CASCADE) sortorder =…
-
0
votes2
answers1736
viewsHow to call a view method 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 now want to call this function…
-
0
votes2
answers1513
viewsHow to save Base64 in Imagefiled Django / data:image/jpeg;Base64,?
I’m trying to save a Base64 image on my model , but not getting. My code is; Model: class Image(models.Model): img = models.ImageField(upload_to = 'pic_folder') view: @csrf_exempt def…
-
0
votes1
answer59
viewsError updating form with Imagefield
When registering a new record with upload saved normally, but updating shows the following error: I gave a print on var picture and when registering a new image shows.png, but when updating it…
djangoasked 8 years, 2 months ago Thiago Porto 292 -
0
votes1
answer95
viewsChanging the place templates (Django)
I was trying to leave the templates folder (main) out of the 'core' folder because I actually wanted to leave the 'templates' and 'Static' folder out of the 'core' folder'. Check out my project on…
-
0
votes1
answer708
viewsStart a virtualenv with file . bat
I got this . 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…
-
0
votes1
answer74
viewsDjango admin line conditional background color fill
I am wanting to color an entire row of a table, if the respective column of that row has some text, there are three possible situations: 1. the text itself, 2. fields with a "-", 3. fields with…
-
0
votes1
answer692
viewsPlace data from a spreadsheet in Excel in the database
The database here of the company generates a report in Excel, I need to save this data in a database, initially sqlite3, to be able to display this data in a Django template in the future. Example…
-
0
votes1
answer197
viewsReportlab - Python - Doubt with date writing (date)
Guys I’m having doubts in the reportlab. Python 3 Application / Django I have a model Pessoa that contains a field data de nascimento who’s kind DateTimeField. I’m trying to write the date of birth…
-
0
votes1
answer1019
viewsPass a GET parameter through the Django view
i am trying to pass a parameter via GET in the URL through the Django backend, but I’m not getting it. My url to the page I want to pass the parameter to is…
-
0
votes1
answer51
viewsMultilingual site
I’m trying to put a site made in Python/Django as multilingual, but I could not understand how to actually do with the documentation or what I found on the Internet, I even found one here in…
-
0
votes1
answer27
viewsDjango 2 Template missing
In my project I have a project with 2 apps. The first app is learning_logs which has a template, base.html The second app is users, I’m trying to use the learning_logs template on users as follows:…
-
0
votes1
answer251
viewsHow do I insert data into a foreign key table in Django?
class Endereco(models. Model): cep = models.IntegerField('cep', max_length=10) rua = models.CharField('rua', max_length=100) numero = models.CharField('numero', max_length=10) bairro =…
djangoasked 6 years, 6 months ago Vinicius Soares 1 -
0
votes1
answer228
viewsLookuperror: No installed app with label 'core'
Initially the project used Django 1.7 but I am migrating it to Django 1.10.3, but when I try to use migrate it informs this error that 'core' is not installed, unfortunately there is no core…
djangoasked 7 years, 12 months ago user53006 -
0
votes1
answer45
viewsProblems configuring views using Jango
I’m studying Jango and I’m having problems in the following part {'posts': posts} I’m using as ide pycharm and it shows error but for me the syntax of the code is correct. from django.shortcuts…
-
0
votes2
answers121
viewsGenerate querysets from dynamically generated rules
I’d like to make a sort of filter using Django. Imagine the following case: Model: user (Name, sex, age, dia_nasciemnto, mes_nascimento, etc) Rule: Catch all users with Sex=M and Age>20 The…
-
0
votes2
answers159
viewsDjango - No User Matches the Given query
Good afternoon, I’m new to Django and I’m making the following mistake: I can’t access admin. I’ve checked the url several times and it’s all right. Until a day ago I was accessing the admin…
-
0
votes1
answer120
viewsProblem creating environment with Django
I’m trying to create a project in virtualwrapper environment with virtualwrapper tool, in this environment I installed Jango but when trying to create a project with the command django-admin…
-
0
votes1
answer34
viewsDjango 1.10 + Django Restless 0.0.10 and Empty Request
I’m using Django Restless views to build some REST interfaces and in all posts the request.POST and request.params are empty. In case I run: print request print request.POST I have the following…
-
0
votes2
answers1323
viewsPIP does not work in virtualenv
After activating the virtutalenv Pip does not work, I get the following error wilker@debian:~/Documentos/Git/Curso Django/Blog$ source bin/activate (Blog) wilker@debian:~/Documentos/Git/Curso…
-
0
votes1
answer127
viewsbackground-image: url( with a URL that has parentheses with Django template
I have a div as follows: <div style='background-image: url({{ OBJETO.URL }})' class="video-thumb"></div> Where Objeto.url deliver a string like this:…
-
0
votes0
answers57
viewsDjango Modelform with checkbox value --------
Good night! How do I remove ---------- from my form, in some options I put a default on the model but for this option I can’t do that, how can I solve this problem?…
djangoasked 6 years, 5 months ago Diogo Silva 1 -
0
votes1
answer38
viewsHeroku Login Error: Cannot read Property 'body' of Undefined
Hello! I am getting the following error when trying to log in. heroku login heroku: Enter your login credentials Email: ########@gmailTypeError: Cannot read property 'body' of undefined at new…
-
0
votes1
answer55
viewsErrors in Django server validation?
I am putting the runserver Manage.py and gives these errors in the folder of the site packges. It has happened to you?…
-
0
votes1
answer345
viewsInstalling Django with Python3
I received a project to be done only with Python in v.3.4+ and I’m not getting Django to work in versions other than 2.7. Does anyone know a link that teaches the entire installation of Django in…
-
0
votes1
answer30
viewsError running project migrated from Django 1.7 to Django 1.10
I am migrating a project done in Django 1.7 to Django 1.10, when I try to run the project I get the error: The view core.config.views.home didn’t Return an Httpresponse Object. It returned None…
djangoasked 7 years, 10 months ago user53006 -
0
votes1
answer94
viewsDjandorestframework standardize endpoints for methods with different permissions
I am using Django 1.10 with DRF lib. I created an Endpoint /api/contact/ and in this endpoint I apply 2 methods (GET and POST), and GET can only be viewed with permission, and POST can be requested…
-
0
votes0
answers229
viewsEmail attachment file with file upload in Django
I need to send a request.FILES file from a File field as an attachment in the email. I’m following topics that teach this, but it’s not working. Django from my project is 1.5 I’m doing it this way:…
djangoasked 7 years, 10 months ago Karl Zillner 873 -
0
votes1
answer2052
viewsHow to create a local network (intranet) with Django?
I’m racking my brain, I’ve tried several and several tutorials gringos and nothing works with excellence. I have a system made in Django on a common computer (windows 10) and I’m trying to leave the…
-
0
votes1
answer441
viewsHow to clear the fields of a form in Django
I’m studying Django and I’m following a course, which is the creation of a Spending Control. However I am not being 100% faithful to the course, I am making some modifications. My problem is this,…
-
0
votes2
answers111
viewsList in HTML table separated by category
I am in a development using Python and Django and as IDE pycharm. I have a list coming via Rest by mobile, with the name 'Athletes', and comes with the columns "name", "category", "time". I would…
-
0
votes1
answer503
viewsImport attributes from models classes from another app
Good afternoon guys, I’m good a doubt! I am using 2 Apps in Django admin App1 = Registrations App2 = Controlling Fellows I imported into "Stock Changers" (App2) the app1 model, the "Person" class in…
-
0
votes1
answer42
viewsApp name error in Django
In my views, 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…
-
0
votes0
answers20
viewsVery slow M2M loading on Django
In some tables I use Many to Many, and as the bank has been growing its loading time is increasing (which is obvious), I got an alternative to the load, which is raw_id_fields, however it does not…
-
0
votes1
answer422
viewsADD Column - Django
How can I add a column to a table in the database using Django? I tried the following migration and did not update my table: from Django.db import models, Migrations class…
-
0
votes2
answers152
viewsIs it possible to compare two variables coming from a view in Django?
Well, I want to compare two variables coming from a view on Django. I’m doing one for and iterating and comparing a Charfield value (student.matricula) with another Charfield (frequencia.matricula)!…
-
0
votes1
answer104
viewsQueryset model Category, Product and Productimage
Hello, help me assemble this queryset. Briefly the model model.py class Category(models.Model): name = models.CharField('Nome', max_length=100) slug = models.SlugField(max_length=100, unique=True)…
-
0
votes1
answer41
viewsReorder elements of a query on the screen
I have an application in Django and need to reorder the screen elements when the user decides to sort by date, popularity, etc.. I would not like to submit a new query each time the user selects a…
-
0
votes1
answer466
viewsDjango: Local Postgresql and Heroku?
I would like to use Postgresql locally and on Heroku. How I set up mine settings.py to know which configuration to use? I’ve tried putting it as an environment variable, but I haven’t been able to.…
-
0
votes3
answers280
viewsHow Django URL works
I’m developing a Jango website. Where I own these two structures main from django.contrib import admin from django.urls import path, include from post import views urlpatterns = [ path('admin/',…
-
0
votes1
answer44
viewsPython 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>…
-
0
votes0
answers58
viewsDinamic url assumes user logged in to visuzaliation
I have a system that when the user is logged in the top menu that is fixed appears the photo and his name, plus the options since he is logged in, so far so good. and I’m using dynamic url to do…
-
0
votes2
answers783
viewsSet the User logged in to the model as default | Django + Python3
I am trying to learn Django, and with this I am trying to create a simple system of tickets. I have made a lot of progress in my studies, but now I’ve tackled the following problem. How to do by…