Re: export sql query to excel

2018-04-16 Thread sum abiut
Thanks guys it took me a while and a lot of research, finally get it to work. my view.py import pandas as pd from django.http import HttpResponse try: from io import BytesIO as IO # for modern python except ImportError: from StringIO import StringIO as IO # for legacy python def download

Re: export sql query to excel

2018-04-16 Thread Gerardo Palazuelos Guerrero
hi, I don´t have this github, so let me try to show you what I do. Sorry if I´m not applying best practices, but this is working on my side; I run this manually from cmd in Windows 10 (no django on this). Content of my requirements.txt: et-xmlfile==1.0.1 jdcal==1.3 openpyxl==2.5.1 pyodbc==4.0.22

Re: export sql query to excel

2018-04-16 Thread Larry Martell
The same way you pass parameters to any view. On Mon, Apr 16, 2018 at 8:50 PM, sum abiut wrote: > Thanks Larry, > How to i pass my query parameter to the xlsxwriter. > > Cheers > > > > On Tue, Apr 17, 2018 at 1:42 AM, Larry Martell > wrote: >> >> I use xlsxwriter and I do it like this: >> >>

Re: export sql query to excel

2018-04-16 Thread Larry Martell
I was just giving you an example of how I do it. You do not need to use xlsxwriter - you can use anything you want to generate your xls files. The key to allowing the user to download it is returning a HttpResponse with content_type='application/ms-excel' On Mon, Apr 16, 2018 at 6:26 PM, sum abiut

Admin search field for inlines in foreign key relationships

2018-04-16 Thread Raphaël
Hi, I have two models, say Boxes and Widgets, using a Foreign Key field on Widgets to link them to Boxes. A couple years ago, when I first started this project, I used this StackOverflow post

Re: export sql query to excel

2018-04-16 Thread sum abiut
Thanks Larry, How to i pass my query parameter to the xlsxwriter. Cheers On Tue, Apr 17, 2018 at 1:42 AM, Larry Martell wrote: > I use xlsxwriter and I do it like this: > > output = io.BytesIO() > workbook = xlsxwriter.Workbook(output, {'in_memory': True}) > # write fi

Re: export sql query to excel

2018-04-16 Thread sum abiut
Thanks Larry, I haven't actually try xlsxwriter before so i find some difficulties understanding your code. Do you mind explaining the code, i will definitely have a read on the documentation. cheers On Tue, Apr 17, 2018 at 1:42 AM, Larry Martell wrote: > I use xlsxwriter and I do it like this

Re: Need Help With integrating Python Scripts with Django Frame Work

2018-04-16 Thread jacob duyon
I'm not sure how many users you have for this, but it's best practice to use an asynchronous task queue (like Celery) to run the actual powerpoint creation code. If you simply run the script inside the view it will block the response from happening. You create a celery task (which in your case woul

RE: Need Help With integrating Python Scripts with Django Frame Work

2018-04-16 Thread Matthew Pava
Add a new view that returns the files. Connect the “Download” button to the URL to that view. Your view should return an HttpResponse object. For instance, I use this for the user to download PDF versions of forms: response = HttpResponse(pdf_contents, content_type='application/pdf') response[

Re: Need Help With integrating Python Scripts with Django Frame Work

2018-04-16 Thread Larry Martell
Use ajax, e.g.: https://stackoverflow.com/questions/30456958/python-script-called-by-ajax-executed-by-django-server On Mon, Apr 16, 2018 at 3:48 PM, Balu Nanduri wrote: > Hi, > I am working on a project where I have to communicate with Tableau > server and generate pptx with the images d

Need Help With integrating Python Scripts with Django Frame Work

2018-04-16 Thread Balu Nanduri
Hi, I am working on a project where I have to communicate with Tableau server and generate pptx with the images downloaded. I have a working script to do this piece, currently the script generates pptx and stores it to my local filesystem. Now I would like to create a web page which wo

Help with Channels 2.x and Celery 4.x

2018-04-16 Thread Sergio Lopez
Hi!! I need a basic example of a program with channels 2.x (Django 2.x) that when it fulfills a condition, it calls a task celery 4.x and updates its status in a message in the html. (for example https://vincenttide.com/blog/1/django-channels-and-celery-example/) But i have the following error

Re: Django 2.0.2, Channels 2.0.2 and Celery 4.1 Issue

2018-04-16 Thread Sergio Lopez
Plese, Can you send us a basic example of celery 4 and channels 2? El viernes, 2 de marzo de 2018, 19:36:08 (UTC+1), G Broten escribió: > > Hi All: > I'm migrating a small application from Django 1.x/Channels 1.x to Django > 2.0.2 and Channels 2.0. I've run into an issue whose cause I'm trying t

Access form data of POST method in table in Django

2018-04-16 Thread shawnmhy
currently I am working with Django In template, I combined table and form and thus the code looks like this: {% csrf_token %} ID NAME LOWER_BOUND

Postgrid Nexval

2018-04-16 Thread LucyGeo
Como reordenar sequencia nextval no postgrid? Deletei um dado da tabela, e a sequencia ficou desordenada. Como ordenar? Usando a mesma função do oracle?Aguardo retorno. Muito obrigada!!! -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsub

Re: export sql query to excel

2018-04-16 Thread Larry Martell
I use xlsxwriter and I do it like this: output = io.BytesIO() workbook = xlsxwriter.Workbook(output, {'in_memory': True}) # write file output.seek(0) response = HttpResponse(output.read(), content_type='application/ms-excel') response['Content-Dispos

Re: Cannot Access Django Admin

2018-04-16 Thread Álmos Kovács
Please also check in the settings.py that admin is in your apps list. 2018-04-16 13:50 GMT+02:00 Chasan KIOUTSOUK MOUSTAFA : > Also make sure, you have the following configuration on *urls.py* > > *from django.contrib import admin > from django.urls import path, include > > urlpatterns = [ >

Re: Verify Emails

2018-04-16 Thread Hanne Moa
If you do your own email-sending code you can break off the sending after the server sends "RCPT', that'll work regardless. On 7 April 2018 at 14:27, 'Anthony Flury' via Django users < django-users@googlegroups.com> wrote: > why not use an email validator provided by Django ? > > https://docs.dja

Re: Cannot Access Django Admin

2018-04-16 Thread Chasan KIOUTSOUK MOUSTAFA
Also make sure, you have the following configuration on *urls.py* *from django.contrib import admin from django.urls import path, include urlpatterns = [ path('admin/', admin.site.urls), ]* On Mon, Apr 16, 2018 at 2:48 PM, Chasan KIOUTSOUK MOUSTAFA < chas...@gmail.com> wrote: > Try this o

Re: Cannot Access Django Admin

2018-04-16 Thread Chasan KIOUTSOUK MOUSTAFA
Try this one with trailing slash /admin/ It should work. On Mon, Apr 16, 2018 at 2:44 PM, David Corcoran wrote: > I'm trying to locate the Django Admin access. I've tried these two URL > configs: > > /admin > > /adminlogin/?next=/admin > > The response returned at these pages is "DoesNotExist".

Cannot Access Django Admin

2018-04-16 Thread David Corcoran
I'm trying to locate the Django Admin access. I've tried these two URL configs: /admin /adminlogin/?next=/admin The response returned at these pages is "DoesNotExist". Is there a specific folder (part of code), that I could check for these details? I'm wondering if perhaps this was not se

Re: Django y Python

2018-04-16 Thread Vijay Khemlani
No es necesario usar anaconda para instalar Django Puedes usar Django 1.5 en adelante con Python 3, pero lo ideal es usar la última versión (2.0.4) On Sun, Apr 15, 2018 at 8:38 PM, Marcelo Giorno wrote: > Soy nuevo en todo esto. > Instale Anaconda. > Tengo Python 3,6 > La consulta es puedo inst

Re: ARGPARSE ERROR

2018-04-16 Thread Aditya Singh
You need to download the latest version of django rest framework same as the version specified. If you need help on the commands let me know mate. Give it a shot it should help. Kind Regards, Aditya On Mon, Apr 16, 2018, 3:57 PM Ank wrote: > HI all , > > Installed Python 3.5 and still getting a

Re: ARGPARSE ERROR

2018-04-16 Thread Ank
HI all , Installed Python 3.5 and still getting an error django-rest-swagger 2.1.2 has requirement djangorestframework>=3.5.4, but you'll have djangorestframework 3.5.3 which is incompatible. Any pointers to solve this Thanks in advance best Ankush On Friday, April 13, 2018 at 11:07:58 A