Can't Upload Image Field With Django 2.1

2018-10-30 Thread Pacôme Avahouin
Hello guys, I'm trying to upload user avatar (ImageField type) with my own custom user model following the documentation like this: class MyUsersProfileView(UpdateView): # First try def upload_file(request): if request.method == 'POST': form =

how do we create a custom primary key in django

2018-10-30 Thread chaitak
id = models.CharField(primary_key=True,default='first') .how can i insert a custom auto generated primary with the organization name for example 'cha' and a number starting from 1000 so the final id would be cha1000 and next id would be cha1001 Thanks & Regars

Regarding FileResponse and compressed file objects. Bug?

2018-10-30 Thread Zachary J.
Consider this situation: import gzip from django.http import FileResponse def some_request(request): return FileResponse( gzip.open('/path/to/filename.gz'), content_type="text/plain", filename="filename.txt", as_attachment=True ) This theoretically

Re: Using django on kubernetes

2018-10-30 Thread PASCUAL Eric
I'm not even sure those are the same as Docker containers even though Kubernetes can run Docker images. Kubernetes is an orchestrator for Docker containers, not a container engine. You can run the same images in K8S managed containers or on your local Docker engine, using docker-compose for

Re: How to subclass AsyncHttpConsumer for a GET request?

2018-10-30 Thread Andrew Godwin
You need to route by URL - see the example in the docs here, including how to fallback to Django views: https://channels.readthedocs.io/en/latest/topics/routing.html#urlrouter Andrew On Tue, Oct 30, 2018 at 5:05 AM Zhiyu (Drew) Li wrote: > Thanks! Another question it seems once I manually put

Left outer join rather than subquery.

2018-10-30 Thread Dan Davis
Suppose you have a setup like this: class Journal(models.Model): title = models.CharField(max_length=200) issn_type_choices = ( ('E', 'Electronic'), ('P', 'Print'), } class Issn(models.Model): ELECTRONIC='E' PRINT='P'

Re: Using django on kubernetes

2018-10-30 Thread Dan Davis
Andreas, I don't know terribly much about Kubernetes, only Docker, however it seems that Kubernetes must natively provide some metrics collection, i.e https://kubernetes.io/docs/tasks/debug-application-cluster/resource-usage-monitoring/. It would be nice to correlate particular views and

Re: Bokeh Server via Django Tutorial

2018-10-30 Thread Kirubel Tadesse
Hi Jonathan Bennett, I was trying to do something very similar with bokeh and Django. I was going through your github Linode_instructions.txt. I was wondering if I need to step up a user stuff. # Setting up the user I am not trying to deploy anything at this point. On Wednesday,

Re: New to Django: Please Help!! Django User Model not saving first_name, last_name and email - Authentication App

2018-10-30 Thread Adrian Chipukuma
I have sorted it out using a different approach 'AbstractUser'. Thanks On Tue, Oct 30, 2018, 12:19 PM Adrian Chipukuma wrote: > Thanks for the help. Though if I remove the declarations of the > first_name, last_name and email. Then I will not be able to see these in > the Register

Re: Using django on kubernetes

2018-10-30 Thread PASCUAL Eric
but I am a bit afraid that the memory usage for example might change over time? It will of course, but apart if you have some memory leak somewhere, it will tend to stabilize over time. Ah well - I will have to monitor this for an extended period of time and see what happens then :-) For

Re: Using django on kubernetes

2018-10-30 Thread Andréas Kühne
Thanks for the replys, I am of course monitoring the resources - but I am a bit afraid that the memory usage for example might change over time? Ah well - I will have to monitor this for an extended period of time and see what happens then :-) Regards, Andréas Den tis 30 okt. 2018 kl 12:17

Re: How to subclass AsyncHttpConsumer for a GET request?

2018-10-30 Thread Zhiyu (Drew) Li
Thanks! Another question it seems once I manually put 'http': MyAsyncHttpConsumer pair in the ProtocolRouter, all existing sync http views stopped running as their type is "http" as well. So how to do a mix of async HTTP and sync http? Thanks Drew On Mon, Oct 29, 2018, 23:15 Andrew Godwin wrote:

Re: LiveServerTestCase non-deterministic Remote end closed connection without response

2018-10-30 Thread amiranda
Any updates on this issue? I'm having the same issue right now. El jueves, 6 de septiembre de 2018, 0:43:44 (UTC+2), Rares Vernica escribió: > > Hello, > > I have a test script starting a live server using LiveServerTestCase. The > test script issues requests to the server using

Re: Using django on kubernetes

2018-10-30 Thread Jason
using infrastructure monitoring such as new relic can lend valuable insight into what resources pods are using vs their default allocation -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails

Re: Using django on kubernetes

2018-10-30 Thread PASCUAL Eric
Hi, Django is not really the key factor here, and the amount of consumed resources depends mainly on what your business logic does on top of Django. IMHO the only way to properly estimate the limits is observing the metrics and trends of the related pods for a significant period and with an

Re: New to Django: Please Help!! Django User Model not saving first_name, last_name and email - Authentication App

2018-10-30 Thread Adrian Chipukuma
Thanks for the help. Though if I remove the declarations of the first_name, last_name and email. Then I will not be able to see these in the Register form.. The fields password1 and password2 are just working well and can be saved... The issue is on the first_name, last_name and email

Multiple Database Setup problem !?

2018-10-30 Thread David Lubomirov
Hello, In my project I have 3 applications, and I'm trying to split them across 2 databases. More specifically 2 of the apps and Django "auth" application should work with the first database, and the last application should remain in the second database. These are the DB settings:

I'm getting nothiong on template after filtering there so i'm looking for a solution to filter in a model thorugh foreign key

2018-10-30 Thread Karan Talwar
*views.py* from django.shortcuts import render from .models import inherit # Create your views here. def homepage(request): ab = inherit.objects.filter(name__name__contains='karan') return render(request, 'jobs/index.html', {'x':ab} ) Models.py *from django.db import models* *# Create your

Using django on kubernetes

2018-10-30 Thread Andréas Kühne
Hi all, I have created a SPA with angular on the frontend and django rest framework on the backend. It also has celery to do background tasks. Everything is working as intended and it is running pretty smoothly. We have deployed it on kubernetes - so the frontend (with nginx) is running in one