Re: Django - Best option to check file types, even fake or without extensions

2017-09-22 Thread Melvyn Sopacua
Sorry to bust your bubble, but docx files really are zip files, with a predetermined set of files in them. Microsoft even tried to patent the idea, which I believe was originally coined by Sun's StarOffice. Most office suites have since adopted the practice so in order to inspect them you'll first

Re: Django - Best option to check file types, even fake or without extensions

2017-09-22 Thread James Schneider
On Sep 21, 2017 11:23 PM, "Paul" wrote: I'm trying to validate mime types of files uploaded with a predefined list of validate mime types. I need to do the check the file in the buffer before save, even if they are faked or no extensions. You're better off specifying what you do want rather th

Best option to check and/or convert encoding for csv files

2017-09-22 Thread Fellipe Henrique
Hello guys, So, I have several csv files, to open using pyexcel... but I start to have issues with CSV saved from Excel, with other encoding... There's any option to verify the encoding of file, or change the encoding? regards T.·.F.·.A.·. S+F *Fellipe Henrique P. Soares* e-mail: > echo

How to clean a form which receives multiple files

2017-09-22 Thread guettli
I am not happy with this snippet from the django docs: from django.views.generic.edit import FormViewfrom .forms import FileFieldForm class FileFieldView(FormView): form_class = FileFieldForm template_name = 'upload.html' # Replace with your template. success_url = '...' # Replace

Re: Channels architecture for chat application and subscriptions

2017-09-22 Thread Robin Lery
Okay. Thank you. Really appreciate what you guys are building. Sincerely, Robin On Thu, Sep 21, 2017 at 1:10 AM, Andrew Godwin wrote: > Yes, you can do as you suggest, but you're also right that it will be slow > to send. Groups are more efficient in theory, but right now their send > implement

Re: How to clean a form which receives multiple files

2017-09-22 Thread m1chael
I do it this way too and agree that it feels dirty. Curious to hear what others have to say about this! On Fri, Sep 22, 2017 at 9:18 AM, guettli wrote: > I am not happy with this snippet from the django docs: > > > from django.views.generic.edit import FormViewfrom .forms import FileFieldForm >

Re: Django forks

2017-09-22 Thread Jamesie Pic
Because Django is so awesome, I'm glad to show off the little framework built upon Django only 4 days of coding later (but after thinking about it for years and being asked by a customer - coming from modern PHP frameworks ecosystem - to implement such a thing in their project). https://www.youtub

Question about Multiple DBs and Foreign Keys

2017-09-22 Thread Noemi
Hi folks -- I'm trying to use multi-DB support for a one-off operation to copy some data from one database to another with the same schema, and trying to figure out how explicit one has to be about which database to use for foreign key access. I understand that Django doesn't support cross-DB

CSRF and API Calls

2017-09-22 Thread Tom Gorup
I'm having a bit of an issue. I'm attempting to utilize a Javascript/React App to interact with a Django backend without the use of templates (hence no {%csrftoken%} available). As I understand CSRF middleware, the CSRF token comes with the form on the GET and is provided in the POST; however,

RE: CSRF and API Calls

2017-09-22 Thread Matthew Pava
Do you have access to the Django backend code? You could disable CSRF validation by applying the @csrf_exempt decorator to the corresponding view functions. Maybe you could create a view that returns only the CSRF token (through AJAX?) that you can utilize as needed? From: django-users@googlegro

Django 2.0 alpha 1 released

2017-09-22 Thread Tim Graham
We've made the first release on the way to Django's next major release, Django 2.0! With just a little over two months until the final release (scheduled for December 1), we'll need timely testing from the community to ensure an on time, stable release. Check out the blog post: https://www.djangop

Django/ajax/forms

2017-09-22 Thread Mel DeJesus
Hey! If I submit 'http://localhost:8000/item/2/' to the address bar, I get the desired result, which is a rendering of item_detail.html with its item variables filled. But when I try to pass the ‘2’ via a form, I only get the html without rendering (and instead displaying in the console up

best practices for location of start up code

2017-09-22 Thread Larry Martell
We have some code we want to run 1 time when our django app is started. What is the best place for this? I tried putting it in my app's config function, but from there I get: *** AppRegistryNotReady: Apps aren't loaded yet. -- You received this message because you are subscribed to the Google Gr

ASGI alongside mod_wsgi behind an Nginx proxy

2017-09-22 Thread Sean F
Hi all, I'm trying use Channels to add websockets functionality to an existing Django project. At this stage, my websockets functionality is a simple echo of whatever text is sent by the client. The existing project runs on http://domain.com/, served by Apache+mod_wsgi behind a Nginx front-e

Re: Django 2.0 alpha 1 released

2017-09-22 Thread Robin Lery
+1 On Sat, Sep 23, 2017 at 12:16 AM, Tim Graham wrote: > We've made the first release on the way to Django's next major > release, Django 2.0! With just a little over two months until the > final release (scheduled for December 1), we'll need timely testing > from the community to ensure an on t