Questions tagged as 'django'

1
answer

Problem when migrating with Python and Django: no such column: forum_thread.slug

I have this problem in my code: OperationalError at /admin/forum/thread/ no such column: forum_thread.slug I've tried to make a million changes and I could not. When I run the command python manage.py makemigrations it return...
asked by 03.06.2017 / 10:26
1
answer

Platform for creating online courses Python and Django

I'm setting up an online course building platform, and I'm using Python and Django. I would like to know if there are already Django libraries for this purpose. One example I'm using is the Taggit library that exists to assist in creating forums...
asked by 01.06.2017 / 20:27
1
answer

2 types of products in the same view

How can I list 2 product types in index (Pizzas and Drinks) by defining an order by and dividing% divs of the pizzas), follow what I have: class IndexListView(ListView): model = Product template_name = 'inicio.html' con...
asked by 21.04.2017 / 17:37
1
answer

Get the user logged in form

Hello! I need to get the user that is logged in to my application, because in the form I have fields modelChoice, and the query need to bring by logged in user, as shown below: Note: I work with class based view. Obs2: Django 1.10 from d...
asked by 30.03.2017 / 16:12
0
answers

MultipleObjectsReturned

When I create two topics with the same name, the error: MultipleObjectsReturned class ForumView(ListView): paginate_by = 5 template_name = 'forum/forum.html' def get_queryset(self): queryset = Thread.objects.filter()...
asked by 27.03.2017 / 22:29
0
answers

Create super user inside a docker container that is used with composite

I have a django project that is running with docker-compose, what I need to do and very simple, run python manage.py createsuperuser, however, even setting the command via dockerfile or compose .yml I can not create this super user , does anyone...
asked by 28.03.2017 / 05:07
0
answers

django permission

Good afternoon, I'm wanting in the template to make a loop to disable a button according to custom permission. The model code is: # -*- coding: utf8 -*- from __future__ import unicode_literals from django.db import models from django.contrib.a...
asked by 13.03.2017 / 21:36
1
answer

Problem with form Django: IntegrityError: NOT NULL constraint failed

I'm trying to make a form using Django's model that saves the data when I click the button and redirects it to a page, I managed to make the form page, only after putting the necessary data and clicking the button to save I get the following err...
asked by 06.03.2017 / 04:56
0
answers

Python web application with Django - Bootstrap and Crispy only work if you have an internet connection

My application uses these two frameworks Boostratp and Crispy, when I'm connected on the internet, everything works perfectly, however when disconnecting the internet the site loses all part of style. By doing a comparison with Java, I use Jq...
asked by 05.03.2017 / 14:46
1
answer

Render items with Django Forms. Three Models Involved, Single Forms

Hello, I'm having trouble rendering my model items. The system works as follows: User registers an exam Exame . Within each exam you have the exam types ItemExame User generates a report Laudo that pulls the pati...
asked by 25.02.2017 / 18:08