Re: generating pdf report with django-easy-pdf

2015-04-22 Thread sum abiut
Hi James, Yes i have validated that there is data in the govstaff variable. when i add govstaff to context within the get_context_data() i am getting the error non-keyword arg after keyword arg. Is there are other ways to generated pdf reports on Django? Cheers, On Thu, Apr 23, 2015 at 12:34

Re: Best practice for passing JSON objects to a template

2015-04-22 Thread Mario Gudelj
I often use method 2. I don't see a problem with it. On 10 April 2015 at 02:08, Eric Plumb wrote: > Hi Djangoers! > > Sometimes in the course of human events it becomes necessary to encode a > JSON object directly into a template. We all prefer AJAX and REST APIs and >

Re: Host a web application

2015-04-22 Thread Mario Gudelj
Sign up for AWS, fire up a free micro instance and host on that. You can have it up there in no time with something like https://github.com/gcollazo/Fabulous On 23 April 2015 at 00:52, Mario R. Osorio wrote: > > > www.pythonanywhere.com made it easier for me to deploy than

Re: generating pdf report with django-easy-pdf

2015-04-22 Thread James Schneider
Have you validated that there is actual data in the govstaff variable within your template? Nothing is going to show up if it is an empty variable or doesn't exist in your template context. While I'm not familiar with the package you're using, I suspect you need to add the govstaff variable to

generating pdf report with django-easy-pdf

2015-04-22 Thread sum abiut
Hi, I am trying to generate pdf reports using django-easy-pdf but some how i am not geting the data. here is what i get. i only get the header but not the data. i think i am missing something from class viewpdfreport that i can't

Re: Trying understand static files.

2015-04-22 Thread john
Thanks guys - that worked! I'm going to call it black magic - because to be truthful I don't understand how it really works. If anyone has a better link than Django's on static files that explains what is really happening - it would be very helpful. Johnf On 04/22/2015 04:57 PM,

Re: Trying understand static files.

2015-04-22 Thread Mike Dewhirst
On 23/04/2015 9:35 AM, john wrote: Hi, I have created a website that works well under "runserver". But when I use nginx and uwsgi the basic website comes up but it is missing the static file information. I have run "manage.py collectstatic" but still no static files are used. Reading the

Re: Trying understand static files.

2015-04-22 Thread john
Thanks that helps with the nginx configure file. But what I don't understand is how the template tells nginx what to serve? There has to be some sort of black magic here! As I understand the process - the client asks for a page - django routes via urls - it finds the template and processes

Re: Strange error in django

2015-04-22 Thread Vijay Khemlani
What specific version of Python are you using (2.7...x?) On Wed, Apr 22, 2015 at 8:26 PM, John DeRosa wrote: > Oh, sorry. > > Well, you’re using joblib. The joblib.load() call loads something and > return a Python object into the symbol clf. > > It would seem you need

Re: Trying understand static files.

2015-04-22 Thread Lachlan Musicman
Oh my aching head and static files. STATIC_URL points to the namespace that the files will be served from: eg mydomain.com/static To set this up, in nginx/apache you need a stanza that looks like: location /static { alias /var/www/trees/opentrees/static; } STATIC_ROOT is where

Re: Trying understand static files.

2015-04-22 Thread Aaron C. de Bruyn
Have you looked through the deployment documentation yet? (https://docs.djangoproject.com/en/1.8/howto/deployment/) -A On Wed, Apr 22, 2015 at 4:35 PM, john wrote: > Hi, > I have created a website that works well under "runserver". But when I use > nginx and uwsgi the

Trying understand static files.

2015-04-22 Thread john
Hi, I have created a website that works well under "runserver". But when I use nginx and uwsgi the basic website comes up but it is missing the static file information. I have run "manage.py collectstatic" but still no static files are used. Reading the Django doc's tells me that I need the

Re: Strange error in django

2015-04-22 Thread John DeRosa
Oh, sorry. Well, you’re using joblib. The joblib.load() call loads something and return a Python object into the symbol clf. It would seem you need to look at the object that joblib.load is reconstituting. This code snippet doesn’t give enough information to diagnose this, but if I were you,

Re: Strange error in django

2015-04-22 Thread Cristian Javier Martinez
Thanks for your reply John DeRosa but the question is about what is causing the exception because I'm not using threads at all and the error says "*'Thread' object has no attribute '_children'"*. I'm catching the error and printing it out before the return as you can see in the log. El

Re: Strange error in django

2015-04-22 Thread John DeRosa
If you get an exception, the “except” clause will drop down into the “return” statement, and classification_serializer will be referenced before it’s assigned to. (Because it never was assigned to.) John > On Apr 22, 2015, at 2:36 PM, Cristian Javier Martinez >

Strange error in django

2015-04-22 Thread Cristian Javier Martinez
Hi! I'm using the django rest framework and successfully deployed an application in a production environment but I'm having an strange error related to threads when I call a method that performs a simple classification task (using a scikit learn classifier) and I have no idea what is causing

Re: Django Server Deployment - OperationalError on shared hosting ASO

2015-04-22 Thread David F
Got it to work-- changed permissions of my shared part of the server using the bash: chmod 755 . thanks james for thinking through this with me On Sunday, April 19, 2015 at 5:49:41 PM UTC-7, David F wrote: > > oh and yes-- I SSH into my part of the server that's how I'm able to do > all this

Re: python / django demand

2015-04-22 Thread Jay
thank you, good info. On Wednesday, 22 April 2015 05:10:48 UTC-6, mlvora.2010 wrote: > > Hey Jay, > > I am Malhar Vora from India. I may not be a proper person to answer to > your question as I don't have much experience but since 5-6 years I am > observing that Python/Django is gaining

Re: Serving / out of static directory, /api for Django DRF services (development/runserver/DEBUG mode)

2015-04-22 Thread LiteWait
Thank you. That is a perfect solution. On Wednesday, April 22, 2015 at 11:26:00 AM UTC-4, ke1g wrote: > > And I probably would have gone with: > > from django.conf import settings > if settings.DEBUG: > urlpatterns += patterns( > 'django.contrib.staticfiles.views', >

Re: Best practice for passing JSON objects to a template

2015-04-22 Thread Ilya Kazakevich
What about putting it into ? On Thursday, April 9, 2015 at 8:50:50 PM UTC+3, Eric Plumb wrote: > > Hi Djangoers! > > Sometimes in the course of human events it becomes necessary to encode a > JSON object directly into a template. We all prefer AJAX and REST APIs and > the rest of the TOFLAs,

Re: form.errors.as_json() returns a str - Django 1.8

2015-04-22 Thread Tom Evans
On Tue, Apr 21, 2015 at 4:57 PM, George L. wrote: > I'm trying to return errors to an ajax call but as_json() form method > generates a string of a dict instead of a dict. JsonResponse accepts only > dicts and if I set safe=False, JsonResponse tries to serialize the data as

Re: Serialize QuerySet Q (not the result)

2015-04-22 Thread Tom Evans
On Wed, Apr 22, 2015 at 10:27 AM, Jani Tiainen wrote: > Hi, > > Straight from the docs: > > https://docs.djangoproject.com/en/1.8/ref/models/querysets/#pickling-querysets > > "If you only want to pickle the necessary information to recreate the > QuerySet from the database at

Re: Serving / out of static directory, /api for Django DRF services (development/runserver/DEBUG mode)

2015-04-22 Thread Bill Freeman
And I probably would have gone with: from django.conf import settings if settings.DEBUG: urlpatterns += patterns( 'django.contrib.staticfiles.views', url(r'^$', 'serve', kwargs={'path': 'index.html'}), url(r'^(?P.*)$', 'serve'), The second url patter above must be the

Re: Serving / out of static directory, /api for Django DRF services (development/runserver/DEBUG mode)

2015-04-22 Thread Bill Freeman
By the way, you can test whether the regular expression matches without getting Django involved, allowing for much quicker theories and tests. $ python Python 2.7.3 (default, Jun 9 2014, 04:37:23) [GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux2 Type "help", "copyright", "credits" or "license"

Re: upgrading from Django 1.6 and south to Django 1.8

2015-04-22 Thread aRkadeFR
Hey there, maybe you found some answers in my other post: "django contrib auth last_login cannot be "null"" Did you run makemigrations ? For the upgrade, I suggest to you to do it minor version to minor version. On 04/20/2015 09:04 PM, Scott Hostovich wrote: I'm upgrading from Django 1.6

Re: Serving / out of static directory, /api for Django DRF services (development/runserver/DEBUG mode)

2015-04-22 Thread Bill Freeman
Are css and js subdirectries of apps as implied by the (as received) indentation of your message? Note that your "other" url pattern has js, css, and img, but no apps. On Wed, Apr 22, 2015 at 9:28 AM, LiteWait wrote: > Well, this doesn't work completely. > > Consider the

Re: Host a web application

2015-04-22 Thread Mario R. Osorio
www.pythonanywhere.com made it easier for me to deploy than heroku On Wednesday, April 22, 2015 at 2:25:56 AM UTC-4, Kishan Mehta wrote: > > Hi , > > I have to show my web application project work to a potential employer. > Is it possible to host the demo somewhere? Any guide on this? > >

Re: Writing some tests for new feature

2015-04-22 Thread Tim Graham
There was some recent work done on allowing customizing the ping_google sitemap URL, but it wasn't completed: https://github.com/django/django/pull/3528 You could take inspiration from your tests from there. On Wednesday, April 22, 2015 at 10:21:44 AM UTC-4, ST LEON wrote: > > I want to

Writing some tests for new feature

2015-04-22 Thread ST LEON
I want to contribute one new feature to Django (doing this first time). I reading this and have one question. First, write tests. I want to improve work of ping_google()

Re: Writing some tests for new feature

2015-04-22 Thread Avraham Serour
you should ask this on the django developers mailing list, this is the django users list On Wed, Apr 22, 2015 at 5:06 PM, ST LEON wrote: > I want to contribute one new feature to Django (doing this first time). > > I reading this

Re: Serving / out of static directory, /api for Django DRF services (development/runserver/DEBUG mode)

2015-04-22 Thread LiteWait
Well, this doesn't work completely. Consider the (static) tree: /client index.html /apps another.html /css style.css /js my.js I need to serve this whole static tree out of /. On Tuesday, April 21, 2015 at 10:08:26 PM

Re: Form to create several objects with one-to-one relation

2015-04-22 Thread Ilya Kazakevich
Thank you, that may work, but I feel that I reinventing wheel here. Actually, there are inline_formset and CreateWithInlinesView (from django extras) and they do exactly what I want, but they only support ForeignKey, not OneToOne. Looks like I need to extend them to support OneToOne. On

Tutorial 2 issue when creating super user on Windows 7

2015-04-22 Thread Johan Pretorius
When running the $python manage.py createsuperuser command the following is returned: C:\Users\johanP\mysite>python manage.py cre Username (leave blank to use 'johanp'): Email address: jar...@gmail.com Traceback (most recent call last): File "manage.py", line 10, in

Re: python / django demand

2015-04-22 Thread Malhar Vora
Hey Jay, I am Malhar Vora from India. I may not be a proper person to answer to your question as I don't have much experience but since 5-6 years I am observing that Python/Django is gaining momentum in Indian market. As a developer I keep track of Python/Django companies to get a job. In last

Customising widget widths in django-admin (using django-grappelli)

2015-04-22 Thread Vikas Rawal
I have an admin form that is rather long (many models, over 150 fields). I use TabularInlines for most of these. I am unable to adjust width of various fields to reduce the overall width of the form. Since django-grappelli overrides widths specified in forms.py, the recommended way is to

Re: django contrib auth last_login cannot be "null"

2015-04-22 Thread aRkadeFR
Indeed this was the problem. Thanks for your answer and I got it through IRC too. Have a good day On 04/21/2015 07:13 PM, Tim Graham wrote: This seems to be a common point of confusion. I'll add a sentence to release notes under the "``AbstractUser.last_login`` allows null values" section --

Re: Serialize QuerySet Q (not the result)

2015-04-22 Thread Jani Tiainen
Hi, Straight from the docs: https://docs.djangoproject.com/en/1.8/ref/models/querysets/#pickling-querysets "If you only want to pickle the necessary information to recreate the QuerySet from the database at a later time, pickle the query attribute of the QuerySet." And in same place there

Re: Serialize QuerySet Q (not the result)

2015-04-22 Thread guettli
Up to now only Q objects. If you know how to serialize aggregation / annotations, this would be great :-) Am Dienstag, 21. April 2015 14:35:52 UTC+2 schrieb Vijay Khemlani: > > Do you only need to serialize Q objects? No aggregation / annotations? > > On Tue, Apr 21, 2015 at 8:00 AM, guettli

Re: Host a web application

2015-04-22 Thread Michele Mattioni
Hi, if it is for a demo, you could use heroku to show it to your client: https://www.heroku.com/ Best, Michele On Wed, Apr 22, 2015 at 7:24 AM, Kishan Mehta wrote: > Hi , > > I have to show my web application project work to a potential employer. > Is it possible to

Host a web application

2015-04-22 Thread Kishan Mehta
Hi , I have to show my web application project work to a potential employer. Is it possible to host the demo somewhere? Any guide on this? Thanks for help, Kishankumar Mehta -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from