Custom admin view - sorting, filters, and search
The admin change list pages you get 'for free' when you add: class Admin: list_display = ( ... ) list_filter = ( ... ) search_fields = ( ... ) to your model are really nice. I'd like to add these features to my custom admin pages as well. I am getting part of the way there to sort the data shown in a template by clicking the column header of a data table but even that is still very clunky. Does anyone have any examples of how to add one or more of these components to a template that extends admin/base_site.html and the associated views.py? Thanks, Vincent --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: RENDER_TO_RESPONSE and PRETTY ROUTING URL
On Tue, 2007-06-19 at 18:48 -0700, johnny wrote: > When I use render_to_response, can I have routing url in it like '/ > posts/all/' or > I have to have '/posts/all.html''? > > My small code: > # I am passing list of objects called 'posts' to template > return render_to_response('/posts/all/', {'posts': posts}) > > In my browser, I want to have pretty url like "mysite/posts/all/" not > "mysite/posts/all.html". render_to_response() has nothing to with the URL. The first parameter is the name of the template file to use for the rendering. Traditionally (but not always and it's not compulsory), they have ".html" extensions. The URL for the response has already been determined: it was what the client requested in the original request (unless you use an HTTP redirect or something). Regards, Malcolm --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
RENDER_TO_RESPONSE and PRETTY ROUTING URL
When I use render_to_response, can I have routing url in it like '/ posts/all/' or I have to have '/posts/all.html''? My small code: # I am passing list of objects called 'posts' to template return render_to_response('/posts/all/', {'posts': posts}) In my browser, I want to have pretty url like "mysite/posts/all/" not "mysite/posts/all.html". thnx. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: KeyError when using blocktrans
On Tue, 2007-06-19 at 09:15 -0700, John DeRosa wrote: > [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 %} > > > > However, the following works just fine: > > > > {% blocktrans with item.author as itemAuthor %}by {{ itemAuthor }} at{% > > endblocktrans %} > > > > Bug? By design? Misconfiguration? > > > > Stack trace of the error is > > > > Traceback (most recent call last): > > File "c:\python24\lib\site-packages\django\template\__init__.py" in > > render_node > > 712. result = node.render(context) > > File "C:\Python24\lib\site-packages\django\templatetags\i18n.py" in > > render > > 73. result = translation.gettext(singular) % context > > File "c:\python24\lib\site-packages\django\template\context.py" in > > __getitem__ > > 40. raise KeyError(key) > > > > KeyError at /planet/ > > 'item.author' > > We just ran into this on our site, which is running on 0.96. I searched > around in the Django tickets and changesets, and couldn't find a > reference to this. > > Is this an intended part of the I18N design? 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 do. However, if they need to move a much longer fragment -- say, {{ item.author|urlizetrunc| escape }} -- there's now a huge block of text that they have to copy or retype precisely, despite it having no intrinsic meaning for the translation. So, in blocktrans tags, only simple variable references are permitted and any aliases should be put as tag arguments. I'm not sure why this worked before 0.96 -- my recollection is that it has always worked as it does now. In any case, the current behaviour is intended. Regards, Malcolm --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Slugify in characters with accent and others
On Tue, 2007-06-19 at 06:35 -0700, Jonas wrote: > For if you need 'slug' non-ascii characters as *Á È ï ô ü ñ*, that > will be converted to *A E i o u n* before of slug the string, I have > added a patch in: > > http://code.djangoproject.com/ticket/2276 > http://code.djangoproject.com/attachment/ticket/2276/defaultfilters.py.patch Can you please stop reopening that ticket after it's been closed twice. As I indicated the last time you re-opened it, we are working on a more comprehensive solution, based on some earlier work of Bill de hÓra's over in ticket #4365. It is not fair to the people trying to fix tickets if you make things more complicated by reopening older tickets. I realise you are trying to be helpful and all contributions are welcome. However, you need to work with us instead of at cross-purposes or it becomes very inefficient. So please attach your patch to the current ticket (#4365). Thanks, Malcolm --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: admin css/images disappeared
On Tue, 2007-06-19 at 09:55 +, Evan Carmi wrote: > Hi, > > My admin css and images have disappeared. I am running django with > lighttpd. The usual thing anybody is going to need to know to be able to help you with a problem like this is "what changed?". What is different between now and when they last worked? If you change back does the problem go away (i.e. is it repeatable)? Regards, Malcolm --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Comparing dates..
I could be a bit more pythonic: >>> from django.db.models.query import QOr >>> ql = [Q(birthdate__day=(startdate + timedelta(days=x)).day) & >>> Q(birthdate__month=(startdate + timedelta(days=x)).month) for x in range(7)] >>> Person.objects.filter(QOr(*ql)) -rob On Jun 19, 2:51 pm, Tim Chase <[EMAIL PROTECTED]> wrote: > > I want to compare dates in my db while ignoring the year field. Lets > > say I have a birthday field and want to find upcoming birthdays in the > > next one week. How can I achieve this? If I try- > > > last_date = datetime.now().date() + timedelta(days=7) > > users = User.objects.filter(birthday__day__lte = last_date.day) > > This is a bit tricky, especially because of boundary conditions > like ends-of-months and end-of-years. Note that if it's > currently December 28th, last_date.day isn't quite what you want > to be comparing to. > > This can be done on the DB-server-side if you do server-specific > code; it can be done on the Django side in homogenous Python code > if you're willing to slurp over all your germane birthdays and > filter them locally; or, with such a small range of days (fixed > at 7), you could do something hackish like: > > now = datetime.now().date() > dates = [now + timedelta(days=x) for x in xrange(8)] > from operator import or_ > params = reduce(or_, [ > Q(birthday__day=date.day, birthday__month=date.month) > for date in dates > ]) > users = User.objects.filter(*params) > > This gets a little unweildy if you have more than a couple days > to consider (I don't think I'd do this for more than about 10 > days). It basically builds something of the form > > ...filter(Q(birthday__day=now.day, birthday__month=now.month) | > Q(birthday__day=now.day + timedelta(days=1), > birthday__month=now.month + timedelta(days=1)) | > Q(birthday__day=now.day + timedelta(days=2), > birthday__month=now.month + timedelta(days=2)) | > Q(birthday__day=now.day + timedelta(days=3), > birthday__month=now.month + timedelta(days=3)) | > ... > > for each of your days. (thus a cap on 7 days is good...smaller > is better) > > However, the alternative on the server side would be to write > DB-specific code doing some crazy date math using functions like > MySQL's DateAdd function. The high-level picture would involve > normalizing the field's date to the year that falls within the > given range and then comparing it with BETWEEN to ensure it falls > between the two calculated dates. Something like this 100% > untested code: > >now = datetime.now().date() >end = now + timedelta(days=7) >users = User.objects.extra(where=""" > adddate(birthday, interval >(Extract(year from %s) - Extract(year from birthday)) >years) >BETWEEN %s AND %s > """, > params = [now, now, end]) > > You might have to tweak it to add 1 to the year if there's some > odd boundary straddling. > > -tim --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Comparing dates..
> I want to compare dates in my db while ignoring the year field. Lets > say I have a birthday field and want to find upcoming birthdays in the > next one week. How can I achieve this? If I try- > > last_date = datetime.now().date() + timedelta(days=7) > users = User.objects.filter(birthday__day__lte = last_date.day) This is a bit tricky, especially because of boundary conditions like ends-of-months and end-of-years. Note that if it's currently December 28th, last_date.day isn't quite what you want to be comparing to. This can be done on the DB-server-side if you do server-specific code; it can be done on the Django side in homogenous Python code if you're willing to slurp over all your germane birthdays and filter them locally; or, with such a small range of days (fixed at 7), you could do something hackish like: now = datetime.now().date() dates = [now + timedelta(days=x) for x in xrange(8)] from operator import or_ params = reduce(or_, [ Q(birthday__day=date.day, birthday__month=date.month) for date in dates ]) users = User.objects.filter(*params) This gets a little unweildy if you have more than a couple days to consider (I don't think I'd do this for more than about 10 days). It basically builds something of the form ...filter(Q(birthday__day=now.day, birthday__month=now.month) | Q(birthday__day=now.day + timedelta(days=1), birthday__month=now.month + timedelta(days=1)) | Q(birthday__day=now.day + timedelta(days=2), birthday__month=now.month + timedelta(days=2)) | Q(birthday__day=now.day + timedelta(days=3), birthday__month=now.month + timedelta(days=3)) | ... for each of your days. (thus a cap on 7 days is good...smaller is better) However, the alternative on the server side would be to write DB-specific code doing some crazy date math using functions like MySQL's DateAdd function. The high-level picture would involve normalizing the field's date to the year that falls within the given range and then comparing it with BETWEEN to ensure it falls between the two calculated dates. Something like this 100% untested code: now = datetime.now().date() end = now + timedelta(days=7) users = User.objects.extra(where=""" adddate(birthday, interval (Extract(year from %s) - Extract(year from birthday)) years) BETWEEN %s AND %s """, params = [now, now, end]) You might have to tweak it to add 1 to the year if there's some odd boundary straddling. -tim --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Passing a list of field names to the value() method?
This is probably more of a Python question than django, but django provides the context for my problem. Requirement: I have got a user defined list of field names (e.g. field_names=['id','name','description',...]) and I want to pass this list to the value() method on a QuerySet thereby returning a subset of the model fields (as a dictionary). Problem: value() takes individual field names as parameters (e.g. value('id', 'name,' description'), not a list of field names (e.g. value(field_names) ). Is there a simple way of passing the list of field names to the value() method or is there an alternative strategy for returning the subset of fields from the QuerySet? Hopefully this is obvious to someone, but it has me stumped. Richard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Questions on learning curve
One stumbling block I think really adds to the learning curve for many people is one's level of familiarity with command line operations and server configurations. On Jun 19, 1:51 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hello everyone, > > A few days ago I got an idea to build an online turnbased game (like > thecrims.com) for example. > I am pretty much a novice when it comes to PHP so I started to look at > Ruby on rails to maybe make my development easier and faster. > Stopped with Rails and found Django. > > Now, maybe a stupid question but for how long does it take to really > understand Django/Python and start actually creating some code for the > game? > > Do I have to read XXX amount of Python books to be able to be > productive ? > > What is really bugging me is that everything that has to do with > computers/script/web/programming takes a long time. I am more of the > hands on type of guy and get easy frustrated. > Even though its fun from time to time to built and create something, > but what is bothering me is the time it takes to develop something. > > A house can be built in 2 months, but a advanced script with design > etc can take up to 1 year...something is wrong here =) > > So can someone let me know what I should do to be able to create such > a game? > > Cheers to all --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: FastCGI Shared host
Nothing? :( I'll keep hammering at the thing trying different things.. but I'm sad I can't get this to work with FastCGI at all. On Jun 19, 9:46 am, rtconner <[EMAIL PROTECTED]> wrote: > I set APPEND_SLASH to false, I no longer get the APPEND_SLASH error, > but I still get the WSGI errors. > > On Jun 19, 2:18 am, Jens Diemer <[EMAIL PROTECTED]> wrote: > > > rtconner schrieb: > > > > ~/www/django> python mysite.fcgi > > > ... > > > Traceback (most recent call last): > > > ... > > > if settings.APPEND_SLASH and (old_url[1][-1] != '/') and ('.' not > > > in old_url[1].split('/')[-1]): > > > IndexError: string index out of range > > > Content-Type: text/html > > > This is probably the same problem like here: > >http://code.djangoproject.com/ticket/3414 > > > -- > > Mfg. > > > Jens Diemer > > > > > A django powered CMS:http://www.pylucid.org --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Questions on learning curve
Seconded... and to compound on the fallacious house-building analogy... Before you build anything, you have to have surveys done, blueprints created, probably some ground clearance/prep, probably need to negotiate utility hookups... all that stuff will take months before the first worker swings a hammer. And even when all the prep is done, all the materials are delivered and nothing goes horribly awry (ha!), you still won't get much more than the framework done in two months unless you've got a small army working on it. On Jun 19, 3:09 pm, "Jeremy Dunck" <[EMAIL PROTECTED]> wrote: > On 6/19/07, Brian Luft <[EMAIL PROTECTED]> wrote: > > > > > In my opinion, claims of learning curve time are somewhere between > > mildly and wildly exaggerated. In my opinion the actual learning > > curve will depend on a number of factors including but not limited to: > > You should make this a blog post and put it on Reddit. :) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Questions on learning curve
On 6/19/07, Brian Luft <[EMAIL PROTECTED]> wrote: > > In my opinion, claims of learning curve time are somewhere between > mildly and wildly exaggerated. In my opinion the actual learning > curve will depend on a number of factors including but not limited to: You should make this a blog post and put it on Reddit. :) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Questions on learning curve
In my opinion, claims of learning curve time are somewhere between mildly and wildly exaggerated. In my opinion the actual learning curve will depend on a number of factors including but not limited to: * Knowledge of Python * Familiarity with web application development * General software engineering knowledge * Understanding of RDBMS systems * Familiarity with Object-Relational Mapping (OR/M) systems * Understanding of Model-View-Controller (MVC) concepts * Desire to understand the underlying principles and specifics of the framework. * Willingness to learn new concepts Let me briefly clarify my points here. Python is generally considered to be easy to learn and work with but you will probably have the most success if you understand some of the higher-level features of the language and how best to leverage them. Any application framework (web, desktop, or otherwise) aims to abstract away the lower-level functionality and turn repetitive tasks into boilerplate code. Generally speaking, the more serious of an application you are attempting to create, the more important it is that you understand the underlying principles and what tradeoffs are incurred by use of the framework. Some people are perfectly happy to live "in ignorance" and just concentrate on relying on sample applications and tutorials to build off of. This is perfectly OK - you want to enjoy the process right? Chances are that the end result will suffer when evaluated from an architectural standpoint: security, stability, flexibility, and robustness. In many situations this can be acceptable. Also, a framework is not always the panacea that developers initially assume it will be. A developer picks up a framework and thinks "this will make development easier since a lot of functionality I need is already provided for me". However, depending on the complexity or requirements of your application you may find that some aspects get in the way of what you are trying to accomplish. Design decisions within the framework may hamstring certain functionality you are after. The framework may be geared toward many aspects of your development needs but may fall short in others. When met with these obstacles you need to decide on a strategy. Are you a framework purist - do you want everything to be coded consistently within the paradigm of the framework? Are you willing to hack the framework with your own customizations? Are you OK with developing certain portions of your application without using the facilities of the framework? Whatever you decide will take some committment in terms of research and work. As for your analogy about building a house, there is also an implied expertise and I think you are taking for granted all that goes into creating a well-built house. Just like a software application there are internal systems that need planning and coordination. To say that one could go out and build a house in two months is a big assumption. I'm not a contractor but I would be proud just get up 4 walls and a sink. My father worked at a lumber yard and hardware store for a period and at one point we decided to add on a bedroom. Even though my dad spoke with contractors all the time and already had the knowledge of what specific materials to use, it was still an all- summer project. Have you ever hung drywall on a ceiling? Ever laid tile or carpet? My dad is a pretty smart guy but we still ended up with things that were a half inch off here and there. You're talking about putting something together with multiple rooms, plumbing requirements, staircases, fireplaces, windows of all shapes and sizes, custom architectural features, considerations in building materials ranging from pipe thickness to wiring, meeting building codes, knowing when to bring in materials... Anyone who can accomplish this in a two month time span does so by relying on a tremendous amount of personal experience and having made and learned from many, many mistakes in the past. There is a reason that so many different types of contractors exist: plumbers, electricians, drywall specialists, roofers, floor specialists, etc. Each of those jobs requires a particular skill set and knowledge. The moral of the story is you get what you pay for. If you're looking to cut corners or go for the easy win then you're best off lowering your expectations a bit. Finally, when people say it takes X amount of time to get up to speed, that is completely relative. You need to decide for yourself what a unit of time represents. When people say a few days does that mean a few full days or a few days of dedicating an hour or two of leisure time after work? So for each "piece of the puzzle" that you need to overcome I would plan on spending a few solid days or few weeks of leisure time reading tutorials, surfing through the user documentation, and lurking on user mailing lists. That does not mean you can't be productive in the meantime, but I think you'll get the most
Re: persistant dict
Jeremy Dunck wrote: > On 6/19/07, Carl Karsten <[EMAIL PROTECTED]> wrote: >>> Which cache backend are you using? The snippet I linked is for *a* >>> backend. Many of the Django caching backends do need to pickle since >>> they marshal out of process. >> Um, "The django cache" implies there is only one. There may have been other >> stuff and I hate to be hostel about it, but I have no motivation to go >> digging >> up something that you trimmed. > > There is only one django.core.cache, but there are many backends, > depending on settings.CACHE_BACKEND. > > http://www.djangoproject.com/documentation/cache/#setting-up-the-cache > http://www.djangoproject.com/documentation/settings/#cache-backend This looks like what I did: http://www.djangoproject.com/documentation/cache/#the-low-level-cache-api > > There's no need to be hostile, I'm just trying to thoroughly answer > your question. When it comes time to deploy, you may use a cache > backend that has a different implementation and has the performance > issue you're trying to avoid. you thoroughly removed the question, which I think you are saying has not been adequately answered, and I can kinda see your point. I was able to stuff my code into a twisted based server and hit it with the client below. it works, but I am not thrilled about it, so a better solution will be welcomed. Carl K import sys, socket, pickle host=sys.argv[1] port=8007 sendme = sys.argv[2] size=len(sendme)**3 s=socket.socket(socket.AF_INET, socket.SOCK_STREAM ) s.connect((host, port)) s.send(sendme) data=s.recv(size) s.close() details=pickle.loads(data) for chunk,words in details: print chunk,words --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
International format for date and time
Sorry for the subject --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Internation format for date and time
There is a discussion about if Django should set the date and time to *ISO standard by default* or to following with the actual *north american*. Note that when you create a new project you could change the default to your localization for date and time (at least for north american localization). http://groups.google.com/group/django-developers/browse_thread/thread/6f3b9667130dc85d/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: persistant dict
On 6/19/07, Carl Karsten <[EMAIL PROTECTED]> wrote: > > > Which cache backend are you using? The snippet I linked is for *a* > > backend. Many of the Django caching backends do need to pickle since > > they marshal out of process. > > Um, "The django cache" implies there is only one. There may have been other > stuff and I hate to be hostel about it, but I have no motivation to go digging > up something that you trimmed. There is only one django.core.cache, but there are many backends, depending on settings.CACHE_BACKEND. http://www.djangoproject.com/documentation/cache/#setting-up-the-cache http://www.djangoproject.com/documentation/settings/#cache-backend There's no need to be hostile, I'm just trying to thoroughly answer your question. When it comes time to deploy, you may use a cache backend that has a different implementation and has the performance issue you're trying to avoid. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: persistant dict
Jeremy Dunck wrote: > On 6/19/07, Carl Karsten <[EMAIL PROTECTED]> wrote: > ... >> The django cache set/get does work. Thanks, M. > > Which cache backend are you using? The snippet I linked is for *a* > backend. Many of the Django caching backends do need to pickle since > they marshal out of process. Um, "The django cache" implies there is only one. There may have been other stuff and I hate to be hostel about it, but I have no motivation to go digging up something that you trimmed. Carl K --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Comparing dates..
Hi, I want to compare dates in my db while ignoring the year field. Lets say I have a birthday field and want to find upcoming birthdays in the next one week. How can I achieve this? If I try- last_date = datetime.now().date() + timedelta(days=7) users = User.objects.filter(birthday__day__lte = last_date.day) it throws an error that it can't resolve birthday__day into field. The exact comparison i.e. birthday__day=some_day works though. Thanks, Ram --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: How is profile_callback in django-registration supposed to work?
profile_callback, defined in registration.models (of course, you could also define it somewhere else ...) from www.user.models import UserProfile ... def profile_callback(user): new_user_profile = UserProfile.objects.create(user=user, status="1") new_user_profile.save() hope that helps, patrick Am 19.06.2007 um 20:13 schrieb [EMAIL PROTECTED]: > > Patrick, could you share your def profile_callback, or at least the > important parts of it. I'm still not getting anything created. > > On Jun 19, 1:04 pm, "patrick k." <[EMAIL PROTECTED]> wrote: >> I´m using profile_callback=True and then def profile_callback >> (user) ... >> >> it works. >> >> patrick >> >> Am 19.06.2007 um 20:02 schrieb [EMAIL PROTECTED]: >> >> >> >>> I've set: >>> def create_inactive_user(self, username, password, email, >>> send_email=True, profile_callback=create_site_user): >> >>> also tried profile_callback=create_site_user() -- wrong number of >>> arguments and profile_callback=create_site_user(new_user) but >>> new_user >>> doesn't exist yet. >> >>> I have a create_site_user function: >> >>> def create_site_user(new_user): >>> site_user = SiteUser.model( >>> user = new_user, >>> city = '', >>> state = '', >>> country = '', >>> zip = '', >>> show_real_name = True, >>> interests = '', >>> occupation = '', >>> gender = '', >>> birthday = None, >>> homepage = '', >>> icq = '', >>> aim = '', >>> yahoo = '', >>> msn = '' >>> ) >>> site_user.save() >> >>> But I can't seem to get this to work. >>> profile_callback=create_site_user doesn't seem to call the function >>> (there's definitely nothing being created), and I can't pass the >>> user, >>> since they don't really exist yet. > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
test client login problems
I'm running into problems with the test client's login method. Specifically, within a single test method, the first login succeeds but the second one fails. Is this something that should work ? Am I doing something wrong ? Here's an example : from django.test.client import Client from django.test import TestCase class ViewsTestCase(TestCase): [...] def testIndex(self): r = self.client.get('/db/org/') self.failUnlessEqual(r.status_code, 302) self.failUnlessEqual(r['Location'], '/db/accounts/login/?next=/db/org/') '/db/accounts/login/?next=/db/org/1/') r = self.client.login('/db/org/', 'regular_user', 'password') self.failUnlessEqual(r.status_code, 403) r = self.client.login('/db/org/', 'wing_chair', 'password') self.failUnlessEqual(r.status_code, 403) That last line causes this error : self.failUnlessEqual(r.status_code, 403) AttributeError: 'bool' object has no attribute 'status_code' I can't even see how to work out why it's failing (if I swap the two login calls, it's still the second that fails, BTW). Chris Brand --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: How is profile_callback in django-registration supposed to work?
I´m using profile_callback=True and then def profile_callback(user) ... it works. patrick Am 19.06.2007 um 20:02 schrieb [EMAIL PROTECTED]: > > I've set: > def create_inactive_user(self, username, password, email, > send_email=True, profile_callback=create_site_user): > > also tried profile_callback=create_site_user() -- wrong number of > arguments and profile_callback=create_site_user(new_user) but new_user > doesn't exist yet. > > I have a create_site_user function: > > def create_site_user(new_user): > site_user = SiteUser.model( > user = new_user, > city = '', > state = '', > country = '', > zip = '', > show_real_name = True, > interests = '', > occupation = '', > gender = '', > birthday = None, > homepage = '', > icq = '', > aim = '', > yahoo = '', > msn = '' > ) > site_user.save() > > But I can't seem to get this to work. > profile_callback=create_site_user doesn't seem to call the function > (there's definitely nothing being created), and I can't pass the user, > since they don't really exist yet. > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
How is profile_callback in django-registration supposed to work?
I've set: def create_inactive_user(self, username, password, email, send_email=True, profile_callback=create_site_user): also tried profile_callback=create_site_user() -- wrong number of arguments and profile_callback=create_site_user(new_user) but new_user doesn't exist yet. I have a create_site_user function: def create_site_user(new_user): site_user = SiteUser.model( user = new_user, city = '', state = '', country = '', zip = '', show_real_name = True, interests = '', occupation = '', gender = '', birthday = None, homepage = '', icq = '', aim = '', yahoo = '', msn = '' ) site_user.save() But I can't seem to get this to work. profile_callback=create_site_user doesn't seem to call the function (there's definitely nothing being created), and I can't pass the user, since they don't really exist yet. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Freelance Django Developer needed
Immediate Django Freelance Position Available DJANGO FREELANCE POSITION: What & When: We are currently looking for a part time or full time freelancer with experience in Python/Django available for July and/or August. In addition to Python and Django experience, ideally the freelancer should have experience with Subversion and PostgreSQL, though we are happy to provide additional learning opportunities. Who & Where: Red Redemption Ltd are an indie games company based in Oxford, UK, specialising in making games and community websites about sustainability, climate change or educational issues. For our community portals we generally use Django as it is a great fit and provides a much stronger framework for maintaining and expanding (compared to CMS we have used in the past such as Joomla). We are used to working with freelancers abroad as we are a distributed team, though the ideal freelancer would be based in the UK or Europe. Why: We are building a new Django portal (on a Debian server) which builds on the work we did with the Oxfordshire ClimateXchange site (http://www.climatex.org) for a related client, and though we have all the skills in-house, we are expanding and this project would benefit from an extra pair of hands and to cover holiday time. Initially the freelance work would be for a month, but if things worked out well it could become an ongoing relationship :) If you are interested, please contact me (Gobion Rowlands) at "freelancers [at] red-redemption.com" or via our website: http://www.red-redemption.com with examples of your work and CV/resume and your rates. Cheers, Gobion Rowlands Email: [EMAIL PROTECTED] --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
bug? admin, edit_inline=models.TABULAR, ValidationError
In the following case, the admin interface will highlight the fields as an error but not display the message. Is this a bug? def test_validate(field_data, all_data): raise ValidationError, "that is not good" class TestModel(models.Model): testFk= models.ForeignKey(OtherModel, edit_inline=models.TABULAR, num_in_admin=1) test_date = models.DateField(core=True, validator_list=[test_validate]) if you change it to edit_inline=models.STACKED it works. Also, it would be nice if I could have a row-level error message or even for that whole inline section. I've read about the issues of model level validation (that's what I really want) and I already realize that I'm bumping up against the limits of the admin interface. I am considering making it custom rather than admin. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: persistant dict
On 6/19/07, Carl Karsten <[EMAIL PROTECTED]> wrote: ... > The django cache set/get does work. Thanks, M. Which cache backend are you using? The snippet I linked is for *a* backend. Many of the Django caching backends do need to pickle since they marshal out of process. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: persistant dict
Jeremy Dunck wrote: > On 6/17/07, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > ... >> Use the low-level caching API to store things like this. Write a short >> funciton that retrieves a value from the cache and regenerates it and >> stores it if it is not in the cache. No extra work required. >> >> http://www.djangoproject.com/documentation/cache/#the-low-level-cache-api >> > > This may also be useful: > http://www.djangosnippets.org/snippets/155/ 18 stale_after,val = pickle.loads(val) "it takes 2x as long to de-pickle as it does to build the trie from scratch." which is about 20 seconds, so that won't work for me. The django cache set/get does work. Thanks, M. Carl K --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: admin css/images disappeared
On Jun 19, 5:55 am, "Evan Carmi" <[EMAIL PROTECTED]> wrote: > Hi, > > My admin css and images have disappeared. I am running django with > lighttpd. My settings contains: > - > # URL prefix for admin media -- CSS, JavaScript and images. Make sure to >use a > 39 # trailing slash. > 40 # Examples: "http://foo.com/media/;, "/media/". > 41 ADMIN_MEDIA_PREFIX = '/media/' > 42 > - > > My urls is: > - > from django.conf.urls.defaults import * > > urlpatterns = patterns('', > # Example: > (r'^polls/', include('binarymanipulations.polls.urls')), > # Uncomment this for admin: > (r'^admin/', include('django.contrib.admin.urls')), > (r'^date/', include('binarymanipulations.date.urls')), > (r'^blog/', include('binarymanipulations.blog.urls')), > (r'^contact/', include('binarymanipulations.contact.urls')), > (r'^comments/', > include('django.contrib.comments.urls.comments')), > ) > > - > > For an example the login screen: > > http://binarymanipulations.com/admin/ > > Any help would be greatly appreciated, > > Evan Evan, In your lighttpd configs, make an Alias for /media/ to your admin media itself. This should be found somewhere in django/contrib/ (in wherever you installed django). For info on Lighttpd aliases: http://www.cyberciti.biz/tips/configure-lighttpd-alias-mod_alias.html HTH, Michael --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Mysql sleeping queries
David Reynolds wrote: > Malcolm, > > On 19 Jun 2007, at 8:09 am, Malcolm Tredinnick wrote: > >> It would be interesting to know if anything prior to [5482] (that's >> 5482, not 5492) works. There was a very large change in [5482] that >> should be mostly invisible but may have some side-effects we need to be >> aware of. > > Thanks for your advice - I went back to 5481, which seems to have > cleared it up. i'm glad this fixed your problem, but please note that: from the information you provided, we know that 5481 works, but 5492 does not. but this does not mean that 5481 broke it. there are still 10 revisions (starting with 5482 and ending with 5491) which might or might not work. so if you have the possibility, please try to investigate which exact revision broke it for you. a simple binary search would work, like..try the "version in the middle" (5486). if works, then 5499, if does not work then 5484 etc. gabor --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: KeyError when using blocktrans
[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 %} > > However, the following works just fine: > > {% blocktrans with item.author as itemAuthor %}by {{ itemAuthor }} at{% > endblocktrans %} > > Bug? By design? Misconfiguration? > > Stack trace of the error is > > Traceback (most recent call last): > File "c:\python24\lib\site-packages\django\template\__init__.py" in > render_node > 712. result = node.render(context) > File "C:\Python24\lib\site-packages\django\templatetags\i18n.py" in > render > 73. result = translation.gettext(singular) % context > File "c:\python24\lib\site-packages\django\template\context.py" in > __getitem__ > 40. raise KeyError(key) > > KeyError at /planet/ > 'item.author' We just ran into this on our site, which is running on 0.96. I searched around in the Django tickets and changesets, and couldn't find a reference to this. Is this an intended part of the I18N design? Or, should a ticket be filed? (Or, is a ticket already filed and I missed it?) John --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Bug with regroup ? (which does not regroup as he shoud / I hope...)
Nicolas Steinmetz a écrit : [...] > I tried this but the bug persists. Sometimes it works well (technical > skills are well regrouped by technical domaines) but if I refresh, it's > no longer the case. > > I even tried this on an easier object and it does not work more > efficiently (user_skill in my view). If I do not add .order_by() in the > view, and add the |dictsort:"" filter, I have the same bug. If I add the > order_by() and the dictsort filter, bug remains. It only works well if I > add the order_by() and remove the dictsort filter. > > However for the 1st object on which I had the bug, I cannot sort it in > my views unless I decompose my model... > > Any other clue ? So should I fill a ticket or do I make something wrong ? Regards, Nicolas --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: FastCGI Shared host
I set APPEND_SLASH to false, I no longer get the APPEND_SLASH error, but I still get the WSGI errors. On Jun 19, 2:18 am, Jens Diemer <[EMAIL PROTECTED]> wrote: > rtconner schrieb: > > > ~/www/django> python mysite.fcgi > > ... > > Traceback (most recent call last): > > ... > > if settings.APPEND_SLASH and (old_url[1][-1] != '/') and ('.' not > > in old_url[1].split('/')[-1]): > > IndexError: string index out of range > > Content-Type: text/html > > This is probably the same problem like here: >http://code.djangoproject.com/ticket/3414 > > -- > Mfg. > > Jens Diemer > > > A django powered CMS:http://www.pylucid.org --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Dubai Holidays Arabian Nights http://aliozturk.blogcu.com
Dubai Holidays Arabian Nights http://aliozturk.blogcu.com ABU DHABI CITY TOUR http://aliozturk.blogcu.com Egypt Holidays Welcome To Civilisation http://aliozturk.blogcu.com Tunisia Holidays Carpets In Carthage http://aliozturk.blogcu.com Morocco Holidays An Exotic Spice http://aliozturk.blogcu.com North Africa Holidays A Hot Destination http://aliozturk.blogcu.com Syria Holidays The Cradle Of Civilizations http://aliozturk.blogcu.com Sharjah Holidays http://aliozturk.blogcu.com Saudi Arabia Holidays Arabian Kingdom http://aliozturk.blogcu.com Ras Al Khaimah Holidays Catch Of The Day http://aliozturk.blogcu.com Qatar Holidays http://aliozturk.blogcu.com Oman Holidays Water And Rock http://aliozturk.blogcu.com Jordan Holidays Sun Always Shines http://aliozturk.blogcu.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Apache auth
Hi, I've been playing with the apache auth from djangosnippets [0] and I've had it working, but it now seems to be erroring a lot with the following error: Mod_python error: "PythonAccessHandler historymagazine.modpython" Traceback (most recent call last): File "/usr/lib/python2.4/site-packages/mod_python/apache.py", line 287, in HandlerDispatch log=debug) File "/usr/lib/python2.4/site-packages/mod_python/apache.py", line 464, in import_module module = imp.load_module(mname, f, p, d) File "/var/www/django/historymagazine/modpython.py", line 2, in ? from django.core.handlers.base import BaseHandler ImportError: No module named django.core.handlers.base Anyone have any ideas why this might be happening? Thanks, David [0 - http://www.djangosnippets.org/snippets/62/] -- David Reynolds [EMAIL PROTECTED] smime.p7s Description: S/MIME cryptographic signature
Dubai Holidays Arabian Nights http://aliozturk.blogcu.com
Dubai Holidays Arabian Nights http://aliozturk.blogcu.com ABU DHABI CITY TOUR http://aliozturk.blogcu.com Egypt Holidays Welcome To Civilisation http://aliozturk.blogcu.com Tunisia Holidays Carpets In Carthage http://aliozturk.blogcu.com Morocco Holidays An Exotic Spice http://aliozturk.blogcu.com North Africa Holidays A Hot Destination http://aliozturk.blogcu.com Syria Holidays The Cradle Of Civilizations http://aliozturk.blogcu.com Sharjah Holidays http://aliozturk.blogcu.com Saudi Arabia Holidays Arabian Kingdom http://aliozturk.blogcu.com Ras Al Khaimah Holidays Catch Of The Day http://aliozturk.blogcu.com Qatar Holidays http://aliozturk.blogcu.com Oman Holidays Water And Rock http://aliozturk.blogcu.com Jordan Holidays Sun Always Shines http://aliozturk.blogcu.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Slugify in characters with accent and others
For if you need 'slug' non-ascii characters as *Á È ï ô ü ñ*, that will be converted to *A E i o u n* before of slug the string, I have added a patch in: http://code.djangoproject.com/ticket/2276 http://code.djangoproject.com/attachment/ticket/2276/defaultfilters.py.patch --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Mysql sleeping queries
Malcolm, On 19 Jun 2007, at 8:09 am, Malcolm Tredinnick wrote: It would be interesting to know if anything prior to [5482] (that's 5482, not 5492) works. There was a very large change in [5482] that should be mostly invisible but may have some side-effects we need to be aware of. Thanks for your advice - I went back to 5481, which seems to have cleared it up. The details, if you care: template output is now generated via iterators, rather than constructing a huge string and passing the string around. This should be mostly invisible. However, one thing that might be observable is that functions which are called to generate the template may not necessarily be called until the data is being sent back to the client. Ticket #4612, for example, shows how this can be a bit subtle in middleware (not actually a bug, just some experience gained). Now, I have no idea if this is affecting you, but off the top of my head, that is the biggest change we have pushed out lately. I can't think of any MySQL specific changes, but I'm getting old and my memory is failing sometimes, so maybe I've forgotten something. I didn't mention that we were using mysql_old (although I guess that was perhaps obvious from the version of MySQLdb). Having fixed the sites we have running trunk (by going back to r5481) we have noticed that the few sites we still have running pre-magic-removal also have sleeping processes - is this normal? Is there anything we can do to stop this? Thanks for your help, David -- David Reynolds [EMAIL PROTECTED] smime.p7s Description: S/MIME cryptographic signature
Re: HttpResponseRedirect and IE6
On 6/19/07, Merric Mercer <[EMAIL PROTECTED]> wrote: > > I am having real problems with IE6 and HttpResponseRedirect, IE keeps > showing a blank page, while Firefox works absolutely fine. > > Has anybody else come across this issue ? Not that I know of. Show us some code? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
HttpResponseRedirect and IE6
I am having real problems with IE6 and HttpResponseRedirect, IE keeps showing a blank page, while Firefox works absolutely fine. Has anybody else come across this issue ? Thanks MerMer --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: delete obsolete content type entries...
Gabriel Farrell schrieb: > On May 7, 4:32 am, Jens Diemer <[EMAIL PROTECTED]> wrote: >> That surprises me. Does nobody have the same problems? >> Still nobody delete a model class? >> >> How to clean up the django tables? With phpMyAdmin? >> > > I've just run into a similar issue when I removed an app from a > project. After some attempt to fix the tables myself, I held my > breath, dropped the tables (auth_permission and django_content_type), > then ran "python manage.py syncdb". Voila, the tables were re-created > correctly, without the app I had removed. Yes, you can drop and recreate the tables. But if you setup users and permissions, then IMHO you lost this :( For PyLucid i have made a small tool to fix this: http://pylucid.net/trac/browser/branches/0.8%28django%29/PyLucid/tools/clean_tables.py?rev=1085 -- Mfg. Jens Diemer A django powered CMS: http://www.pylucid.org --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Problems with running Django on a remote machine
On 19-jun-2007, at 0:59, Malcolm Tredinnick wrote: It runs untill I try to load a page (from another ssh shell). And I just get the prompt back: >> >> The server hangs on the next line, 272: >> self.result = application(self.environ, self.start_response) >> and just exits, without even getting to the except: > > Query: it hangs or it exits? Since they are opposites, it can't do > both. To be precise: It sits there for about a second and then it exits. > [...] > I'd start by checking how far through AdminMediaServer.__call__ you > get. > If it gets as far as line 613, start putting traps into > WSGIHandler.__call__ to see what's going on. This is as far as I am getting: this is 'up untill', these statements are not completed. I'm trying to follow the trail of failures here: in /core/servers/basehttp.py, line 272 (ServerHandler class, run method) self.result = application(self.environ, self.start_response) in the same module, line 614 (AdminMediaHandler class, __call__ method) return self.application(environ, start_response) in /core/handlers/wsgi.py, line 184 (WSGIHandler class, __call__ method) self.load_middleware() in /core/handlers/base.py, line 29 (BaseHandler class, load_middleware method) mod = __import__(mw_module, {}, {}, ['']) (with 'django.middleware.common' as mw_module) in /middleware/common.py, line 3 from django.core.mail import mail_managers in /core/mail.py, line 4 from email.MIMEText import MIMEText I also performed the __import__ statement from core/handlers/base.py in % python manage.py shell, but this seemed to be no problem in the interactive shell. Hopefully this makes more sense to you than it does to me. I'm afraid this is as far as I will get debugging, also since the debugging process is really a pain, having to modify those permission protected modules on the server with print statements, while keeping track of the originals ;-) It's only too bad that I cannot use the python built-in Traceback functionality. best dirk --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Django logging facilities
I used logging for a while but messages were dropped too often. I'm not entirely sure why, as logging is reputedly thread safe. Instead I switched to syslog, which is more reliable, but truncates log messages. Not so useful for later inspection of stack traces. I have not looked at configuring Apache logging, at the time I was afraid of it, but I'm beginning to think it's not so scary and might be a better fit. I do prefer to have application and web server logging in different locations however. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
admin css/images disappeared
Hi, My admin css and images have disappeared. I am running django with lighttpd. My settings contains: - # URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a 39 # trailing slash. 40 # Examples: "http://foo.com/media/;, "/media/". 41 ADMIN_MEDIA_PREFIX = '/media/' 42 - My urls is: - from django.conf.urls.defaults import * urlpatterns = patterns('', # Example: (r'^polls/', include('binarymanipulations.polls.urls')), # Uncomment this for admin: (r'^admin/', include('django.contrib.admin.urls')), (r'^date/', include('binarymanipulations.date.urls')), (r'^blog/', include('binarymanipulations.blog.urls')), (r'^contact/', include('binarymanipulations.contact.urls')), (r'^comments/', include('django.contrib.comments.urls.comments')), ) - For an example the login screen: http://binarymanipulations.com/admin/ Any help would be greatly appreciated, Evan --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
The Book
Just wanted to let you know that the Django Book seems to be due out June 26th, just got a mail from Amazon. /Lars --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Django logging facilities
Hi. I'm new to this list (and mostly to Django) and I just wanted to say hello first. I'm doing some research with Django and I came to the time of debugging my application. Actually, not only debugging, but logging what happens in my application for later processing. Is there any documentation on how to use the 'logging' Python module with Django? I'm been taking a look at 'django-logging'[1], which is a MiddleWare supposed to be used only when in DEBUG mode and not in "production" mode. Do you guys recommend using it for normal "production" mode or is there any better option? Thanks in advance, [1] http://code.google.com/p/django-logging/wiki/Overview -- teo - http://blog.eltridente.org "Res publica non dominetur" --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: FastCGI Shared host
rtconner schrieb: > ~/www/django> python mysite.fcgi > ... > Traceback (most recent call last): > ... > if settings.APPEND_SLASH and (old_url[1][-1] != '/') and ('.' not > in old_url[1].split('/')[-1]): > IndexError: string index out of range > Content-Type: text/html This is probably the same problem like here: http://code.djangoproject.com/ticket/3414 -- Mfg. Jens Diemer A django powered CMS: http://www.pylucid.org --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: WYSIWYG-editior in django
yarovit wrote: > Hello. How to connect FCKeditor to django? > there is some documentation about how to use the Dojo and the TinyMCE wysiwyg editors with django, maybe those help. go to code.djangoproject.com, search for "wysiwyg", and you should get the relevant links. gabor --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Most Wanted Services
Hi, For articles visit: http://www.telepk.com/articles/ For Beauty and Health Tips: http://www.telepk.com/beauty_and_health/ For Home Decoration: http://www.telepk.com/homedecoration/ For Technology News: http:/www.telepk.com/technews/ For Cricket News: http://www.telepk.com/sports/cricket/ For Online Flash Games: http://www.telepk.com/games/ For Software Downloads: http://www.telepk.com/downloads/ For ASP Tutorial: http://www.codedcode.com/asp/ For Myspace Layouts: http://www.myspacepk.com/ For News Blog: http://www.newsblogpk.com/ For MSN Block Checker: http://www.hotmailpk.com/ FOr Baby Names: http://www.babynamespk.com/ For Urdu Poetry: http://www.haroof.com/poetry/ Thanks! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
WYSIWYG-editior in django
Hello. How to connect FCKeditor to django? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Mysql sleeping queries
On Tue, 2007-06-19 at 06:51 +0100, David Reynolds wrote: > Morning, > > We are experiencing a problem with Mysql with django. Since an svn > up yesterday (which seems to be revision 5492) we have lots of > sleeping (hanging) mysql processes and we keep hitting our limit of > processes (which we weren't doing before). Anyone have any idea why > it may be doing this? > > Versions: > > apache 2.0.54 > mysql 4.0.24 > mysqldb 1.2.1c2-1 > > If anyone can shed any light, I'd be very interested to know. It would be interesting to know if anything prior to [5482] (that's 5482, not 5492) works. There was a very large change in [5482] that should be mostly invisible but may have some side-effects we need to be aware of. The details, if you care: template output is now generated via iterators, rather than constructing a huge string and passing the string around. This should be mostly invisible. However, one thing that might be observable is that functions which are called to generate the template may not necessarily be called until the data is being sent back to the client. Ticket #4612, for example, shows how this can be a bit subtle in middleware (not actually a bug, just some experience gained). Now, I have no idea if this is affecting you, but off the top of my head, that is the biggest change we have pushed out lately. I can't think of any MySQL specific changes, but I'm getting old and my memory is failing sometimes, so maybe I've forgotten something. Regards, Malcolm --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Mysql sleeping queries
On Tue, 2007-06-19 at 07:02 +0100, David Reynolds wrote: > On 19 Jun 2007, at 6:56 am, Gábor Farkas wrote: > > > hi, > > > > i have no idea what went wrong, but to the developers it certainly > > would > > help, if you could find out exactly which revision broke the mysql > > behaviour. > > Difficult to tell since we hadn't svn up'd for a while... The usual process would be to note the version you are at now and take a guess at an earlier version that worked (trial and error will do, if nothing else). "svn up" to the earlier version, check it works. Then split the difference and "svn up" to the version number in the middle, check if it works. If it does, move forwards halfway. If not, move back halfway. Rinse. Wash. Repeat. Regards, Malcolm --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Questions on learning curve
> Now, maybe a stupid question but for how long does it take to really > understand Django/Python and start actually creating some code for the > game? There are only parts of python you really need to learn to use Django, and other parts can be learned later. I read the book Beginning Python -- From Novice to Professional in about three days, then took about three days to go through the Django tutorial and the Django book. After that my first project was redoing my blog, which I felt totally comfortable with. I haven't hit any limitations since then. My .02c, Kelvin --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Questions on learning curve
On 19-Jun-07, at 11:21 AM, [EMAIL PROTECTED] wrote: > Now, maybe a stupid question but for how long does it take to really > understand Django/Python and start actually creating some code for the > game? from what i see on the IRC channel, you can pretty much start producing your game by day 3 > > Do I have to read XXX amount of Python books to be able to be > productive ? not at the outset - you can do the django tutorial and the python tutorial, both together would take you about three days. Then you can be productive - but to continue to be productive you will have to keep working on your python continously. -- regards kg http://lawgon.livejournal.com http://nrcfosshelpline.in/web/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Mysql sleeping queries
On 19 Jun 2007, at 6:56 am, Gábor Farkas wrote: hi, i have no idea what went wrong, but to the developers it certainly would help, if you could find out exactly which revision broke the mysql behaviour. Difficult to tell since we hadn't svn up'd for a while... -- David Reynolds [EMAIL PROTECTED] smime.p7s Description: S/MIME cryptographic signature