Questions tagged as 'django'

1
answer

Is the migration folder uploaded to github?

I have a question about what I'm uploading to github, it's precisely from the migrations folder, is that folder up? I'm talking about this folder:    myapp / migrations     
asked by 26.10.2016 / 21:07
1
answer

Create a ListView and DetailView with two models

I have 2 models that are related to a OneToOneField , but I do not know how to access the 2 models, my view is as follows: class ListaSolicitudes(ListView): model = Modelo1 #aqui recibe un solo modelo, como uso el segundo modelos...
asked by 07.03.2018 / 18:09
1
answer

how to generate a csv of users in Django?

I have a problem trying to generate a CSV file with all registered users to export it. def descargar_usuarios(request): perfiles = Perfil.objects.all() response = HttpResponse(content_type='application/csv') with open('usuarios.csv','wb') as f...
asked by 05.03.2018 / 11:53
1
answer

NoReverseMatch at / accounts / register u'cuentas' is not a registered namespace

I'm working with Django 1.10 and I just created a user registry but when I click save it does not redirect me to the cuentas:home page: User registration <form method="post"> {% csrf_token %} {{ form.as_p }} <but...
asked by 20.02.2018 / 16:03
1
answer

NOT NULL constraint failed: django

I'm getting an error when I try to create a new element by a form, trying that the user who is already with the session started can upload an image and it is recognized as his in the relationship with the base of data that I have in models.py...
asked by 29.08.2017 / 06:18
1
answer

Validate a form with django

I'm on my first project mounted on a server and I've chosen the django framework. I'm making an application that shows values from a mineral database that I've made, and that has a search field with the form tag: <div class="container" styl...
asked by 14.11.2017 / 21:43
1
answer

Listing existing objects and search results in Django

I have the model LodgingOffer with its respective Manager. About I want to do some searches, for which I am using solr and haystack LodgingOfferManager has the active function () to retrieve the active objects of...
asked by 19.01.2018 / 04:47
1
answer

python.exe or py.exe in Windows? [closed]

I'm using Python 2.7 in a virtual environment, but do not let me run the python console in the normal way, but: instead of using python manage.py runserver I must use py manage.py runserver Does anyone know what it is?   ...
asked by 21.04.2017 / 07:11
1
answer

Problem uploading file with Django

I just started working with Django 1.11. I am trying to upload a file using a form. I leave some samples of my code below. First my form in forms.py: class UploadFileForm(forms.Form): title = forms.CharField(max_length=50, label='Titulo...
asked by 26.05.2017 / 17:29
1
answer

Send preferred data to MercadoPago with Django

I'm doing a page in Python 3.4 and Django 1.7, using MercadoPago's basic checkout, but I want to send more info from the buyer than what the basic proposes, but I get the error that is not serializable. I need to send the following information:...
asked by 20.01.2017 / 20:25