Re: mod_wsgi cannot load MySQLdb

2011-08-24 Thread Reinout van Rees
t; from your .wsgi script for instance. Just some brainstorming. Reinout -- Reinout van Reeshttp://reinout.vanrees.org/ rein...@vanrees.org http://www.nelen-schuurmans.nl/ "If you're not sure what to do, make something. -- Paul Graham" -- Y

Re: Problems on using multiple databases

2011-08-24 Thread Reinout van Rees
ent_type table that gives you problems!) should not end up in your special deatabase. Reinout -- Reinout van Reeshttp://reinout.vanrees.org/ rein...@vanrees.org http://www.nelen-schuurmans.nl/ "If you're not sure what to do, make something. -- Paul Graham&q

Re: Admin staticfiles stubbornly hiding behind 404s

2011-08-24 Thread Reinout van Rees
e server? On the server, you need to tell apache (or whatever you're using) to look in the right directory given your STATIC_URL: # django-staticfiles: STATIC_URL = '/static_media/' Alias /static_media/ /path/to/your/collected/static/files/ Reinout -- Reinout van Re

Re: Problems on using multiple databases

2011-08-24 Thread Reinout van Rees
On 23-08-11 01:31, Jim wrote: django.db.utils.DatabaseError: no such table: django_content_type Which django version, btw? Early 1.2 beta versions had a bug: https://code.djangoproject.com/ticket/12999 Reinout -- Reinout van Reeshttp://reinout.vanrees.org/ rein

Re: Error: cannot import name settings

2011-08-24 Thread Reinout van Rees
out -- Reinout van Reeshttp://reinout.vanrees.org/ rein...@vanrees.org http://www.nelen-schuurmans.nl/ "If you're not sure what to do, make something. -- Paul Graham" -- You received this message because you are subscribed to the Google Groups &qu

Re: Admin staticfiles stubbornly hiding behind 404s

2011-08-24 Thread Reinout van Rees
all getting the right js/css out of the box. Handy! Reinout -- Reinout van Reeshttp://reinout.vanrees.org/ rein...@vanrees.org http://www.nelen-schuurmans.nl/ "If you're not sure what to do, make something. -- Paul Graham" -- You received this mess

Re: Drag and drop functionality?

2011-08-24 Thread Reinout van Rees
I don't know if that also works for items dragged from outside the browser window. But get step 1 working first. Step 2 will need that functionality in place to be able to do something :-) Reinout -- Reinout van Reeshttp://reinout.vanrees.org/ rein...@vanrees.

Re: mod_wsgi cannot load MySQLdb

2011-08-24 Thread Reinout van Rees
path. I don't see anything that looks like a virtualenv dir in there, unless it is the /Users/jianbao/pylib at the end. I personally don't know how wsgi+virtualenv works together (I use buildout normally). so you'll have to ask around for that. Reinout -- Reinout van Ree

Re: Problems on using multiple databases

2011-08-24 Thread Reinout van Rees
docs: syncdb only managed the main default database by default. You'll have to call syncdb on the second database separately. Often the second database is an existing one that django shouldn't touch, that's why the default is that way. Reinout -- Reinout van Rees

Media files not served automatically anymore in 1.3?

2011-08-25 Thread Reinout van Rees
ving seems worthy of a real note in the 1.3 changelog. That note isn't there. Is this bad? Or am I missing something? - Serving static_url automatically but omitting media_url is a bit strange if you ask me. Is this a bug? Reinout -- Reinout van Reeshttp://reinout.vanre

Re: Media files not served automatically anymore in 1.3?

2011-08-25 Thread Reinout van Rees
recommended!) Nope, that's not it. Staticfiles works fine with runserver and serves the static_url stuff just fine. Only, with this 1.3 change django's 1.2's automatic serving of the media_url stuff has gone the way of the dodo. Reinout -- Reinout van Rees

Re: Media files not served automatically anymore in 1.3?

2011-08-25 Thread Reinout van Rees
On 25-08-11 12:08, Reinout van Rees wrote: Two questions: - "Breaking" automatic media_url serving seems worthy of a real note in the 1.3 changelog. That note isn't there. Is this bad? Or am I missing something? Yes, I am missing something... It turns out that django-st

Re: django themes

2011-08-26 Thread Reinout van Rees
way to bundle css/js with your application. Works like a charm. Look into that one first. Reinout -- Reinout van Reeshttp://reinout.vanrees.org/ rein...@vanrees.org http://www.nelen-schuurmans.nl/ "If you're not sure what to do, make something. -- Paul

Re: Media files not served automatically anymore in 1.3?

2011-08-29 Thread Reinout van Rees
On 27-08-11 17:22, Karen Tracey wrote: On Thu, Aug 25, 2011 at 7:21 AM, Reinout van Rees mailto:rein...@vanrees.org>> wrote: Only, with this 1.3 change django's 1.2's automatic serving of the media_url stuff has gone the way of the dodo. Django 1.2 never did auto

Re: App namespace/packages?

2011-08-30 Thread Reinout van Rees
with an underscore (lizard_ui, lizard_map, lizard_shape). The only reason for the dash/underscore difference is that it makes it easier to spot in which directory you are (the dash is the one with the setup.py, the underscore is the directory with the code within that outer-one-with-the

Re: Unable To Delete Records

2011-08-30 Thread Reinout van Rees
the last value." Now you know why only the last item gets deleted. It bit my once, too. What you need to call is request.POST.getlist('del_id'): that will give you the list you're expecting. Reinout -- Reinout van Reeshttp://reinout.vanrees.org/ rein...@

Re: How to run tests?

2011-08-30 Thread Reinout van Rees
with label vip_mobile could not be found Try "manage.py test data". Django doesn't really like those dot-separated namespace packages, sadly. Only the last part is used. Reinout -- Reinout van Reeshttp://reinout.vanrees.org/ rein...@vanrees.org http:

Re: Unable to have a template NOT show up

2011-08-31 Thread Reinout van Rees
think of right now: You mis-typed something in your urls.py. I'd expect there to be a "polls.view" in there instead of the customary "polls.views...", so with an 's'. The module is "views.py", not "view.py". Just guessing...

Re: Mystery... Faked Referrer Generates 500 Instead of 404 Error

2011-08-31 Thread Reinout van Rees
probably tell your webserver to immediately tell visitors to those specific pages that the page is gone (apache rewriterule, for instance, with a "410 GONE" response). Reinout -- Reinout van Reeshttp://reinout.vanrees.org/ rein...@vanrees.org http://w

Re: Unable to have a template NOT show up

2011-08-31 Thread Reinout van Rees
d. Why doesn't it show up? You probably forgot to add it to your INSTALLED_APPS list in your settings.py. At least, that happened to me a few times. "I can import it, why doesn't it work?!?" Reinout -- Reinout van Reeshttp://reinout.vanrees.org/ rein...

Re: feed updates stopped working

2011-09-01 Thread Reinout van Rees
Perhaps two months ago an OS update also updated the python version? So that the default /usr/bin/python isn't the same anymore as the version with the fact.pth in its site-packages folder? Reinout -- Reinout van Reeshttp://reinout.vanrees.org/ rein...@vanrees.or

Re: feed updates stopped working

2011-09-01 Thread Reinout van Rees
On 01-09-11 15:11, vanderkerkoff wrote: Thanks for trying though, I will find the problem, eventually:-) Can you specify "it stopped working" a bit, btw? Do you get a traceback, for instance? Reinout -- Reinout van Reeshttp://reinout.vanrees.org/ rein...@v

Re: Unable to have a template NOT show up

2011-09-01 Thread Reinout van Rees
current URL, |polls/1/|, didn't match any of these. Such a "^polls/ ^polls/$" regex is incorrect. What's the extra "^polls/ " doing in front of the actual regex? That's the cause of your error, I think. Reinout -- Reinout van Rees

Re: feed updates stopped working

2011-09-01 Thread Reinout van Rees
-c "import sys;print sys.path" Reinout -- Reinout van Reeshttp://reinout.vanrees.org/ rein...@vanrees.org http://www.nelen-schuurmans.nl/ "If you're not sure what to do, make something. -- Paul Graham" -- You received this message becau

Re: feed updates stopped working

2011-09-01 Thread Reinout van Rees
t weeks as it didn't seem to run :-) Reinout -- Reinout van Reeshttp://reinout.vanrees.org/ rein...@vanrees.org http://www.nelen-schuurmans.nl/ "If you're not sure what to do, make something. -- Paul Graham" -- You received this message because y

Re: Setting up a PostGIS DB

2011-09-01 Thread Reinout van Rees
pes. You might need to add explicit type casts. Anyone have any advice or ideas? It seems you haven't installed the postgis database extras into your postgres database. It depends on your OS how you have to do that. Reinout -- Reinout van Reeshttp://reinout.vanr

Re: Unable to have a template NOT show up

2011-09-01 Thread Reinout van Rees
ories loader is the one that you ought to use most of the time, so that's good. What's not good is that apparently only the admin's templates are found. Is your "polls" app a real app? Is it in your settings.py's INSTALLED_APPS list? Reinout -- Reino

Re: Template image display issue

2011-09-01 Thread Reinout van Rees
django 1.3, but available separate for earlier django versions). Reinout -- Reinout van Reeshttp://reinout.vanrees.org/ rein...@vanrees.org http://www.nelen-schuurmans.nl/ "If you're not sure what to do, make something. -- Paul Graham" -- You recei

Re: logging django errors also on the server

2011-09-04 Thread Reinout van Rees
dlewar such as http://djangosnippets.org/snippets/421/ . I've used that one for almost a year. Works like a charm. But... hurray for django 1.3 for including it in the regular python logging :-) Reinout -- Reinout van Reeshttp://reinout.vanrees.org/ rein...@van

Re: logging django errors also on the server

2011-09-04 Thread Reinout van Rees
atches all messages, including the ones to the django.something.error logger. Reinout -- Reinout van Reeshttp://reinout.vanrees.org/ rein...@vanrees.org http://www.nelen-schuurmans.nl/ "If you're not sure what to do, make something. -- Paul Graham&qu

Re: forms.ChoiceField/forms.ModelChoiceField Needs a Lot of Love

2011-09-06 Thread Reinout van Rees
e's an easy solution, mayhap it suggests improvements to the generic choicefield? Reinout -- Reinout van Reeshttp://reinout.vanrees.org/ rein...@vanrees.org http://www.nelen-schuurmans.nl/ "If you're not sure what to do, make something. -- Paul Gra

Re: django 1.3: how to use get_abolute_url in class based generic views

2011-10-15 Thread Reinout van Rees
?? Your get_absolute_url() returns a tuple instead of a url. You forgot to call reverse(): from django.core.urlresolvers import reverse ... def get_absolute_url(self): return reverse('article_detail', (), { 'year': ^^^

Re: A view associated with a lot of urls

2011-11-29 Thread Reinout van Rees
ink. So you probably have a start page that lists the categories and then a category page that lists the items. A 404 on /non/existing leads people to try /non/ which would also 404. Reinout -- Reinout van Reeshttp://reinout.vanrees.org/ rein...@vanrees.org

Re: Nginx - How to configure the virtual.conf to serve a Django application

2011-11-30 Thread Reinout van Rees
ation / { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_redirect off; proxy_pass http://localhost:11000; } } Reinout -- Reinout van Reeshttp://reinout.vanrees.org/ rein...@vanrees.org h

Re: How to intercept password change in admin module ?

2011-12-01 Thread Reinout van Rees
list than Django's build-in apps? Reinout -- Reinout van Reeshttp://reinout.vanrees.org/ rein...@vanrees.org http://www.nelen-schuurmans.nl/ "If you're not sure what to do, make something. -- Paul Graham" -- You received this message becaus

Re: Django

2011-12-02 Thread Reinout van Rees
? Depends on how you want to edit. Reinout -- Reinout van Reeshttp://reinout.vanrees.org/ rein...@vanrees.org http://www.nelen-schuurmans.nl/ "If you're not sure what to do, make something. -- Paul Graham" -- You received this message because you ar

Re: New design for class-based views

2011-12-05 Thread Reinout van Rees
"keep forever" option? Reinout -- Reinout van Reeshttp://reinout.vanrees.org/ rein...@vanrees.org http://www.nelen-schuurmans.nl/ "If you're not sure what to do, make something. -- Paul Graham" -- You received this message because you are s

Re: Query with no-correspondence results

2011-12-05 Thread Reinout van Rees
three specific values: Vote.objects.filter(thing=carrot).values_list('thing', 'context', 'vote) See https://docs.djangoproject.com/en/1.3/ref/models/querysets/#values-list for how that last trick works. Something like that? Reinout -- Reinout van Rees

Re: Can't figure out this Object Model error...

2011-12-05 Thread Reinout van Rees
syncdb (it will now contain the foreign key column). - Use south for database migrations. Reinout -- Reinout van Reeshttp://reinout.vanrees.org/ rein...@vanrees.org http://www.nelen-schuurmans.nl/ "If you're not sure what to do, make something

Re: Query with no-correspondence results

2011-12-06 Thread Reinout van Rees
arrot).values_list('thing', 'context', 'vote) should return a list of those lists. What do you get with a plain Vote.objects.filter(thing=carrot) ? Reinout -- Reinout van Reeshttp://reinout.vanrees.org/ rein...@vanrees.org http://www.nelen

Re: Template filter with multiple non-string arguments?

2011-12-06 Thread Reinout van Rees
r template. Reinout -- Reinout van Reeshttp://reinout.vanrees.org/ rein...@vanrees.org http://www.nelen-schuurmans.nl/ "If you're not sure what to do, make something. -- Paul Graham" -- You received this message because you are subscribed to the Goo

Re: Management commands inside namespaced packages not found

2011-12-06 Thread Reinout van Rees
) and modules named companyname_product (with an underscore). - You still have the companyname prefix. - You get the full "companyname_product" in INSTALLED_APPS. - You visually see the difference between the package dir and the python module dir. Reinout -- Reinout van R

Re: Django E-Commerce Framework

2011-12-06 Thread Reinout van Rees
On 06-12-11 06:40, Md,Mehedi Hasan Kabir(Tanim) wrote: Can anyone give me some suggestion/link for Django E-Commerce Framework? No personal experience, but the one I see mentioned most often: django lightning fast shop. http://www.getlfs.com/ Reinout -- Reinout van Rees

Re: Query with no-correspondence results

2011-12-06 Thread Reinout van Rees
not with a Django query). In case you want all contexts, you'll have to query for those specifically. And afterwards grab the results belonging to that context. So you won't escape a for loop and some manual work, I'm afraid. Reinout -- Reinout van Reesht

Re: Query with no-correspondence results

2011-12-06 Thread Reinout van Rees
#x27; and user='Me' There still might be a way to do it with the ORM; but you can definitely use raw sql for this. Till two years ago I didn't touch an sql database for 8 years as I used zope's luxurious python object database :-) So I'm happily proven wrong in what

Re: Deployment problem

2011-12-08 Thread Reinout van Rees
at is the structure of my files , what to upload ? mod_python is very outdated and unmaintained for years. Almost everyone uses wsgi (for apache: mod_wsgi) nowadays. Look a bit at the django documentation to get an idea. Reinout -- Reinout van Reeshttp://reinout.vanrees

Re: Any help regarding the SAAS based django-web application

2011-12-08 Thread Reinout van Rees
documentation or help on this topic if anyone has already developed in this way See Tom Evans' reply to your previous email. Your question is way too broad to give a meaningful answer. You'll have to give us more information. Reinout -- Reinout van Rees

Re: urls.py?

2011-12-09 Thread Reinout van Rees
times at the top. The last "from mysite.books import views" is winning :-) You cannot have one variable point to several things at the same time. Best thing you can do: import mysite.contact.views import mysite.books.views ... (r'^contact/$', mysite.contact.

Re: urls.py?

2011-12-09 Thread Reinout van Rees
ide variables by accident that way. Better to explicitly import what you need. In this case the problem was that the original poster imported 'view' a few times from different places. Doing a "*" import would only make that problem worse :-) Reinout -- Reinout van Rees

Re: converting from function based views to class based views

2011-12-10 Thread Reinout van Rees
t article give you enough hints? Reinout -- Reinout van Reeshttp://reinout.vanrees.org/ rein...@vanrees.org http://www.nelen-schuurmans.nl/ "If you're not sure what to do, make something. -- Paul Graham" -- You received this message because you are

Re: Best way to upload and play a video

2011-12-11 Thread Reinout van Rees
Alternative is to upload it to youtube/smugmug/whatever and to just store a URL in your model, pointing at the correct embed URL. Reinout -- Reinout van Reeshttp://reinout.vanrees.org/ rein...@vanrees.org http://www.nelen-schuurmans.nl/ "If you're

Re: Django Upload Image Help

2011-12-12 Thread Reinout van Rees
don't have a meaning iirc, but %d means "render as an integer".). So I'd expect an "TypeError: not enough arguments for format string". Reinout -- Reinout van Reeshttp://reinout.vanrees.org/ rein...@vanrees.org http://www.nelen-schuur

Re: preventing data from getting saved to the backend database?

2011-12-27 Thread Reinout van Rees
the info from those files all the time seems a bit wasteful: use some low-level django caching and you'll be fine again. Reinout -- Reinout van Reeshttp://reinout.vanrees.org/ rein...@vanrees.org http://www.nelen-schuurmans.nl/ "If you're not

Re: How I could reset django admin pass in a buildout project

2011-12-29 Thread Reinout van Rees
s normally impossible. You must have removed something by hand? Could you look inside the bin/django script? It ought to have a "sys.path" list in there that shows you where it thinks it can find the djangorecipe. Make sure it is still there. Or re-run your buildout, for instance. Reinout

Re: How I could reset django admin pass in a buildout project

2011-12-29 Thread Reinout van Rees
t enviroment variable to your settings file pre-set. So: "bin/django shell". Reinout -- Reinout van Reeshttp://reinout.vanrees.org/ rein...@vanrees.org http://www.nelen-schuurmans.nl/ "If you're not sure what to do, make something. -- Paul

Re: django-html5boilerplate error

2012-01-19 Thread Reinout van Rees
e /static/js/libs/modernizr-2.0.min.js So it is all relative to main.js and it somehow has a | and some number behind it. I think you've mis-configured something with that django-mediagenerator you mention. (or django-mediagenerator is defective, I don't know as I haven

Re: Can't make 404.html template to be used. Keep getting Apache 500 Internal Server Error instead.

2012-01-22 Thread Reinout van Rees
e latest Django doesn't have this requirement, btw. Reinout -- Reinout van Reeshttp://reinout.vanrees.org/ rein...@vanrees.org http://www.nelen-schuurmans.nl/ "If you're not sure what to do, make something. -- Paul Graham" -- You received this

Re: CsrfViewMiddleware from a xml post?

2012-01-24 Thread Reinout van Rees
that takes care of including the csrf token: https://docs.djangoproject.com/en/dev/ref/contrib/csrf/#ajax Reinout -- Reinout van Reeshttp://reinout.vanrees.org/ rein...@vanrees.org http://www.nelen-schuurmans.nl/ "If you're not sure what to do,

Re: Error with Apache + mod_wsgi

2012-01-27 Thread Reinout van Rees
ifferent libraries. I'd try looking at /usr/lib/pymodules/python2.6/django and figure out which Django version that is. And if python 2.6 is the same one as was running before. Reinout -- Reinout van Reeshttp://reinout.vanrees.org/ rein...@vanrees.org http:

Re: how to lookup dictionary in filter return?

2012-01-27 Thread Reinout van Rees
dict: ... print my_dict[key] aaa bbb In your case: {% for itm in somevalue | dic_filter %} {{ somevalue.itm }} {% endfor %} (And I'd replace 'itm' with 'key') Reinout -- Reinout van Reeshttp://reinout.vanrees.org/ rein...@vanrees.org

Re: Tutorial: New class based generic views

2011-08-10 Thread Reinout van Rees
views. Am I wrong in thinking that the word "generic" is just bad PR (or unclear documentation)? Reinout -- Reinout van Reeshttp://reinout.vanrees.org/ rein...@vanrees.org http://www.nelen-schuurmans.nl/ "If you're not sure what to do, mak

Re: 'str' object has no attribute 'resolve' when access admin site

2011-08-10 Thread Reinout van Rees
, include('django.contrib.admindocs.urls')), Did you add 'django.contrib.admindocs' to your INSTALLED_APPS list? Just to make sure. And if that doesn't fix it, could you post the traceback? It might contain hints where it goes wrong. Reinout -- Reinout van Rees

Re: Generating urls for a search-engine-like application

2011-08-10 Thread Reinout van Rees
use named variables, so /(?P.*)/ instead of // (unless you meant that already in your shorthand form, of course). The view function then can have keyword arguments: def search_view(request, country=None, city=None) Reinout -- Reinout van Reeshttp://reinout.vanrees.org/ rei

Re: Generating urls for a search-engine-like application

2011-08-10 Thread Reinout van Rees
then get a longer url, like /city/milan This makes the city-only scenario distinguishable from something that's a county+city combination. That way your regular urls stay nice and short. Best of both ways? Reinout -- Reinout van Reeshttp://reinout.vanrees.org/ rein

Re: How to pass url parameters to template url tag

2011-08-10 Thread Reinout van Rees
rule is that most processing should happen in python code, not in your template. Reinout -- Reinout van Reeshttp://reinout.vanrees.org/ rein...@vanrees.org http://www.nelen-schuurmans.nl/ "If you're not sure what to do, make something. -- Paul Graha

django and extjs: works well together?

2011-08-10 Thread Reinout van Rees
combination with django? Django can spew out json just fine of course, but it'll have to relinquish a lot of control to the browser. And it'll be more "spitting out json" than "using templates". Reinout -- Reinout van Reeshttp://reinout.va

Re: 'str' object has no attribute 'resolve' when access admin site

2011-08-11 Thread Reinout van Rees
thing like that. In the last part of the traceback that you get, could you click open that "local vars" triangle button? It might show you what 'pattern' or 'self.url_patterns' is. Perhaps that helps you spot what's wrong? Alternatively, post your entire urls.

Re: django and extjs: works well together?

2011-08-11 Thread Reinout van Rees
such a website, the most important parts of the site are not in well-testable python code, but in relatively harder to test javascript code. (On the other hand, a colleague told me that with extjs you have write relatively few lines of javascript: extjs does a lot out ouf the box

Re: PYTHONPATH and Django

2011-08-11 Thread Reinout van Rees
turn your code into a python package. Which means "add a setup.py". Then install that package with pip, too, and you don't have to do anything with your python path manually. Reinout -- Reinout van Reeshttp://reinout.vanrees.org/ rein...@vanrees.org

Re: "Great circle" using the django ORM?

2011-08-12 Thread Reinout van Rees
metimes there's a bit of a difference in the query language, but the generic idea is the same. Reinout -- Reinout van Reeshttp://reinout.vanrees.org/ rein...@vanrees.org http://www.nelen-schuurmans.nl/ "If you're not sure what to do, make some

Re: Defunct Processes on Server

2011-08-12 Thread Reinout van Rees
k queue and continue with your form submission. Behind the scenes, celery will take care of your task. Reinout -- Reinout van Reeshttp://reinout.vanrees.org/ rein...@vanrees.org http://www.nelen-schuurmans.nl/ "If you're not sure what to do, make some

Re: question about template engine jinja

2011-08-13 Thread Reinout van Rees
ster. I don't know from experience, though, *if* it is faster. Reinout -- Reinout van Reeshttp://reinout.vanrees.org/ rein...@vanrees.org http://www.nelen-schuurmans.nl/ "If you're not sure what to do, make something. -- Paul Graham" -- You re

Re: Authentication App to use?

2011-08-15 Thread Reinout van Rees
On 15-08-11 11:01, Andre Lopes wrote: My question. There are others Apps I can research to take a decision on what App should I use? A handy list: http://djangopackages.com/grids/g/authentication/ Reinout -- Reinout van Reeshttp://reinout.vanrees.org/ rein

Re: Admin inlines suddenly missing?

2011-08-15 Thread Reinout van Rees
g "yourproject.admin" from "manage.py shell"? Reinout -- Reinout van Reeshttp://reinout.vanrees.org/ rein...@vanrees.org http://www.nelen-schuurmans.nl/ "If you're not sure what to do, make something. -- Paul Graham" -- You receive

<    1   2