These are chat archives for django/django

Apr 2017
Anish Shrestha
Apr 17 2017 07:19 UTC
adding permission to a url namespace
Any idea how?
rather than applying decorator to each view within that namespace
Kaushal Kumar
Apr 17 2017 08:57 UTC
I have developed django project ( which has media/static files ) and when I run runserver everything works perfectly. I have deployed on nginx server with unicorn. But each time it gives unexpected error. Some media files and static files are loading. Some error goes in the log file others don't. How can I debug django on nginx gunicorn? I am also running binary package using command Please suggest a good method to debug django + nginx + gunicorn + MySql.
I have used this:
to deploy on nginx.
Kaushal Kumar
Apr 17 2017 09:04 UTC
I am looking for a debugger using which I can debug django project running on nginx.
Apr 17 2017 09:45 UTC
look into /var/log/nginx/error.log
Kaushal Kumar
Apr 17 2017 09:58 UTC
@MBijman that doesn't log everything. I have setup nginx error log and I have also setup django LOGGING .. but many a times log is not created.
will pdb work with django-nginx?
Apr 17 2017 09:58 UTC
/var/log/nginx/access.log has succesfull calls
mysql should have another log under /var/log/mysql/error.log
no because nginx is just the reverse proxy
gunicorn is the runner so you can do somthing there but I have never done that
here is a discussion about your problem
Apr 17 2017 16:10 UTC

Hi, Im trying to use to create excel files and download them. I have the following:

        book = xlsxwriter.Workbook(output)
        sheet = book.add_worksheet()
        sheet.write('A1', 'Hello')


        response = HttpResponse(book, content_type='application/vnd.openxmlformats-officedocument.spreadsheetml.sheet')
        response['Content-Disposition'] = 'attachment; filename=foo.xlsx'

        return response

This downloads the file but in the file I have <xlsxwriter.workbook.Workbook object at 0x10e3e0be0> and not Hello

Gaurav Dabhade
Apr 17 2017 16:58 UTC
hi guys
anyone familiar with django-guardian?
Cristian Samaniego
Apr 17 2017 18:13 UTC
hello, i have some data from a form which i will send through an API, but before sending it i want to format that data, what is the best practice for that?
Cristian Samaniego
Apr 17 2017 18:44 UTC
i think i'll override the clean method for my form
Florian Dahlitz
Apr 17 2017 18:51 UTC
Hello guys! I learn Django w/ the sample project "polls-application" from the django-documentation
and there is one question I have which is not mentioned in the tutorial: I have a Question model and a Choice model and both are related to each other (so every question has choices and every choice has a question). How can I get all questions which have at least one choice (so that questions w/o choices are not displayed later)? Thanks for you help
here is my current get_queryset()-method:
def get_queryset(self):
        Return the last five published questions (Not including those 
        set to be published in the future)
        # the filter says that it only returns those w/ the pub_date
        # less or equal to (earlier or now)
        return Question.objects.filter(
Eduardo Calvachi
Apr 17 2017 20:13 UTC
Hi django peeps!
Philip Eckert
Apr 17 2017 20:16 UTC
Anybody have experience migrating from Sqlite3 to postgres?
Florian Dahlitz
Apr 17 2017 20:23 UTC
@pae4557 and seem to be great starting points. At some point there are information about the migration you want
Philip Eckert
Apr 17 2017 21:05 UTC
@DahlitzFlorian Thanks!
Florian Dahlitz
Apr 17 2017 22:08 UTC
Any cool project ideas for django? So apps that are really helpful?