Questions tagged as 'django'

1
answer

Convert to list a string from a list that contains base64?

I get a json request with a request.POST that comes as a base64 string list. I can convert to string with str(request.POST['imagem']) which results something like this:   <   ...] With the AST library on any other li...
asked by 25.05.2016 / 20:54
1
answer

How to access a local server from an Android device

I have a server in Django running on my computer "localhost: 8000 / posts", and I'm creating an Android client to access it. Debugging my application on a real device, I tried to access my IPv4 knowing that both the computer and the cell phon...
asked by 03.05.2016 / 18:14
2
answers

Python 3.5 + Django + PostgreSQL on Windows

I'm currently starting a web system project using Python 3.5 and the Django 1.9.1 framework, with the intention of integrating them with a database PostgreSQL 9.5 , all installed on a machine running Windows 10 x64 OS. The installation of Py...
asked by 02.03.2016 / 23:34
1
answer

Form for relationship ForeignKey

is the following I created 3 models, one is the Person, another is aggressor and the other is Life . Being that Agressor inherits of person (I have made the inheritance). And the Life class can have an Aggressor-type object. How do I make this r...
asked by 12.05.2016 / 23:20
1
answer

Django Api: How to create a view that does reset Password?

I'm developing a mobile application using the Ionic framework. There is also an API in django that communicates with a PostgreSQL Database. I have already created an authentication system for the application and it works perfectly just like e...
asked by 15.04.2016 / 12:35
1
answer

Exchanging template_name in TemplateView (Django)

How do I change the template_name in TemplateView if the user is authenticated? Look what I've tried class Home(TemplateView): # template_name = 'index.html' is_auth = False def get(self, request): if not request.user....
asked by 03.04.2016 / 07:03
1
answer

installing Django in a venv

I'm trying to install the latest version of Django (1.9.6) in my virtualenv, but when I use the pip install django command inside the virtual environment, I get the following return: Requirement already satisfied (use --upgrade to upgrade): dj...
asked by 01.06.2016 / 21:13
1
answer

How to add fields dynamically in Django?

I'd like to add fields dynamically in DjangoAdmin. Models.py file: class Book(models.Model): title = models.CharField(max_length=100) def __str__(self): return self.title class Author(models.Model): name = models.CharFiel...
asked by 13.01.2016 / 18:57
1
answer

Error 502: Bad Gateway - How to solve

What's happening From yesterday morning, in a certain part of the site, in the user registry to be more accurate, many times when trying to do so, nginx returns the message of 502 - Bad Gateway . What can generate this? No site code was modi...
asked by 08.01.2016 / 15:17
2
answers

Group by Day in Django

Does anyone have an example of a "bat-ready" grouping by date? I've tried all of this here ... Subscription.objects.extra(select={'day': 'date(created_at)'}).values('day').annotate(available=Count('created_at')) from django.db.models.aggregat...
asked by 22.01.2016 / 23:08