These are chat archives for django/django

31st
May 2017
tulpn
@tulpn
May 31 2017 03:26
Is anyone within the AWS eu-central region ? I have lots of connection problems with Django-ses and other connections to AWS services, including SES and S3. It seems that there are lot of random timeouts and SSL issues. My routing is ok, my permissions are correct, sometimes it works, sometimes it timesout. Anyone else experiencing this ?
Abhinandan Panigrahi
@chrzrdx
May 31 2017 09:37
hi guys, in the cookiecutter-django template, they say python 3.6 support is experimental. What does that mean exactly? That django and other libraries have not been tested on python 3.6? Is it safe if I change the docker image to fetch the latest python image?
Marquitos
@sonirico
May 31 2017 13:48
Hey there. I have to models like
class Host(models.Model):
    name = models.CharField()
    ip = models.CharField()

class Service(models.Model):
    name = models.CharField()
    host = models.ForeignKey(Host)
Host.objects.filter(service__name="qwerty") provides the next query:
John
@flyboy1565
May 31 2017 13:50
@chrzrdx , yes.. basically the authors way of saying ... Don't gaurentee it'll work
@sonirico was there a question to go with tha
Marquitos
@sonirico
May 31 2017 13:52
Basically that query makes the INNER JOIN but it is not including the Service (N part) attributes
SELECT host.* FROM host INNER JOIN service ON host.id = service.host WHERE service.name = "qwerty"
How could I include service fields as well?
Abhinandan Panigrahi
@chrzrdx
May 31 2017 13:55
@flyboy1565 Oh, well. I think I'll try and upgrade (since I plan on using it purely as a REST backend, I can safely remove a few libraries that haven't upgraded from the template). Would you have any suggestions for a good tutorial on doing an SPA (vue/react) with DRF? Any other high quality cookiecutter templates that you guys use?
John
@flyboy1565
May 31 2017 13:58
Actually yes.. there is a free guide at YouTube that I recommend. Try Django 1.9 and then the guy turns it into a DRF. It's from codingforentrepreneurs.... Note that they do offer a paid guide but YouTube is free and GitHub is sourced materials
Abhinandan Panigrahi
@chrzrdx
May 31 2017 13:58
@flyboy1565 Thanks! Looking into it.
Marquitos
@sonirico
May 31 2017 13:59
Thank you @flyboy1565 !
Now the next step would be making the query with LEFT JOIN and with no WHERE statement
John
@flyboy1565
May 31 2017 14:00
Np to you both.. feel free to @ me.. it'll get my attention.
Marquitos
@sonirico
May 31 2017 14:00
SELECT host.*, service.* FROM host LEFT JOIN service ON host.id = service.hostwhat would be the ORM equivalent? @flyboy1565
Marquitos
@sonirico
May 31 2017 14:06
@flyboy1565 haha I bumped to that post before to be host, still had hopes anyway XD
@flyboy1565 thank you again! I will be making raw queries.
John
@flyboy1565
May 31 2017 14:34
@sonirico according to this https://groups.google.com/forum/m/#!topic/django-users/CjHVVmu-00c and a ticket I read about adding left join, it's enabled by default.. you need to add into your fk null=True this would tell orm to make it an Left join.. this could also depend on the database
Marquitos
@sonirico
May 31 2017 17:27
@flyboy1565 I get it, nevertheless the foreign key must never be null. The N part might not exist, and I would like to retrieve the 1 part anyway.
Matt Fehskens
@gonzofish
May 31 2017 18:20
is there a way to disable table creation? not just when testing, but overall--have a requirement that tables have to be created outside of Django (not mine)