These are chat archives for django/django

22nd
May 2017
Roel
@roelzkie15
May 22 2017 15:00
is there anyone knows how to deploy a django app with mysql database on heroku?
Kyle Mulka
@mulka
May 22 2017 15:03
Here's Django install instructions for Heroku. https://devcenter.heroku.com/articles/deploying-python
Using it with MySQL isn't much different
Omar Lozada
@lozadaOmr
May 22 2017 15:04

How do I use queryset as manager trying to override bulk delete method as indicated
by this answer https://stackoverflow.com/a/28896384/1679011

class Person (models.Model): 
    objects = PersonQuerySet.as_manager()
    ...

class PersonQuerySet(models.QuerySet):
    PERSON_DIR = self.get_person_dir()
    shutil.rmtree(PERSON_DIR)
    super(PersonQuerySet, self).delete(*args, **kwargs)

but I'm getting NameError: name 'GithubQuerySet' is not defined

Kyle Mulka
@mulka
May 22 2017 15:05
Looks like there are a few MySQL heroku addons
I used one a while ago, but can't remember which one I used. You could also just use AWS RDS
Roel
@roelzkie15
May 22 2017 19:18
@mulka thanks for the guide, i tried pythonanywhere its seems to be easier and good hosting place for any python app.
Kyle Mulka
@mulka
May 22 2017 19:54
@badcoder28 alrighty, let me know how that works out for you.
Omar Lozada
@lozadaOmr
May 22 2017 20:55

How do I use queryset as manager trying to override bulk delete method as indicated
by this answer https://stackoverflow.com/a/28896384/1679011

class Person (models.Model): 
    objects = PersonQuerySet.as_manager()
    ...

class PersonQuerySet(models.QuerySet):
    PERSON_DIR = self.get_person_dir()
    shutil.rmtree(PERSON_DIR)
    super(PersonQuerySet, self).delete(*args, **kwargs)

but I'm getting NameError: name 'GithubQuerySet' is not defined

Didn't know, but apparently I should've put the QuerySet first before the Model #til

Cristian Samaniego
@chrisRubiano
May 22 2017 20:57
@bauripalash try how to tango with django
Cristian Samaniego
@chrisRubiano
May 22 2017 21:07
Is there a way to never show the 'internal server error' page with django? like replacing it with some other custom view
?
Kyle Mulka
@mulka
May 22 2017 21:08
@chrisRubiano yes, let me check what we're doing
seems like we just have a template called 500.html in our templates folder.
not sure if there's anything else you need
Kyle Mulka
@mulka
May 22 2017 21:14
to test this, you may have to turn off debug mode