How to pre-load model data?

2017-09-07 Thread Mark Phillips
I have a several classes in models.py, and I would like to load some data into these models (or tables in the db), as well as add more data over time through the admin panel. I googled for some ideas on how to pre-populate the db tables, and found references to RunSQL (

Anyone having issues using python-social-auth?

2017-09-07 Thread Pengcheng Chen
Hey there! Glad to join the community! Hope all is well! I am having issues with the python-social-auth package in Django 1.11.5 and 1.8. I copied the example on http://python-social-auth-docs.readthedocs.io and got the error below: HTTPError at /oauth/login/twitter/ 401 Client Error:

Re: Using data migration to create initial users errors

2017-09-07 Thread Tim Huang
> > Hi Melvyn, I am lack of knowledge how to use model manager. Would you mind give a quick example? Thanks - timh -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an

Re: Django channels

2017-09-07 Thread Andrew Godwin
Yes, you'd need to do this manually - the databinding in Channels right now is very barebones and doesn't handle initial state versus change management. I'd love to eventually get a full event-sourcing solution done, but I have a lot of things I would like to do! Andrew On Thu, Sep 7, 2017 at

Django channels

2017-09-07 Thread vorcak
Hi, I'm creating a prototype using Django Channels and I have a question that I haven't sorted out yet. First of all, big thanks to all django-channels developer, this is something I was missing for a long time. So I have a connection that watches on a model and sends updates to a frontend. It

Re: setup.py for Django project?

2017-09-07 Thread Ben Lopatin
I've seen this on a few projects before and each time transitioned the project away from it. As you note, for whatever advantages it seems like there may be, it's very much atypical and also unnecessary. I don't see how it makes writing Fabric tasks significantly easier (presumably you don't

Re: zip file

2017-09-07 Thread Anish Chapagain
Hi, You can use requests or urllib , was there in similar condition before and this is the Link that helped me: https://stackoverflow.com/questions/16760992/how-to-download-a-zip-file-from-a-site-python might be useful to you too On Thursday, 7 September 2017 13:42:24 UTC+5:45, vishnu

Re: Bizarre URL behaviour after deploying

2017-09-07 Thread Bernd Wechner
James, you da man! Fixed it at last. The problem in the end was indeed lighttpd and is explained here: https://searchcode.com/codesearch/view/12783344/ Essentially lighttpd splits REQUEST_URI into SCRIPT_NAME and PATH_INFO and passes those three along with a host of other values in the

Re: How to display ipconfig /all in template html django

2017-09-07 Thread Ramin Farajpour Cami
Thanks a lot it's work. i use tag On Thursday, September 7, 2017 at 2:05:10 PM UTC+4:30, Bernd Wechner wrote: > > Ramin, > > That's an HTML question, and nothing to do with Django. In HTML whitespace > all just collapses to a single space, newlines included, and you need to > request them

Re: How to display ipconfig /all in template html django

2017-09-07 Thread Bernd Wechner
Ramin, That's an HTML question, and nothing to do with Django. In HTML whitespace all just collapses to a single space, newlines included, and you need to request them explicitly. You can wrap it all in atag pair or replace \n with in your string, but that is just two of a plethora of

Re: How to display ipconfig /all in template html django

2017-09-07 Thread Ramin Farajpour Cami
Thanks Bernd, Your right, but i have problem show in view with output format ipconfig in html, i try display : PPP adapter VPN: Connection-specific DNS Suffix . : Link-local IPv6 Address . . . . . : fe80::50a6:e568:7895:590d%24 IPv4 Address. . . . . . . . . . . : 172.32.87.176

Re: Link to download a file

2017-09-07 Thread Andréas Kühne
Hi, I would recommend that you checkout how django uses storage backends. The reason for that is that if you would like to use your application with a cloud provider that has a storage solution - for example S3, your code won't work the way it is written now. However if you just make some minor

Re: Link to download a file

2017-09-07 Thread giuseppe ricci
Thanks. My solution: urls.py url(r'^download/$', 'views.download', name='download'), template.html Download dei datiIndietro views.py def download(request): data = open(os.path.join(settings.MEDIA_ROOT, 'static/tmp/dati.csv'), 'r').read() resp = HttpResponse(data,

Re: zip file

2017-09-07 Thread Andréas Kühne
You can use a package like requests for that. See http://docs.python-requests.org/en/master/ You will there be able to download it to a temp directory and then add use it to connect to your model. Regards, Andréas 2017-09-07 10:13 GMT+02:00 vishnu bhand : > How should i

Re: How to display ipconfig /all in template html django

2017-09-07 Thread Bernd Wechner
Ramin, I'm sorry but your question is not very clear. How about you capture the output of "ipconfig /all" with something like: IPconfig = subprocess.check_output(["ipconfig", "/all"], stderr=devnull) then add Config to your template context in a view something like: def

Re: zip file

2017-09-07 Thread vishnu bhand
How should i download zip from web into my django-project? On Thursday, September 7, 2017 at 1:35:04 PM UTC+5:30, Andréas Kühne wrote: > > Hi, > > If you only want to save the content "as is" to a model - just use the > FileField on the model. See here: > >

Re: zip file

2017-09-07 Thread vishnu bhand
how should i download zip from web? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email

Re: How to display ipconfig /all in template html django

2017-09-07 Thread James Schneider
On Sep 7, 2017 12:10 AM, "Ramin Farajpour Cami" wrote: Hi, Hi, I going to show output command "ipconfig /all" in html django template but i have string uncomfortable, for example : i going to show this in html : Windows IP Configuration PPP adapter VPN:

Re: zip file

2017-09-07 Thread Andréas Kühne
Hi, If you only want to save the content "as is" to a model - just use the FileField on the model. See here: https://docs.djangoproject.com/en/1.11/ref/models/fields/#filefield You can then also use different types of storage backends to save the file to either the server itself or to the cloud

zip file

2017-09-07 Thread vishnu bhand
hello , i want to download zip file from web into my django-project and save all it's file content to model ...So how should i go? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from

zip file

2017-09-07 Thread vishnu bhand
hello , -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to

How to display ipconfig /all in template html django

2017-09-07 Thread Ramin Farajpour Cami
Hi, Hi, I going to show output command "ipconfig /all" in html django template but i have string uncomfortable, for example : i going to show this in html : Windows IP Configuration PPP adapter VPN: Connection-specific DNS Suffix . : Link-local IPv6 Address . . . . . :