Re: Strange error in django

2015-04-22 Thread John DeRosa
ctive prompt, you can single-step it. John > On Apr 22, 2015, at 4:10 PM, Cristian Javier Martinez > <martinezcristianjav...@gmail.com> wrote: > > Thanks for your reply John DeRosa but the question is about what is causing > the exception because I'm not using threads

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 >

Re: Django Celery throwing runtime warnings for naive times

2014-04-28 Thread John DeRosa
I suggest you file a ticket in the celery project (https://github.com/celery/celery/issues), or ask for help on the #celery IRC channel. (See http://celery.readthedocs.org/en/latest/getting-started/resources.html for "help" resources...) They'd be more profitable avenues for you, given the

Re: Django

2014-04-19 Thread John DeRosa
On Apr 19, 2014, at 8:02 AM, Mark Phillips wrote: > "Two Scoops of Django" is also very good. > > +1 for TSoD. Super book! -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop

Re: Making functions callable

2014-03-26 Thread John DeRosa
eError: must be string, not None > > Anyone have an idea about what's going on? > > > On Thu, Mar 27, 2014 at 5:07 AM, John DeRosa <jo...@ipstreet.com> wrote: > For the default value to work as you expect, do this: > > def view(request, year=None): > if ye

Re: Making functions callable

2014-03-26 Thread John DeRosa
For the default value to work as you expect, do this: def view(request, year=None): if year is None: year = today.year() Kwarg defaults are evaluated when the module is interpreted for the first time. John On Mar 26, 2014, at 1:57 PM, Anthony Hawkes

Re: Postgres and backup/restore

2014-02-06 Thread John DeRosa
pg_dump is all you need, if your db is small enough. It generates a consistent backup. pg_dump, zip, stash it in a cloud container named "backup" is what we do. John On Feb 6, 2014, at 3:07 PM, Lachlan Musicman wrote: > Hola, > > What are people's recommendations for

Re: Presentation ideas?

2014-01-17 Thread John DeRosa
I’m glad Russ answered too. I was thinking only about tutorials, but neglected to explain that. Not that it was hard to figure out, I supposed. On Jan 16, 2014, at 8:56 PM, Keith Edmiston wrote: > John/Russ, > > Thanks a ton for these suggestions. Great thoughts! > > Keith

Re: Presentation ideas?

2014-01-16 Thread John DeRosa
You can survey technologies you don’t use in your daily work. You can explore alternative technologies for your current job. You can learn new details about technologies you know, in intermediate or advanced tutorials. You can learn in-depth, because you’re in a session for 3 hours, vs. 45

Re: Fabric for dependency management, testing strategy

2013-11-11 Thread John DeRosa
Agree with Avraham. Some other considerations: I use Linux package managers (e.g., apt-get on Debian) for non-critical technology. This usually (but not always) means all non-Python technology, plus Python technology that we don’t push to its limits. But, OTOH, at least in Ubuntu, it can

Re: django-celery connects to localhost but not by ip

2013-09-20 Thread John DeRosa
owever, one issue that still is strange is that the ASyncResult returned > from the task always seems to return False from the .ready() method even > though it seems to have completed the task. Any ideas on that? > > > On Thursday, September 19, 2013 7:36:41 PM UTC-7, John DeRosa

Re: django-celery connects to localhost but not by ip

2013-09-19 Thread John DeRosa
First things to check: Check the firewall on the RabbitMQ server. Can you access that server? Did you set up the vhost and account on the RabbitMQ server? Look in the RabbitMQ logs. Did the request make it to RabbitMQ? John On Sep 19, 2013, at 7:34 PM, Chad Vernon

Re: m2m_changed signal not caught

2013-09-17 Thread John DeRosa
>From memory, I _think_ this catches the signal from the Department model, not >the News model. To catch it when you edit the relationship from a *News* model >form, you need to hook it up ("sender=News.department.through"). On Sep 17, 2013, at 3:59 AM, Roberto López López

Re: User Permissions

2013-07-30 Thread John DeRosa
Take a look at django-guardian. (http://pythonhosted.org/django-guardian/) John On Jul 30, 2013, at 12:39 PM, Carlos Leite wrote: > Django do not have a "per-row" permission system in the box. > You will have to create that by yourself. > > You may start adding something

Re: autogenerating SECRET_KEY every time the server runs

2013-06-20 Thread John DeRosa
When we run the development server locally, we often start with an already-existing database. We don't re-initialize the db unless we have to, because there's been a schema change or a change in the value stored in a table's field. So we'd need SECRET_KEY to not change most of the time! John

Re: Understanding Django transactions

2013-05-21 Thread John DeRosa
Regardless of whatever comments and corrections may come, I thank you for summarizing what you think the changes will be! I didn't know about these impending changes. John On May 21, 2013, at 4:23 AM, Michael wrote: > > I've been reading up on how transactions work in

Re: [SPAM] Implementing User login expiration

2013-04-08 Thread John DeRosa
On Apr 5, 2013, at 5:33 PM, Nikolas Stevenson-Molnar wrote: > How about creating request middleware to sign out deactivated users? > Something like: > > if request.user.profile.expired: >logout(request) > > If you're concerned about the extra database hit per

Implementing User login expiration

2013-04-05 Thread John DeRosa
I have a Profile table that's 1:1 with the User table. Each Profile row has an account_expiration field. I want to invalidate users when their accounts expire. By "invalidate", I mean: They can't log in, and they can't use the system any more. The closer I look, the more complicated it seems.

Re: background task without celery

2012-12-10 Thread John DeRosa
On Dec 10, 2012, at 9:44 AM, leonardo wrote: > Hi, > > I'm deploying a project to validation purpose in Heroku and not worth paying > for a worker to execute background task. > Is there a way to execute background task without celery + rabbitmq ? > I investigated

Re: How many developers have moved to class-based views?

2012-11-12 Thread John DeRosa
On Nov 11, 2012, at 9:57 AM, Kevin wrote: > Hello! > > I am curious of how many existing Django developers have moved over to > class-based views or are still using the function-based ones. I tend to use > a mix depending on what I am trying to do. I try to stick with

Re: Help me choose OS for django server

2012-10-30 Thread John DeRosa
+2 for fail2ban. I love reviewing fail2ban's email, and seeing the script kiddies continuing to try to login to root. Which is login-disabled on all our servers. Keep trying, kids... John On Oct 30, 2012, at 4:38 PM, Fred Stluka wrote: > +1 for fail2ban > > It's

Re: Displaying a custom field (PickledObjectField) in the admin

2012-10-24 Thread John DeRosa
> django-picklefield 0.2.1) ... does anybody have any insight? > John, did you find a solution? > > Thank you. > > On Thursday, 8 April 2010 19:30:20 UTC+1, John DeRosa wrote: > Hello Djangonauts, > > I'm doing something wrong, but I just can't see it! > > My

Re: Background Programs in Django

2012-09-26 Thread John DeRosa
There are a number of technologies out there for background asynchronous tasks in Python. They differ on attributes such as how the tasks are managed and administered; the run queues' sophistication (how many, how they're divvied up, whether they can be pinned to servers, etc.), whether the

Re: how to use HTTPS with django

2012-07-06 Thread John DeRosa
On Jul 6, 2012, at 4:24 AM, Melvyn Sopacua wrote: > On 6-7-2012 8:08, heni yemun wrote: > >> I want to know how to use HTTPS to securely login and signup a user with >> django. > > Django doesn't care about HTTPS. You'd handle this in the webserver by > redirecting to the secure virtual host

Re: Macs are great for Django development!

2012-04-20 Thread John DeRosa
On Apr 20, 2012, at 8:39 AM, creecode wrote: > Hello Houman, > > On Friday, April 20, 2012 5:58:34 AM UTC-7, Houmie wrote: > > As I am not familiar with Mac, is it true that a let say a Mac Mini is > powerful enough to run Python, Eclipse/PyDev and Django like its done > in Ubuntu without

Re: reverse() with keyword argument driving me batty

2012-01-12 Thread John DeRosa
On Jan 12, 2012, at 10:18 AM, Andy McKay wrote: > On Thu, Jan 12, 2012 at 9:50 AM, John DeRosa <jo...@ipstreet.com> wrote: >> url(r'^results/text/(?P)/$', 'textresults', >> name='exporttextresults') > > One guess, you haven't specified what the (?P in your r

reverse() with keyword argument driving me batty

2012-01-12 Thread John DeRosa
Hi all, I'm running Django 1.3, and I can't get a simple reverse() with keywords to work. My urlconf has this: url(r'^results/text/(?P)/$', 'textresults', name='exporttextresults') My code does this: exporturl = reverse("exporttextresults", kwargs={"jobkey": returned_key})

Re: auto_now, auto_now add -- good or bad?

2011-07-15 Thread John DeRosa
On Jul 15, 2011, at 9:22 AM, Shawn Milochik wrote: > Considering these facts, I'm wondering what the consensus is in the community: > >A. They're still there because they're too annoying to deprecate > or just not important enough to spend time on. > >B. They're useful shortcuts and

Re: Possible interest in a webcast/presentation about Django site with 40mil+ rows of data??

2011-06-23 Thread John DeRosa
Me On Jun 23, 2011, at 7:49, Chris Calitz wrote: > Sounds really cool. I'm definitely in. > > On 22 Jun 2011, at 14:16, "Cal Leeming [Simplicity Media Ltd]" > wrote: > >> Hi all, >> >> Some of you may have noticed, in the last

Displaying a custom field (PickledObjectField) in the admin

2010-04-08 Thread John DeRosa
Hello Djangonauts, I'm doing something wrong, but I just can't see it! My problem is that a custom model field isn't being displayed in the Admin interface. I'm running OS X 10.6.3, Python 2.6, and Django 1.1.1. I installed django-picklefield 0.1.5 from PyPi, and I'm trying to use it in a

Re: Flat file application for binary data?

2010-02-06 Thread John DeRosa
On Feb 5, 2010, at 1:27 PM, Peter Herndon wrote: > FileFields and ImageFields are by default stored on disk, with just a pointer > stored in the db. For more examples, take a look at David Larlet's > django-storages (http://code.welldev.org/django-storages/wiki/Home) and > Justin Driscoll's

Re: Flat file application for binary data?

2010-02-06 Thread John DeRosa
On Feb 5, 2010, at 12:36 PM, Mike Ramirez wrote: > It's built in. > > http://docs.djangoproject.com/en/dev/topics/http/file-uploads/ > > http://docs.djangoproject.com/en/dev/ref/files/storage/ > > Between those two docs, you should be able to do everything you want. AFAIK, > no file

Flat file application for binary data?

2010-02-05 Thread John DeRosa
I'm building a site that will include using lots of image files, audio clips, and video clips. Including users uploading these things and then later referencing them. I don't want to store this binary data in the database, but instead want to store them in disk files. I've looked for a Django

Re: ForeignKey related bug

2008-01-29 Thread John DeRosa
Chirayu Patel wrote: > Hi, > > While building a blog type application, I seem to have stumbled upon a > bug. In a nut shell all object attributes have become read only when I > fetch the object from a query set which is fetched using the xxx_set() > API. > > Please see the pdb trace for

Re: django under 2.5

2007-08-29 Thread John DeRosa
ditto Kevin Menard wrote: > On 8/28/07, Alvaro Mouriño <[EMAIL PROTECTED]> wrote: >> Hi list, >> >> I have been running django under python 2.4 but now I'm considering >> switching to 2.5. Are there any known compatibility issues? Or is it >> just straightforward? > > I've been running under

Re: Is cloning Facebook in Django feasible?

2007-07-27 Thread John DeRosa
Ick! Why would you want to? Isn't one facebook in the world enough? :-) [EMAIL PROTECTED] wrote: > Is it possible to develop a Facebook functional clone in Django? What > parts of it are provided out of the box? Any third-party contributions? > > > > > >

Re: KeyError when using blocktrans

2007-06-20 Thread John DeRosa
Malcolm Tredinnick wrote: > This is by design. It is much easier for translators if they only have > to move small fragments of "replaced text" around, since it has to be > done without error. So, if a translator needs to put {{itemAuthor}} in > another position in the line, it's fairly easy to

Re: KeyError when using blocktrans

2007-06-19 Thread John DeRosa
[EMAIL PROTECTED] wrote: > With the latest version of Django from SVN, it appears you can no > longer use sub-attributes of a template variable within a blocktrans > tag. For instance, the following will give you a KeyError: > > {% blocktrans %}by {{ item.author }} at{% endblocktrans %} > >

Re: Sitemap questions (probably dumb ones)

2007-06-15 Thread John DeRosa
David Larlet wrote: > 2007/6/13, John DeRosa <[EMAIL PROTECTED]>: >> David Larlet wrote: >>> 2006/12/7, [EMAIL PROTECTED] <[EMAIL PROTECTED]>: >>>> I've been playing with the sitemap stuff and am finding it to be quite >>>> slick. I do,

Sitemaps and large sites

2007-05-22 Thread John DeRosa
I've implemented sitemaps for my site (www.trenchmice.com), and I've run into a problem because of my site's size. TrenchMice has 275K pages, generated from 275K+ database objects. The sitemap classes return information on every object, which means they try to return information on 275K+

Sitemaps and large sites

2007-05-22 Thread John DeRosa
I've implemented sitemaps for my site (www.trenchmice.com), and I've run into a problem because of my site's size. TrenchMice has 275K pages, generated from 275K+ database objects. (These are "topics" and "scoops".) The sitemap classes return information on every object, which means try to

Re: How well should I know Python before using Django?

2007-05-09 Thread John DeRosa
(1) If you're making a simple web site. (2) If you're making a site with a non-trivial use of authentication, session variables, complicated db lookups; or uses complicated algorithms under the hood. $.02, John walterbyrd wrote: > Before attempting to use Django, a person should have a

Re: Curious error with Session Variables

2007-05-08 Thread John DeRosa
Perhaps check your firewall, anti-hijack, anti-trojan, etc. software. You may have a cookie guard enabled. For example, Webroot's Spy Sweeper has a set of "shields" for web browsers, and they include the blocking of certain tracking cookies and some IE security 'protection'. Perhaps your

Re: Securing the admin site

2007-04-04 Thread John DeRosa
trickyb wrote: > This is a somewhat open-ended question: what are people doing to > secure their admin sites against unwelcome visitors? On my site, what > I've done is change the URL root from /admin/ to something else so > that casual visitors do not know where to look. Richard, To change the

Re: django as a platform for a commercial SaaS project?

2007-03-24 Thread John DeRosa
Lee Hinde wrote: > > > On Mar 24, 8:03 pm, John DeRosa <[EMAIL PROTECTED]> wrote: >> walterbyrd wrote: >>> SaaS = Software as a service, just in case that was not clear. >> What's the difference between SaaS and an ASP? I don't quite get the >> disti

Re: django as a platform for a commercial SaaS project?

2007-03-24 Thread John DeRosa
walterbyrd wrote: > SaaS = Software as a service, just in case that was not clear. What's the difference between SaaS and an ASP? I don't quite get the distinction between them. John --~--~-~--~~~---~--~~ You received this message because you are subscribed

Re: Designing for Speed - conditionals inside the view versus the template

2007-03-12 Thread John DeRosa
Merric Mercer wrote: > I have view that returns a whole bunch of different variables and > boolean flags.The state of these flags determine what the user > actually sees on their screen. > > From a design perspective I seem to have two options:- > > > 1. Design a template with lots

What's the proper use of LazyDate?

2007-01-04 Thread John DeRosa
What's the proper/recommended/improper/not-recommended use of models.LazyDate() in 0.95? I'm working on a project that picked up its use in 0.91-based code. There's a passing reference to it in the 0.90 docs, but nothing since then. There are references to it all over the web... E.g.:

Re: Anal not Analog, Analysis: DB Question

2006-10-04 Thread John DeRosa
heh. so do we get to guess what your django-based site is about? Tom Smith wrote: > If I am looking for titles like "Anal Sex" or "Being Anal" then how > do I construct this, ahem, query... to not return "Analysis" or > "Analog"? > > I tried adding spaces to the end of the word but it

Re: Python 2.5 anyone

2006-09-20 Thread John DeRosa
Oliver Andrich wrote: > Hi, > > On 9/20/06, John DeRosa <[EMAIL PROTECTED]> wrote: >> How'd you do it? >> >> I'm on Windows XP. I installed Python 2.5 from python.org without a >> problem. >> >> But then I found that pysqlite Windows binar

Re: Python 2.5 anyone

2006-09-20 Thread John DeRosa
Oliver Andrich wrote: > Hi, > > I am running Django 0.95 . And so far I can't see any problems. How'd you do it? I'm on Windows XP. I installed Python 2.5 from python.org without a problem. But then I found that pysqlite Windows binaries for Python 2.5 don't exist, and neither does

Re: Select all instances of a model that have a null ForeignKey value

2006-09-09 Thread John DeRosa
cyberco wrote: > Given: > > =Models== > class T(models.Model): > pass > > class Y(models.Model): > t = models.ForeignKey(T, blank=True, null=True) > > > I want to select all instances of a Y that have a null value for t. I > would say that it

Re: admin connection mysql problem

2006-06-27 Thread John DeRosa
Patrick Martini wrote: > Thanks for the answer :) > I have tries to start my site without installed application. > But the admin give me always the same problem. > > I have already broken two keyboards trying to risolve the problem :) > > Have you another suggestion ? nope, sorry!...

Re: admin connection mysql problem

2006-06-26 Thread John DeRosa
When I've seen messages similar to this, it's usually because an identifier in the meta.Admin list_display list was not defined as a field in the class. A good place to start would be to check the spelling of every field listed in meta.Admin. John Patrick wrote: > Hi, > when i go in my

Re: html input tag width corresponding to CharFields always fixed

2006-05-26 Thread John DeRosa
[EMAIL PROTECTED] wrote: > for a field defined as > spot =models.CharField(maxlength=250), > or band =models.CharField(maxlength=2), > > the input field in forms always has a fixed width. how to change that > ? Add length=. Like so: formfields.TextField(field_name="address_line1",