Poperty interfaces and tags
Hi guys! I'm wanting to implement what you can see at the django-tagging wiki page: a property interface to an object's tags. I got this working on my blog, but surprisingly I seem unable to get this working now. In my model definition, I have the following, beside other stuff: def _get_tags(self): return Tag.objects.get_for_object(self) def _set_tags(self, tag_list): Tag.objects.update_tags(self, tag_list) tagged = property(_get_tags, _set_tags) Then... Python 2.5.1 (r251:54863, May 2 2007, 16:56:35) [GCC 4.1.2 (Ubuntu 4.1.2-0ubuntu4)] on linux2 Type "help", "copyright", "credits" or "license" for more information. (InteractiveConsole) >>> from tagging.models import Tag >>> from anuncioslanzarote.anuncios.models import Entry >>> e = Entry.objects.get(pk=1) >>> Tag.objects.get_for_object(e) [, ] >>> e.tagged Traceback (most recent call last): File "", line 1, in AttributeError: 'Entry' object has no attribute 'tagged' Can't really tell why this happens. e.tagged is calling Tag.objects.get_for_object(), but is not getting the same result. Any ideas...? --~--~-~--~~~---~--~~ 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: Blog engine
Henrik Lied escribió: > This is great, Chris, but the fact of the matter is that it won't > appeal to the "Wordpress crowd". > That group wants in-browser setup, easy plugin architecture etc. > contrib.admin wouldn't do the trick. The admin-panel would have to be > hand made. > > For the plugin architecture: I have no idea how we'd do this well. Any > input here? > It *could* be done in a Facebook Apps-manner (the actual code is > remotely hosted, the admin-panel would show a list of available > plugins), but I don't know how ideal this would be in a real world > scenario. It sure would be great, though! > > > On Jul 25, 12:06 am, "Chris Moffitt" <[EMAIL PROTECTED]> wrote: > >> I think I mentioned earlier in this thread, that I do have my take on >> creating a blog here >> -http://www.satchmoproject.com/trac/browser/satchmoproject.com/satchmo... >> >> It's pretty full featured right now and makes use of the tagging and >> comment_utils libraries. It still needs the feeds but that should be pretty >> simple. It's BSD licensed so hopefully it will be useful to folks. >> >> -Chris >> > > > > > What about the symphony way of plugins? You have a page in the admin with the latest plugins available (rss?) and you just click one and the app downloads and istalls it. --~--~-~--~~~---~--~~ 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: Organising django projects
Almad escribió: > Hi, > > I'd like to ask how to organize Django application. To me, structure > of project/app is nice idea, however I have problems applying it in > practice, so I'd like to ask about best practices. > > Problems come, when application structure become deeper and nested. Is > it usual to start an application inside application? Django-admin > disagree with it. > > How is it with dependencies? When part of application depends on > another, should it be subapplication, or normal top-level application > depending on another one? > > Plus, when django philosophy is to have "application packages", why > are templates separated into another directory structure? I'm more > familiar (from my personal cherrypy structure) with lib/apps for > model, tpl/apps and web/apps separation for M/V/C, but django seem to > mixing it together. > > What are reasons for this and what are best practices for structuring > bigger/complicated apps? > > > > > Here's an example of my latest project structure: /var/www/django < this is on the pythonpath. everything else, beneath it. tagging, registration, etc. <- apps I consitently use across most projects are held just there. These are all svn checkouts. In case there is a backwards incompatible change affecting a project, the app gets copied into the project folder. project/ <--- the root project folder (eg. contains the settings and url files) is beneath the django folder, among the common apps. project/webroot/static < contains the files to be served statically project/webroot/php < I'm a minter :P and I keep php stuff on a separate subdomainm just in case I need to move it. Then, if an app is particularly bound to some project (eg a project with a single app, or apps being used ONLY for that project) are held beneath the project root. Each app holds it's own template directory. The app template loader looks for this directory when loading a template. Actually, my default project setup is pretty different from what you get with startproject . I wonder how I could change the template it uses... --~--~-~--~~~---~--~~ 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: Blog engine
Forest Bond escribió: > On Sun, Jul 29, 2007 at 05:49:54PM -, Henrik Lied wrote: > >> @Forest: I agree, it should be that simple. But let's say you've got a >> comment reply plugin. How would we - through a middleware - manage to >> intercept our usual comment system, and modify the HTML template >> source to fit the plugin? It's cases like these I see the potential >> pitfalls of our way of thought. Please, enlighten me if the answer is >> simple. :-) >> > > Well, extensibility is tough for exactly that reason. You have to anticipate > the ways in which your application might be extended. This is an extremely > difficult task, for that simple reason that it is impossible to predict the > future. > > You really don't want to be modifying templates (or any other source files) > when > a new plugin is installed. What you do want is to have placeholders in your > templates where plugins may contribute additional markup that will appear on > the > page. > > -Forest > What most of you take as prototype is wordpress. And there are quite some plugins requiring you to modify your templates. If a plugin is to actually *output* anything into a template, it might have a few template files that define an outcome. Then, you must only {% include %} that file in an appropiate place. Seems flexible enough to me, while newbies do only have to copy-paste the include tag into their template. Of course, if the templating engine is solid, themes are to be released, and, as with wordpress, there can be many themes like K2, that are already aware of many most-used plugins. Just to make it clear. It's still the template's job to take care of display. The plugin must not *modify* a single source file, as stated above. And, Forest, if you provide enough hooks where plugins can join the app's flow (like the plugin middleware, and the template imports), you're done predicting the future. We just have to think about the right places where to place hooks. Actually, is there anyone *really* able to contribute some code to this endeavour? Chris --~--~-~--~~~---~--~~ 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 do I echo template variables?
Nathan Ostgard escribió: > Try: {{ data|pprint }} > > On Jul 29, 10:42 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > >> I'm coming from CakePHP and I would typically set a variable for use >> in my view with a call to findAll. Since there is a lot of data in the >> array, I typically do something like: >> >> >> >> >> >> This way, I can find out what data is available in the view and figure >> out how much I can scale back the recursion. >> >> Is there any equivalent in Python/Django? I've searched and didn't >> come up with anything. >> I didn't know of that function. Nice to know. But, is there a var where to access *all* the vars available in the template and it's contents? I've been needing that one for debugging for ever! --~--~-~--~~~---~--~~ 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 do I echo template variables?
Russell Keith-Magee escribió: > On 7/30/07, Chris Hoeppner <[EMAIL PROTECTED]> wrote: > >> I didn't know of that function. Nice to know. But, is there a var where >> to access *all* the vars available in the template and it's contents? >> I've been needing that one for debugging for ever! >> > > Try {% debug %} > > http://www.djangoproject.com/documentation/templates/#debug > > Yours > Russ Magee %-) > > Gotta give more time to doc-reading. Helpful as always, Russ! 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 -~--~~~~--~~--~--~---
Re: how to overcome {% if %} limitation
james_027 escribió: > Thanks everyone! > > > > > There's actually a reason for templates and views being two separate entities. --~--~-~--~~~---~--~~ 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: checkbox (newforms)
Enquest escribió: > In my form I got {{ form.boxes }} > Form.boxes contain 10 checkboxes that are displayed in a ul li list. > However I want them in three columns so I thougt I should be able to > acces each in by {{ form.boxes.1 }} or {% for item in boxes %} > Alas this does not work. The IRC channel didn't help ... So how do i do > this? > > Enquest > > > > > What is form.boxes (ie. what kind of data is it?) --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Count the times a user has logged into the system
I can recall this being covered some time ago, but google won't throw up my answers. So, sorry for double post :) I'd like to count the times a user has logged in (if possible without hacking on contrib.auth). Actually just the first 10 times or so. I want to show a few mini-tutorials the first few times the user logs in. Like the first 3 or 5 times for basic stuff, and 7 - 8 for the more esoteric features. I can easily count, for example, the posts a user has made, since they're linked to him through a foreign key (user.post_set.count()) and things like that, but how to count the times a user has logged in? Thanks for your continuous help! --~--~-~--~~~---~--~~ 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: Count the times a user has logged into the system
Seems a bit hacky actually. But if there's no other way... Thanks a lot Mackenzie! 2007/8/2, Mackenzie Kearl <[EMAIL PROTECTED]>: > > you can just create a profile with a field number of times logged in. > This could be updated in a custom login view that you write. > > check out http://www.djangobook.com/en/beta/chapter12/ > > def login(request): > username = request.POST['username'] > password = request.POST['password'] > user = auth.authenticate(username=username, password=password) > if user is not None and user.is_active: > # Correct password, and the user is marked "active" > auth.login(request, user) > # Redirect to a success page. > return HttpResponseRedirect("/account/loggedin/") > else: > # Show an error page > return HttpResponseRedirect("/account/invalid/") > > > > > -- Best Regards, Chris Hoeppner - www.pixware.org // My weblog --~--~-~--~~~---~--~~ 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: Internationalization and accents
That's not a bug ;) You should avoid using non-ascii chars in msgid strings. This has nothing to do with Django, but with gettext (the "translation" engine behind the scene) itself. There's no point in using non-ascii chars anyways, since msgid strings are thought to be message identifiers, not actual human-understandable strings. Just placeholders. Though using the actual words to be translated eases the job a lot. Also, keep an eye out for entries marked as "fuzzy" as they won't be used by gettext. 2007/8/2, Jonas <[EMAIL PROTECTED]>: > > There seems to have a bug with the internationalization. > When the (result) translated string has accents, that is the "msgstr" > in the .po file, there is no problem. > > But when the string TO BE translated has accents, that is the "msgid" > in the .po file, no substitution occurs in the translated page. > > Has anybody else experienced this? I think that's a real nuisance: why > should the original language be English? > > I have already mentionned, with more details, the problem in the > subject "Accents in translation strings", but there was no answer, so > I repeat it. > > Jonas > > > > > -- Best Regards, Chris Hoeppner - www.pixware.org // My weblog --~--~-~--~~~---~--~~ 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: website template compatible with django
Oh and please don't call Template Monster "professional"... Please... 2007/8/3, Chris Hoeppner <[EMAIL PROTECTED]>: > Though you would still need to adapt them to be used with Django. > IMHO, there's not much sense in publishing "Django templates" since > every app is completely different, and this kills the > "plug-and-play-ability" of any template. > > 2007/8/3, Kenneth Gonsalves <[EMAIL PROTECTED]>: > > > > > > On 01-Aug-07, at 12:32 PM, Ben wrote: > > > > > I am a total Django newbie. Hence the probably silly questions: > > > There are professional-looking website templates for sale in several > > > places (templatemonster, etc). > > > Can those be used easily with Django ? > > > > yes > > > > > Do they need to be designed specifically for Django ? > > > > no > > > > > Do you know of > > > any vendor that does it ? > > > If not, what to look for in a template order to make sure it will be > > > relatively easy to use with Django ? > > > > the template part is completely independant of the rest of django - > > any template that follows the principles of good HTML design using > > css, javascript, ajax or whatever will work with Django - even bad > > design will work. The more modular the design of the template, the > > better - but again that is not django specific. > > > > -- > > > > regards > > kg > > http://lawgon.livejournal.com > > http://nrcfosshelpline.in/web/ > > > > > > > > > > > > > > > -- > Best Regards, > Chris Hoeppner - www.pixware.org // My weblog > -- Best Regards, Chris Hoeppner - www.pixware.org // My weblog --~--~-~--~~~---~--~~ 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: Job Fair F/OSS project
What kind of volunteers do are you looking for? What kind of tasks are you looking to resolve? If I could have some more details (maybe have a look at the proposed timeline) I'd be in :) 2007/8/3, [EMAIL PROTECTED] <[EMAIL PROTECTED]>: > > I'm looking for some volunteers for a new open source project. At the > Institute of Design (http://www.id.iit.edu ), our next project is a > system for the management of our job fair (http://www.id.iit.edu/ > recruitID/ ) > > The systems goal is to allow students and employers to enter their > availability for interviews and have the system designate times and > rooms for each to meet for interviews. The system includes much more > than just this of course, but that is the main goal. We decided that > this application is generic enough that it should be made into an F/ > OSS project. > > So far the system will be built on Django and uses (hopefully) > Prototype.js > > I've only really been using Django for a month now so anyone with real > experience would be appreciated. > > The project is on the ground floor and some basic wire frames and a > few other preliminary designs. > > I'm personally located in Chicago and West Virginia (about half of my > time spent in each place), though you are welcome to help out from > anywhere around the world! > > If you're interested, reply to this message, or contact me at cezar AT > id.iit.edu > > > > > -- Best Regards, Chris Hoeppner - www.pixware.org // My weblog --~--~-~--~~~---~--~~ 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: website template compatible with django
Though you would still need to adapt them to be used with Django. IMHO, there's not much sense in publishing "Django templates" since every app is completely different, and this kills the "plug-and-play-ability" of any template. 2007/8/3, Kenneth Gonsalves <[EMAIL PROTECTED]>: > > > On 01-Aug-07, at 12:32 PM, Ben wrote: > > > I am a total Django newbie. Hence the probably silly questions: > > There are professional-looking website templates for sale in several > > places (templatemonster, etc). > > Can those be used easily with Django ? > > yes > > > Do they need to be designed specifically for Django ? > > no > > > Do you know of > > any vendor that does it ? > > If not, what to look for in a template order to make sure it will be > > relatively easy to use with Django ? > > the template part is completely independant of the rest of django - > any template that follows the principles of good HTML design using > css, javascript, ajax or whatever will work with Django - even bad > design will work. The more modular the design of the template, the > better - but again that is not django specific. > > -- > > regards > kg > http://lawgon.livejournal.com > http://nrcfosshelpline.in/web/ > > > > > > -- Best Regards, Chris Hoeppner - www.pixware.org // My weblog --~--~-~--~~~---~--~~ 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: Job Fair F/OSS project
Trac seems a good idea. Self hosted is always better. Well, if the project goes active, just drop me a line. I'm pretty busy atm, but I can find time to help with this project. Thanks for the reply, emperor. 2007/8/3, [EMAIL PROTECTED] <[EMAIL PROTECTED]>: > > Well, all that stuff is still up in the air. This is the very-very > beginning of the project. > > I think the first thing I'd like to do is to setup a site, like google > code or sourceforge. If anyone has a suggestion about which one is > better, that'd be great. I know they all use SVN (I use Git), so > that's not a factor. It's also possible for me to just setup a Trac > site (I'm most likely gonna setup one anyhow) like I've been using > with my previous internal projects and forego sourceforge and google > code. > > On Aug 3, 5:12 am, "Chris Hoeppner" <[EMAIL PROTECTED]> wrote: > > What kind of volunteers do are you looking for? What kind of tasks are > > you looking to resolve? > > > > If I could have some more details (maybe have a look at the proposed > > timeline) I'd be in :) > > > > 2007/8/3, [EMAIL PROTECTED] <[EMAIL PROTECTED]>: > > > > > > > > > > > > > I'm looking for some volunteers for a new open source project. At the > > > Institute of Design (http://www.id.iit.edu), our next project is a > > > system for the management of our job fair (http://www.id.iit.edu/ > > > recruitID/ ) > > > > > The systems goal is to allow students and employers to enter their > > > availability for interviews and have the system designate times and > > > rooms for each to meet for interviews. The system includes much more > > > than just this of course, but that is the main goal. We decided that > > > this application is generic enough that it should be made into an F/ > > > OSS project. > > > > > So far the system will be built on Django and uses (hopefully) > > > Prototype.js > > > > > I've only really been using Django for a month now so anyone with real > > > experience would be appreciated. > > > > > The project is on the ground floor and some basic wire frames and a > > > few other preliminary designs. > > > > > I'm personally located in Chicago and West Virginia (about half of my > > > time spent in each place), though you are welcome to help out from > > > anywhere around the world! > > > > > If you're interested, reply to this message, or contact me at cezar AT > > > id.iit.edu > > > > -- > > Best Regards, > > Chris Hoeppner -www.pixware.org// My weblog > > > > > -- Best Regards, Chris Hoeppner - www.pixware.org // My weblog --~--~-~--~~~---~--~~ 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: Something like a mini Crystal Reports with Django
Need another tester? Count me in. 2007/8/4, Mir Nazim <[EMAIL PROTECTED]>: > > Me too me too. > > Ben, Let us know if you need help with testing or some thing else. > I will more interested in Models and View than template. > > > > On Aug 3, 11:51 am, "Matt Davies" <[EMAIL PROTECTED]> wrote: > > Ben, I'd be interested in looking at that application. > > > > Need someone to help with testing? > > > > On 03/08/07, Ben Ford <[EMAIL PROTECTED]> wrote: > > > > > > > > > I'm working on a django app at the moment that allows you to define and > > > save reports. It has a method similar to templatetags for loading user > > > defined functions to add to the reports too. As it stands you can build > > > and > > > save these reports with a web front end, and download the results in CSV. > > > I > > > just need to write a front end for creating filters and it'll be good to > > > go. > > > I'll be happy to release it for the benefit of others when it's done. > > > Ben > > > > > On 03/08/07, Mir Nazim <[EMAIL PROTECTED]> wrote: > > > > > > I understand that views need to be created. I am doing that these > > > > days. > > > > > > What specifically I wanted to know is whether anyone else has worked > > > > on a similar stuff. So he might want to share his experience. > > > > > > BRIT is Java. I would prefer something more python based solution. > > > > even better is there is a django based one. If there is none, its > > > > obvious I will have to create one. > > > > > > On Aug 2, 8:20 pm, Lucky B < [EMAIL PROTECTED]> wrote: > > > > > You could try Eclipse BIRT for a WYSIWYG interface. But otherwise you > > > > > can create a view however you want to report your data doing whatever > > > > > manipulation you wanted. I don't see what else you would need other > > > > > than to create a view. > > > > > > > On Aug 2, 5:17 am, Mir Nazim <[EMAIL PROTECTED]> wrote: > > > > > > > > Anybody has any views on this. > > > > > > > > -- > > > > > > PS: posting just to keep this topic fresh > > > > > > > > On Jul 31, 4:28 pm, Mir Nazim <[EMAIL PROTECTED]> wrote: > > > > > > > > > Hello > > > > > > > > > I was wondering has anybody done application that was something > > > > like a > > > > > > > mini crystal reports. Generating a report based of model items > > > > > > > selected in a WYSIWYG(ok this is not important) fashion. And > > > > > > > generating a HTML tables based report with defined calculations > > > > etc. > > > > > > > > > I understand that Django Admin has some kind of similar > > > > facilities. I > > > > > > > am looking into them. In the mean time thought that may be some > > > > one > > > > > > > else might be doing similar stuff somewhere. > > > > > -- > > > Regards, > > > Ben Ford > > > [EMAIL PROTECTED] > > > +628111880346 > > > > > -- Best Regards, Chris Hoeppner - www.pixware.org // My weblog --~--~-~--~~~---~--~~ 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: PAK Host Online(PHO) - Web Hosting, Free Domain Registration /Transfer, Website Builder & Web Marketing in Pakistan, Karachi, Lahore, Islamabad & Rawalpindi at http://www.pakhostonline.com/
I *hate* spammers. 2007/8/5, koom2020 <[EMAIL PROTECTED]>: > > PAKHostOnline.com offered Pakistan No.1 Web Hosting, DOMAIN > Registration / Transfer, 99% UP-Time, 24/7 Technical Support at > http://www.pakhostonline.com/ > > > > > -- Best Regards, Chris Hoeppner - www.pixware.org // My weblog --~--~-~--~~~---~--~~ 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: Replying to spam messages
Sorry, Russ. Won't happen again :) 2007/8/6, Russell Keith-Magee <[EMAIL PROTECTED]>: > > On 8/6/07, Chris Hoeppner <[EMAIL PROTECTED]> wrote: > > > > I *hate* spammers. > > And I like ponies. > > You aren't alone in hating spam, but unfortunately, its the price you > pay for having an open mailing list. Replying to these messages > doesn't help to stop the problem - it makes it WORSE it two very > specific ways: > > 1) It increases the level of pointless noise traffic on the list. > 2) It increases the likelyhood that you yourself will be filtered into > the spam bucket, since your name gets associated with spammy content. > > The second point isn't abstract. There are a number of users that feel > the need to reply to spam messages, and without exception, my spam > filter now puts any thread they start into my spam bucket rather than > my inbox. > > So if you want your posts to get attention - PLEASE stop replying to > spam messages. > > Yours, > Russ Magee %-) > > > > -- Best Regards, Chris Hoeppner - www.pixware.org // My weblog --~--~-~--~~~---~--~~ 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: The Django Book
I have already pre-ordered from amazon. 2007/8/6, Jeremy Dunck <[EMAIL PROTECTED]>: > > On 8/6/07, Tim Chase <[EMAIL PROTECTED]> wrote: > > My understanding is that the djangobook project has either > > > > 1) been put on hold until the 1.0 API solidifies or > > 2) doing some pre-press stuff that's not interesting and thus not > > public > > > > There's some non-public pre-press stuff going on, and there's > significant editing already done. I don't think there'll be another > site update until the book is ready for press; at that point, the > preferred url will be / rather than /beta (or similar). > > > > -- Best Regards, Chris Hoeppner - www.pixware.org // My weblog --~--~-~--~~~---~--~~ 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.views.generic.simple
This view is useful for showing static "process done" messages, where you actually might need a bit of context, like a username of confirmation number. Any page that doesn't need anything more complex than echoing a few vars, can be done with this. If what you really need is absolutely static pages (an about us page, perhaps?), you might want to look into the flatpages app, which lets you store contents in the database, and edit it in the admin. Good Luck, and may the Code be with you :P 2007/8/8, james_027 <[EMAIL PROTECTED]>: > > hi, > > is the purpose of this view for showing static html page? if not what > is the use of this view? > > Thanks > james > > > > > -- Best Regards, Chris Hoeppner - www.pixware.org // My weblog --~--~-~--~~~---~--~~ 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 hosting companies
> Are you using a django friendly hosting company? Who are they? Are > they great/ok/crappy? How much do you pay a yr? I'm hosting everything I have at media temple (mediatemple.com), and they're very nice people. I have a dedicated box, but they're working on a very nice solution to deploy django on their "low-end" servers, the grid. I'm just waiting for it to "downgrade" back to the grid, since it's the only reason I'm paying for a dedicated one. My $0.02. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~--- begin:vcard fn:Christian Hoeppner n:Hoeppner;Christian email;internet:[EMAIL PROTECTED] note:I am a freelance coder specialized in web applications and their deployment at a small or medium scale. x-mozilla-html:FALSE version:2.1 end:vcard
Re: enable auto reload from the python
[EMAIL PROTECTED] escribió: > Hi, > > I am testing my Model from the python shell and I would like to know > if I could enable auto-reloading? > > Thanks, > > Julien > > > > > Auto-reloading? You mean re-importing the module when something changed. I don't know of anything like that, though you might want to have a look at the dev server, as it seems to notice when something changes in the momdules. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~--- begin:vcard fn:Christian Hoeppner n:Hoeppner;Christian email;internet:[EMAIL PROTECTED] note:I am a freelance coder specialized in web applications and their deployment at a small or medium scale. x-mozilla-html:FALSE version:2.1 end:vcard
Re: unbit.it hosting
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 > File > "/usr/lib/python2.4/site-packages/django/db/backends/mysql/base.py", > line 97, in cursor >kwargs['port'] = int(settings.DATABASE_PORT) > > ValueError: invalid literal for int(): marco_db1 What's your value for DATABASE_PORT? -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFGxr1/SyMaQ2t7ZwcRAkl3AJ0TEEvPFh7KLz/r4s25fNlPnuKF7ACfcZVy tsO8BoSy/sKVSSuiln0rrKE= =vtYh -END PGP SIGNATURE- --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~--- begin:vcard fn:Christian Hoeppner n:Hoeppner;Christian email;internet:[EMAIL PROTECTED] note:I am a freelance coder specialized in web applications and their deployment at a small or medium scale. x-mozilla-html:FALSE version:2.1 end:vcard
List comprehension with unique, sorted values
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi there! I thought this is just the kind of questions you love :) I haven't been able to find concise information about this on the net. I need to construct a choices var for a field widget at runtime, with the data from my database. Actually, I want to give a select field options depending on the values in the database, and since there's no separate table for those options, and it doesn't make sense creating one just for this purpose, I resorted to list comprehensions to filter/map a queryset into a valid choice list. It works like a charm, but I'm obviously getting duplicates, and the choices are not sorted. My current code looks like this: all_props = Property.objects.all() rooms_choices = [(p.rooms, p.rooms) for p in all_props] Ideally, I'd do something like "for p in all_props if p.rooms not in rooms_choices" but I have no clue on how to access the being-built list, nor how to compare to the values inside the tuple. Any ideas? :) ~Chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFGyKurSyMaQ2t7ZwcRApCMAKDcVkDlodXx5gbL6u5Rc2UgzdM6QwCdHU5H Q4AQ3q9h4dIHVMZhHzZ0afM= =xAbb -END PGP SIGNATURE- --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~--- begin:vcard fn:Christian Hoeppner n:Hoeppner;Christian email;internet:[EMAIL PROTECTED] note:I am a freelance coder specialized in web applications and their deployment at a small or medium scale. x-mozilla-html:FALSE version:2.1 end:vcard
Dynamic OR queries
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi there! I was just wondering how to dynamically "or" together an indetermined quantity of Q objects. They're constructed from a string like q=a+b+c, which would get stiched together as "(Q(field=a) | Q(field=b) | Q(field=c))". Any clue on how to do it with unknown parameters? It will need to work with a+b, just like a+b+c+d+e+f+g+h... You get it :) -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFG0FuLSyMaQ2t7ZwcRAjX2AKCPMlrRZ/L1UrloTFtdhih4hUjLJgCgz076 r/ij0zbfMBsM0FCzAHbXECU= =C+kv -END PGP SIGNATURE- --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~--- begin:vcard fn:Christian Hoeppner n:Hoeppner;Christian email;internet:[EMAIL PROTECTED] note:I am a freelance coder specialized in web applications and their deployment at a small or medium scale. x-mozilla-html:FALSE version:2.1 end:vcard
Re: Choices cannot be marked for translation?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Kenneth Gonsalves escribió: > hi, > > when i upgraded to the latest svn head, I found that all the places > in admin that had drop downs for choices were blank. I had always > marked my choices for translation like so: > > article_type = ( > ("NW", _("News")), > ("FT",_("Features")), > ) > > now, this doesnt work - when I remove the _(), then the choices > appear. How do I then mark them for translation? > Make sure to use gettext_lazy -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFG1EyOSyMaQ2t7ZwcRAgMiAKCXgHMMs+GgGxhTb5MDrXvPE/omfwCcCL62 en0reRc7vwT/s4WZuRnA8Ns= =dHi8 -END PGP SIGNATURE- --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~--- begin:vcard fn:Christian Hoeppner n:Hoeppner;Christian email;internet:[EMAIL PROTECTED] note:I am a freelance coder specialized in web applications and their deployment at a small or medium scale. x-mozilla-html:FALSE version:2.1 end:vcard
Re: Image manipulation
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 SlavaSh escribió: > I need to add dynamic text to animated GIF images. > What is a best way to do it? > > Thanks. Using the PIL (Python Imaging Library) :) -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFG1HUKSyMaQ2t7ZwcRAv/dAKCW0xabHQK+1MxFvOVz1PqYEr7r/ACgxcEa 09CcUN/D/IU8kCCC5Z9FtpQ= =6td/ -END PGP SIGNATURE- --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~--- begin:vcard fn:Christian Hoeppner n:Hoeppner;Christian email;internet:[EMAIL PROTECTED] note:I am a freelance coder specialized in web applications and their deployment at a small or medium scale. x-mozilla-html:FALSE version:2.1 end:vcard
Re: Django Development Position
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 > I forgot to mention that this position is located in New York, NY and > applicants must be US citizens with no criminal history. What a shame. You were talking just about me, but I don't meet the US citizen thing. We'll talk when you think about telecommuters. Good Luck! -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFG1JbjSyMaQ2t7ZwcRAmR0AKCZkyjf6QKMoH5nbp6osrGsEcLv1wCfTvfm rOVdttrvCEtfGBIVsURJ048= =gD7y -END PGP SIGNATURE- --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~--- begin:vcard fn:Christian Hoeppner n:Hoeppner;Christian email;internet:[EMAIL PROTECTED] note:I am a freelance coder specialized in web applications and their deployment at a small or medium scale. x-mozilla-html:FALSE version:2.1 end:vcard
Obtain a range of values out of the database
Hi there! I'd like to obtain a range of possible values out of the database. So, if for a certain field, the values in the database are [3,7,5,1,8,12,6], I'd like to push those into a dropdown. No problem with the dropdown part. But how do I manage to get such a list? And what about sorting it? Thanks! ~ Chris --~--~-~--~~~---~--~~ 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: log in without loggin in
I think there's a chapter in the django book about authentication backends, and that's right what you need. El mar, 04-09-2007 a las 02:28 -0700, Dushyant Sharma escribi�: > hi it might sound strange but what i am thinking is to use two servers > one for authentication only and one for serving normal content. > authentication server can not come into direct contact with users. > here how it goes. > > suppose we have user server USrv and authentication server ASrv. > auth_user table is at ASrv only. > request for log in from the user goes to USrv. Usrv sends it to ASrv > for authentication. If ASrv says the user is authentic then USrv treat > the user as logged in without actually calling authenticate() function > for it. > > > > --~--~-~--~~~---~--~~ 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 finnish after upgrading to latest svn head
Make sure you're serving the content with the right content type in HTML, and that Django is working with the right content type, and that the files have a coding declared. El jue, 06-09-2007 a las 16:24 +0530, Kenneth Gonsalves escribió: > hi, > I have a site in finnish. It was rendering fine until I upgraded to > the latest svn head. Now the character A with marks on top of it > refuses to render. The other finnish characters are rendering. Any > clues? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Capisdjango
I was just wondering. Consider this an "aside" or of the kind. Why hasn't anyone thought of something like capistrano for django. (Yeah I know it can work, but there're a few features for RoR'ers). --~--~-~--~~~---~--~~ 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: Capisdjango
Sure. Anyone to join me? El sáb, 08-09-2007 a las 07:32 -0500, James Bennett escribió: > On 9/8/07, Chris Hoeppner <[EMAIL PROTECTED]> wrote: > > Why hasn't anyone thought of something like capistrano for django. (Yeah > > I know it can work, but there're a few features for RoR'ers). > > Lots of people have thought of it. What they haven't done is written > it. Want to be the first? ;) > --~--~-~--~~~---~--~~ 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: Philosophy behind the Django admin
This is actually outlined in the Django Book. http://www.djangobook.com/en/beta/chapter18/ Here's the relevant piece: > The Zen of Admin > > At it's core, Django's admin is designed for a single activity: > > 1 > Trusted users editing structured content. > > > Yes, extremely simple -- but in that simplicity lies a whole host of > suppositions that the admin takes as given. The entire philosophy of > Django's admin follows directly from these assumptions, so let's dig > into the subtext of this phrase: > > 1 > "Trusted users ..." > > The admin is designed to be used by people who you, the developer, > trust. This doesn't just mean "people who have been authenticated;" it > means that Django assumes that your content editors can be trusted to > do the right thing. > > 2 > This means that there's no "approval" process for editing content -- if > you trust your users, nobody needs to approve of their edits. It also > means that the permission system, while powerful, has no support for > limiting access on a per-object basis. If you trust someone to edit > their own stories, you trust them not to edit anyone else's without > permission. > > 8 > ".. editing ..." > > The primary purpose of Django's admin is to let people edit stuff. > This seems obvious at first, but again has some subtle and powerful > repercussions. > > 2 > For instance, although the admin is quite useful for reviewing data > (see above), it's not designed with that purpose as a goal: note the > lack of a "can view" permission (see Chapter 12). Django assumes that > if people are allowed to view content in the admin, they're also > allowed to edit it. > > 1 > Another more important note is the lack of anything even remotely > approaching "workflow." If some given tasks requires a series of > steps, there's no support for enforcing that they be done in any > particular order. Django's admin focuses on editing, not on activities > surrounding that editing. This avoidance of workflow also stems from > the principle of trust: the admin's philosophy is that workflow is a > personnel issue, not one to be implemented in code. > > 3 > Finally, note the lack of aggregation in the admin. That is, there's > no support for displaying totals, averages, etc. Again, the admin is > for editing -- it's expected that you'll write custom views for all the > rest. > > > "... structured content" > > As with the rest of Django, the admin wants you to work with > structured data. Thus, the admin only supports editing data stored in > Django models; for anything else, you'll need custom views. > > > Full stop > > It should be clear by now that Django's admin does not try to be all > things to all people; instead we choose to focus tightly on one thing, > and do that thing extremely well. > > > When it comes to extending Django's admin, much of that same > philosophy holds (note that "extensibility" shows up nowhere in our > goals). Because custom Django views can do anything -- and because they > can easily be visually integrated into the admin (see below) -- the > built-in opportunities for customizing the admin are somewhat limited > by design. --~--~-~--~~~---~--~~ 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 deployment à lá Capistrano
> 3) Modifying the production database as necessary. There's one major problem point in making this happen: Rails' migrations. It's pretty simple really, once laid out. Beside svn & tar methods, this is one of the most complex point of this project, and it's also one of the points I'd need most help. > Would it not be > better to look at writing a django recipe for capistrano rather than > trying to re-implement it? Also, we can use a ferrari to drive heavy cargo. It's not really about "can I use it", but more about "will it be really useful? easy to use? what degree of easing will i achieve?"... you get it. Also, I think the community will benefit from such a tool. Deploying a django project has always been a complex point in my early days with it. Making tasks to automate server setups would also be a great plus point for all the django newbies. I think merging all of these ideas into one big django-addon would be a gorgeous idea for all of us. Not only rails is fun! --~--~-~--~~~---~--~~ 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 deployment à lá Capistrano
I see your point. Why reinvent the wheel? True. But I'm not trying to re-do capistrano using python instead of ruby. Capistrano has been the spark that made me think about doing this, but that's all there is to Capistrano. I'm doing this because: 1) I've anyways been thinking about this for ages. 2) I'd love to "djangostrano.py publish" or "djangostrano.py update-remote". 3) What about rails' migrations? It's *the* feature I've been dreaming of for django. What about "djangostrano.py new-evolution evolution_name"? And "djangostrano.py db-evolve"? 4) For the newbies: Learn python, django, then ruby and capistrano? Manually alter databases when schema evolves? Ugh... Learn python, django, and publish. Draft database modifications using python, and store them to make the database evolve. Sounds better IMHO :) 5) I prefer to write my recipes in python instead of adding another language to the mix. I already have to mangle python with all the frontend scripting and markup stuff. I'd love to keep it simpler. 6) I don't mind "reinventing the wheel" if it has any benefits, and the above are enough for me, though that's only a rough draft of what I've been working on. More to come. By the way. I don't try to tell anyone that "my tool's superior to tool X". I'm just letting the community know. Anyone to join my efforts? Gorgeous. Not? I'd love this kind of tool anyways. I'd be doing it alone, if that's the only way. signature.asc Description: Esta parte del mensaje está firmada digitalmente
Re: Django Video - For a good laugh
*lmaorof* El lun, 10-09-2007 a las 16:20 +, Gregg Pollack escribi�: > Django guys, > > I know a few of you must be familiar with the Ruby on Rails vs > ___ commercials http://www.railsenvy.com/tags/Commercials > > We just posted a "Ruby on Rails vs Django" video here: > > http://www.railsenvy.com/2007/9/10/ruby-on-rails-vs-django-commercial-7 > > Disclaimer: If you think we're trying to be inflammatory in any > way.. please read the "Spoiler Alert" section under the video on the > page. > > Keep up the great work guys, > > Gregg Pollack > RailsEnvy.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 -~--~~~~--~~--~--~---
Re: Django deployment à lá Capistrano
> > I think db schema migration should wait until django has some > > feature that supports it, a limited set of scripting (python itself > > of course) should be allowed in the "recipes" I will take note of that. I thought that I'd leave that bit for the end anyways. The bit about the "recipes" is a good idea. Make up a "cooking book" of standard stuff and let people put it together, like "update from svn, update postgresql database from sql file, restart nginx", and leave space for them to plug in custom stuff. Sounds like a good start. El lun, 10-09-2007 a las 20:50 -0300, qwerty escribi�: > "recipes" is capistrano nomenclature, how should be called in this new > project? "jobs", or "tasks" is a good way to go. > > I think that a good way to go is first define a set of servers, each > one with differents services, and define a global service->task > relation. > Then a per-server relation if special jobs are needed in each one, > this way we can make a "task" able to clear memcache, other task > restarting lighttpd, etc in different servers, yaml looks like a good > option for this configuration, or something parseable by ConfigParser > sounds better? > > 2007/9/10, David Reynolds <[EMAIL PROTECTED]>: > > > On 10 Sep 2007, at 4:13 pm, Chris Hoeppner wrote: > > > I see your point. Why reinvent the wheel? True. But I'm not > trying to > > re-do capistrano using python instead of ruby. Capistrano > has been the > > spark that made me think about doing this, but that's all > there is to > > Capistrano. > > > > I'm doing this because: > > > > 1) I've anyways been thinking about this for ages. > > > > 2) I'd love to "djangostrano.py publish" or "djangostrano.py > > update-remote". > > > > 3) What about rails' migrations? It's *the* feature I've > been dreaming > > of for django. What about "djangostrano.py new-evolution > > evolution_name"? And "djangostrano.py db-evolve"? > > > > 4) For the newbies: Learn python, django, then ruby and > capistrano? > > Manually alter databases when schema evolves? Ugh... Learn > python, > > django, and publish. Draft database modifications using > python, and > > store them to make the database evolve. Sounds better > IMHO :) > > > > 5) I prefer to write my recipes in python instead of adding > another > > language to the mix. I already have to mangle python with > all the > > frontend scripting and markup stuff. I'd love to keep it > simpler. > > > > 6) I don't mind "reinventing the wheel" if it has any > benefits, and > > the > > above are enough for me, though that's only a rough draft of > what I've > > been working on. More to come. > > > > By the way. I don't try to tell anyone that "my tool's > superior to > > tool > > X". I'm just letting the community know. Anyone to join my > efforts? > > Gorgeous. Not? I'd love this kind of tool anyways. I'd be > doing it > > alone, if that's the only way. > > Fair enough, good luck to you. I look forward to seeing the > results ;) > > Cheers, > > Dave > > -- > David Reynolds > [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 -~--~~~~--~~--~--~---
Re: Django deployment à lá Capistrano
I'll be creating a google code page as soon as we settle down on a name. I like Djangostrano. Sounds nice. But I'm not sure about anyone crying out something about "ripping other people's ideas". El mar, 11-09-2007 a las 11:45 +0100, Jon Atkinson escribió: > Are you going to create a wiki and repository for this project any > time soon? It would be a much more effective means of collaboration > than the mailing list. > > --Jon > > On 9/11/07, Chris Hoeppner <[EMAIL PROTECTED]> wrote: > > > > > > > > I think db schema migration should wait until django has some > > > > feature that supports it, a limited set of scripting (python itself > > > > of course) should be allowed in the "recipes" > > > > I will take note of that. I thought that I'd leave that bit for the end > > anyways. > > > > The bit about the "recipes" is a good idea. Make up a "cooking book" of > > standard stuff and let people put it together, like "update from svn, > > update postgresql database from sql file, restart nginx", and leave > > space for them to plug in custom stuff. Sounds like a good start. > > > > > > > > El lun, 10-09-2007 a las 20:50 -0300, qwerty escribi�: > > > > > "recipes" is capistrano nomenclature, how should be called in this new > > > project? "jobs", or "tasks" is a good way to go. > > > > > > I think that a good way to go is first define a set of servers, each > > > one with differents services, and define a global service->task > > > relation. > > > Then a per-server relation if special jobs are needed in each one, > > > this way we can make a "task" able to clear memcache, other task > > > restarting lighttpd, etc in different servers, yaml looks like a good > > > option for this configuration, or something parseable by ConfigParser > > > sounds better? > > > > > > 2007/9/10, David Reynolds <[EMAIL PROTECTED]>: > > > > > > > > > On 10 Sep 2007, at 4:13 pm, Chris Hoeppner wrote: > > > > > > > I see your point. Why reinvent the wheel? True. But I'm not > > > trying to > > > > re-do capistrano using python instead of ruby. Capistrano > > > has been the > > > > spark that made me think about doing this, but that's all > > > there is to > > > > Capistrano. > > > > > > > > I'm doing this because: > > > > > > > > 1) I've anyways been thinking about this for ages. > > > > > > > > 2) I'd love to "djangostrano.py publish" or "djangostrano.py > > > > update-remote". > > > > > > > > 3) What about rails' migrations? It's *the* feature I've > > > been dreaming > > > > of for django. What about "djangostrano.py new-evolution > > > > evolution_name"? And "djangostrano.py db-evolve"? > > > > > > > > 4) For the newbies: Learn python, django, then ruby and > > > capistrano? > > > > Manually alter databases when schema evolves? Ugh... Learn > > > python, > > > > django, and publish. Draft database modifications using > > > python, and > > > > store them to make the database evolve. Sounds better > > > IMHO :) > > > > > > > > 5) I prefer to write my recipes in python instead of adding > > > another > > > > language to the mix. I already have to mangle python with > > > all the > > > > frontend scripting and markup stuff. I'd love to keep it > > > simpler. > > > > > > > > 6) I don't mind "reinventing the wheel" if it has any > > > benefits, and > > > > the > > > > above are enough for me, though that's only a rough draft of > > > what I've > > > > been working on. More to come. > > > > > > > > By the way. I don't try to tell anyone that "my tool's > > > superior to > > > > tool > > > > X". I'm just letting the community know. Anyone to join my > > > efforts? > > > > Gorgeous. Not? I'd love this kind of tool anyways. I'd be > > > doing it > > > > alone, if that's the only way. > > > > > > Fair enough, good luck to you. I look forward to seeing the > > > results ;) > > > > > > Cheers, > > > > > > Dave > > > > > > -- > > > David Reynolds > > > [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 -~--~~~~--~~--~--~---
Re: Django deployment à lá Capistrano
I know, I know. Know what? I'll setup a trac site on a domain of mine. We can always move it somewhere else. El mar, 11-09-2007 a las 14:02 +0100, Jon Atkinson escribió: > I'm not sure the name is really as important as working code. > > --Jon > > On 9/11/07, Chris Hoeppner <[EMAIL PROTECTED]> wrote: > > > > I'll be creating a google code page as soon as we settle down on a name. > > I like Djangostrano. Sounds nice. But I'm not sure about anyone crying > > out something about "ripping other people's ideas". > > > > El mar, 11-09-2007 a las 11:45 +0100, Jon Atkinson escribió: > > > Are you going to create a wiki and repository for this project any > > > time soon? It would be a much more effective means of collaboration > > > than the mailing list. > > > > > > --Jon > > > > > > On 9/11/07, Chris Hoeppner <[EMAIL PROTECTED]> wrote: > > > > > > > > > > > > > > I think db schema migration should wait until django has some > > > > > > feature that supports it, a limited set of scripting (python itself > > > > > > of course) should be allowed in the "recipes" > > > > > > > > I will take note of that. I thought that I'd leave that bit for the end > > > > anyways. > > > > > > > > The bit about the "recipes" is a good idea. Make up a "cooking book" of > > > > standard stuff and let people put it together, like "update from svn, > > > > update postgresql database from sql file, restart nginx", and leave > > > > space for them to plug in custom stuff. Sounds like a good start. > > > > > > > > > > > > > > > > El lun, 10-09-2007 a las 20:50 -0300, qwerty escribi�: > > > > > > > > > "recipes" is capistrano nomenclature, how should be called in this new > > > > > project? "jobs", or "tasks" is a good way to go. > > > > > > > > > > I think that a good way to go is first define a set of servers, each > > > > > one with differents services, and define a global service->task > > > > > relation. > > > > > Then a per-server relation if special jobs are needed in each one, > > > > > this way we can make a "task" able to clear memcache, other task > > > > > restarting lighttpd, etc in different servers, yaml looks like a good > > > > > option for this configuration, or something parseable by ConfigParser > > > > > sounds better? > > > > > > > > > > 2007/9/10, David Reynolds <[EMAIL PROTECTED]>: > > > > > > > > > > > > > > > On 10 Sep 2007, at 4:13 pm, Chris Hoeppner wrote: > > > > > > > > > > > I see your point. Why reinvent the wheel? True. But I'm not > > > > > trying to > > > > > > re-do capistrano using python instead of ruby. Capistrano > > > > > has been the > > > > > > spark that made me think about doing this, but that's all > > > > > there is to > > > > > > Capistrano. > > > > > > > > > > > > I'm doing this because: > > > > > > > > > > > > 1) I've anyways been thinking about this for ages. > > > > > > > > > > > > 2) I'd love to "djangostrano.py publish" or "djangostrano.py > > > > > > update-remote". > > > > > > > > > > > > 3) What about rails' migrations? It's *the* feature I've > > > > > been dreaming > > > > > > of for django. What about "djangostrano.py new-evolution > > > > > > evolution_name"? And "djangostrano.py db-evolve"? > > > > > > > > > > > > 4) For the newbies: Learn python, django, then ruby and > > > > > capistrano? > > > > > > Manually alter databases when schema evolves? Ugh... Learn > > > > > python, > > > > > > django, and publish. Draft database modifications using > > > > > python, and > > > > > > store them to make the database evolve. Sounds better > > >
Re: Django deployment à lá Capistrano
El mar, 11-09-2007 a las 12:26 -0700, Jonas escribió: > Before that someone starts working about this, you must consider this: > > 1. It's already has been created a project with that intention. Its > name is capystrano [1] and althought has been not uploaded code -he > could be working offline-, it would be best contact with its author to > doesn't duplicate work. > > 2. If you think that capistrano -the original tool built with Ruby- is > very complex, has been built a similar tool but more simple. It has > been built too with Ruby in *only 4 days* and its name is Vlad the > Deployer [2] [3]. > > 3. Has been created Webistrano [4], a Web UI for managing Capistrano > deployments, and after to see the screencasts I would ask myself if > the effort is worth the trouble to implement a tool thus when it would > be possible to customize capistrano to deploy Django and then to use > Webistrano. > > > [1] http://code.google.com/p/capystrano/ > [2] http://www.infoq.com/news/2007/08/vlad-the-deployer > [3] http://rubyhitsquad.com/Vlad_the_Deployer.html > [4] http://blog.innerewut.de/webistrano/ I appreciate the time you have taken to gather that information, Jonas. You must know, that I do not intend to "clone" capistrano, thus capystrano (beside knowing nothing about it's owner or how to contact him) is not my path. I do *not* think capistrano is overly complex. I believe it can be improved by our love for python. As for webistrano, I have planned a module that integrates with the admin interface. I think this has been misunderstood. I do not try to make "capistrano for django", as capystrano does. It's tagline says just that. While the approach is similar to capistrano, the path is very different. One of the key pieces will be schema evolution. The other piece will be the task book. Think of a cooking book of recipes for capistrano (or better, don't. It's a very simplistic idea of the application.). As for Vlad, this may be offending, but for "simple", I use a set of bash scripts. You've already seen a bit of them, Jonas. You should know. I know it's possible to use Capistrano with Django. However, I happen to severely dislike Ruby, and thus, I'd like to avoid using it. I use Django for that sole reason. Why stick with Capistrano? Someone has to make the first move. Again, thank you for pointing me to that resources, Jonas. I really appreciate the time you have taken. --~--~-~--~~~---~--~~ 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: Site level data models
I always have an app called "core" for that kind of stuff, like non-app related views, forms, middleware, models... etc. El vie, 14-09-2007 a las 03:09 -0700, Stewart escribi�: > Hi > > I'm considering writing an web application in Django but I'm a little > confused about the Site-App model. > > Say, for instance, I am writing a site that has both a blog and a > forum application. Each application has its own data models, but there > is also some data that is common between both. Is it possible to have > a site level models.py, is there a way for one application to > reference another's models, or do both forum and blog have to be part > of the same application in order to share data? > > Thanks, > Stewart. > > > > --~--~-~--~~~---~--~~ 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: reassessing our Operating System
Linux is linux after all. The kernel remains largely the same, unless you get a patchy distro. The choice is all about your knowledge. If you know your way around in linux, it doesn't really matters. If you're a bit *newer*, you might want to go with a distro with strong repos and a good package manager. I wouldn't even consider using Windows as a server OS. Sorry for the flames. El mar, 18-09-2007 a las 08:02 -0500, Tim Chase escribi�: > > Any special reasons debian based installs are better than > > fedora based ones? > > I can't say there should be any sort of major difference once > meta-package programs were instituted for dependency tracking. > My understanding is that Yum may do this sort of thing. > > I tried Red Hat early in the game and grew frustrated with the > "yes, RPMs install easily, but you have to track down each > dependency individually and install it first" nature of it. > However, that was 5-10 years ago (around RH v5 through v8)...I've > just never tried an RPM-based distro since then. If I wanted > dependency-tracking headaches, I'd build everything from source :) > > As long as you can tell your distro "install these things I care > about and install any requisite dependencies you might need to in > order to get there", it doesn't really matter. > > -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: How to implement funky caching
That's more or less how flatpages work. Have a look at their middleware. El s�b, 22-09-2007 a las 05:40 -0700, julian.bash escribi�: > Hi! > > Does anyone have an idea how to implement funky caching with django? > For those who don't know what that is (it's similar to how movabletype > does caching but doesn't prepache everything): > > "you redirect 404 errors to a script, which looks at the requested > URL, decides whether it should actually exist, and if it should it > builds the file from the database, saves it to the filesystem, and > then returns the page to whoever requested it. Next time that URL is > requested, the static file will be served." (via > http://weblog.philringnalda.com/2002/11/14/half-baked-and-a-little-fried) > > So, does anyone have an idea how to do this? If there is no way of > doing this I will choose Rails for my new site. > > Julian > > > > --~--~-~--~~~---~--~~ 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 to implement funky caching
If it is Django/Rails who is doing the thing, the server *has* to run it. So it's nonsense speaking about mephisto doing that. The deal would be in apache taking care of it. El s�b, 22-09-2007 a las 17:26 +, julian.bash escribi�: > Thanks a lot for your answers! > > The even greater thing with funky caching is that the webserver only > has to serve html (if there is a cached version) and doesn't have to > run django. So, django's normal caching is good, but when the server > only has to serve already-generated html-files, the whole thing would > be even faster. If you know the Rails-blog Mephisto, it does exactly > this. > > Julian > > On 22 Sep., 15:10, Tim Chase <[EMAIL PROTECTED]> wrote: > > > "you redirect 404 errors to a script, which looks at the requested > > > URL, decides whether it should actually exist, and if it should it > > > builds the file from the database, saves it to the filesystem, and > > > then returns the page to whoever requested it. Next time that URL is > > > requested, the static file will be served." (via > > >http://weblog.philringnalda.com/2002/11/14/half-baked-and-a-little-fried) > > > > There are two descriptions of what you might want to do. One is > > standard caching (nothing funky about it): yes, Django has a > > caching middleware available that can use a smattering of popular > > cache backends (memcached being a popular choice). > > > > http://djangoproject.com/documentation/cache/ > > > > The other interpretation involves not so much caching-related > > concepts as it is "try and guess what the user really meant and > > appease them". Sometimes this is a nice thing, and sometimes > > this lassos you to an albatross of allowing bogus URLs to persist. > > > > Fortunately, out of the box, Django can accommodate both, though > > the latter takes a little more understanding of the problem-domain. > > > > If the second is what you mean, at a couple ideas come to mind > > depending on what sort of behavior you want. There are two main > > types of exceptions of interest: those that map to a view but > > the view intentionally raises a 404, and those that can't be > > mapped to a view at all, and thus default to a 404. > > > > 1) make your final entry in your urls.py a catch-all that points > > to a view that does what you describe. This is easy, but only > > catches unexpected URL schemes. I'm not sure this is quite what > > you want though. > > > > 2) in concert with #1, your views know when they will 404, so > > you can just write a custom view that tries to do something > > intelligent in a 404 condition. > > > > 3) use a custom middleware to intercept the response/exception > > from a view, and do your jiggering in there. > > > > Just a few early-morning mid-breakfast thoughts. > > > > -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 -~--~~~~--~~--~--~---
The setlang view
Hi there! As I see, there has been a little change to the setlang view: It only accepts POST requests. This wasn't the case when I last did a localized site. Now, either my html knowledge needs an update, or this makes it impossible to make a simple "menu" showing flags for each language, without using a form for each. Seems pretty silly to me. I know that any request "having some kind of impact on future requests" should be done via POST, but this is still pretty silly. I wonder what others have been doing? I might as well copy & hack the setlang function and make it accept GET requests, but that's not something I want to make a habit. --~--~-~--~~~---~--~~ 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: Two newform best practice questions
> 1) What is best practice to populate a custom form with instance data? Use form = Form(data_dict) and you're done. This also triggers validation, so it might not be exactly what you want. Though, it's the only way I know of. > 2) What is the recommended way to create a single custom form that > allows two models (related by a foreign key) to be editted/added to? Use form_for_model or form_for_instance using the fields argument. Make one form object for each model with the field subset you'd like to use. There's nothing stopping you from using several form objects in the same html form. Just remember to validate them 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: View didn't return an HttpResponse object?
return render_to_response (...) El mar, 25-09-2007 a las 10:14 +, Ryan K escribi�: > > from django.http import HttpResponse, Http404 > from django.template import RequestContext > from django.shortcuts import render_to_response > > def verify_sl(request): > if request.method == 'GET': > if not request.GET.get('avatarkey',''): > raise Http404 > elif len(request.GET['avatarkey']) != 36: > raise Http404 > else: > render_to_response('signup_s2.html', > {},RequestContext(request)) > else: > raise Http404 > > Why does this code not work? > > > > --~--~-~--~~~---~--~~ 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: Plz, I am just new to Python...
El jue, 04-10-2007 a las 15:09 +, Emperor of thought escribió: > Please i am just new to python and i will like to know how i can go > about in web development. I am migrating from PHP and phyton web > environment does not look very familiar. > I tried downloading Django and installing it on my windows looks very > difficult. Plsease can anyone help me on how to install Django and how > to go about starting web development in Phyton? First of all, I'd like to point out that windows is IMHO not a nice development environment. Anyway, if you'd like to do it, you might have a look at the e text editor [1], which is good for newbies and advanced folks. As for the system, you'll need at least a database. SQLite is pretty straight forward, but is a bit limited. I have never done a postgre setup on windows, so what I can tell you about is mysql[2], which even has a nice configuration GUI, and a neat administration interface [3]. I don't feel really urged to give detailed installation guides for any of them, since there is plenty of the kind on the net. Just ask Google (tm) ;) If you're serious about programming, you might want to migrate over to linux (keep your flamethrowers, sons of M$!!), or finally make the step for a mac. You'll never look back, believe me. I hope all of this didn't sound too vague. ~Chris --~--~-~--~~~---~--~~ 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: installation necessary?
It doesn't really matter where it is, as long as it's on the pythonpath (eg. "import django" works). Putting it in site-packages is just a bit cleaner, as that is a standard place for common-use python packages. You still need to be able to set the pythonpath for your execution environment, though. This means PythonPath for mod_python and PYTHONPATH for anything shell based. If you can, put it in site-packages (even if it's just a symlink). It's already on the path, and will Just-Work(tm). ~Chris El s�b, 06-10-2007 a las 09:47 +0200, horace escribi�: > hello, > > wouldn't it simply be possible to put all the py files of django into > a directory and use "import" in your project instead of installing > anything? django looks really nice but most webhosters don't allow to > install it. :) > > > --~--~-~--~~~---~--~~ 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 template language
Since the formatting is quite standard (eg: you'll be using img tags for images and object tags for pdf's, etc...) you could assign it to a var in the view. This might be a violation of the MVC pattern, but it's not much worse than using the same template instead of separate ones, extending a common base. ~ Chris El s�b, 06-10-2007 a las 12:03 +0200, Bernd escribi�: > Hello, > > I'm new to web development and Python. I helped a friend with his > website, which is written in PHP. But the source code is so bad, that > I > decided to rewrite the hole page. So I found the djange webframework.I > like it and try to rewrite the page with it. > > Now I have a litte question. I try to write a template, which get a > filename and the mimetype as parameter. It looks like this > > {% ifequal mime 'image/jpeg'%} > > {% endifequal %} > > {% ifequal mime 'application/pdf' %} > height='600'> > > {% endifequal %} > > But now I want to compare 'image/gif'. A gif works like a jpeg. But I > didn't find a solution to write > > {% ifequal mime 'image/jpeg' or 'image/gif'%} > or > {% if mime in ['image/jpeg', 'image/gif] '%} > > Is there any chance to compare multiple values? Or are there better > solution for my problem? > > Regards, > > Bernd > > --~--~-~--~~~---~--~~ 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 Media on a VServer
What's a VServer? Are you speaking about virtualization? In that case, it doesn't make a difference. As for it working on windows and macos, and not on linux, you might want to give us a few more details about the setup. El s�b, 06-10-2007 a las 10:13 -0700, niklas.voss escribi�: > I have a VServer with Django installed and it works very well, on my > home Server on MacOS and Windows the Admin Panel worked very well, > too, with some fixes, but on the Debian VServer with Apache2, it don't > works anymore. > > Is there a way to fix this? Or can i just copy the Admin Media from / > root/trunk/django/contrib/admin/media to the path which is set up as > my Media_Root? Or in someway like this? > > I hope you can help me, thank you, > Niklas Voss > > > > --~--~-~--~~~---~--~~ 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-multilingual
Hi there! I wonder if someone has been using django-multilingual. I'd like to "push it into" a live database, and am wondering what kind of alterations to the schema this might involve. Would it be easier to just add _lang columns for all the fields I'd like to translate, and conditionally outputting based on the LANGUAGE context var? It seems cleaner and more flexible the way django-multilingual goes, but the alterations are frightening me a bit. ~Chris --~--~-~--~~~---~--~~ 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: Plz, I am just new to Python...
you'd also need a python interpreter, but since you talked about site-packages, I guess that's done already ;) You might also want to setup a database. El mi�, 10-10-2007 a las 00:43 -0700, lispingng escribi�: > actually django templates look more like php smarty templates. > i also am from php and am new to django. > i don't think installing django on windows is such a big deal. > i just unzipped the tar and copied it to the python25\lib\site-packages > \ folder > and that was it (i think) > > On Oct 4, 9:52 pm, John <[EMAIL PROTECTED]> wrote: > > On Oct 4, 11:09 am, Emperor of thought <[EMAIL PROTECTED]> > > wrote: > > > > > Please i am just new to python and i will like to know how i can go > > > about in web development. I am migrating from PHP and phyton web > > > environment does not look very familiar. > > > > Python has a number of frameworks and libraries for web > > development.Djangois but one of your choices. I think it's a good choice. > > > > Note thatDjangois a framework. So, that means instead of writing a > > file for each web page, you'll be writing: > > > > * a file for your models (classes), > > * a file for your views (functions), > > * a file mapping urls to view functions (a list), and > > * somefilesfor your templates (html with some extra bits thrown in). > > The templatefileslook like phpfiles, but with {% ... %} blocks in > > them instead of blocks. > > > > Then the framework takes care of having the right view get called > > (which then grabs one of the templates) and returns the page to the > > user that requested it. > > > > > I trieddownloadingDjangoand installing it on my windows looks very > > > difficult. Plsease can anyone help me on how to installDjangoand how > > > to go about starting web development in Phyton? > > > > I'm not sure of the details for doing it on MS Windows. GNU/Linux is a > > good environment for development of all sorts. I recommend upgrading > > to Ubuntu. > > > > ---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: Users vs Sites
You'd need row-level permission for that, and that's outside of the admin's intended philosophy. Though, there's such a branch being developed, and I can recall seeing somewhere a django app for that purpose. Just google it and it should pop up. Also, since row-level permission is not built into the admin in any way, you'd find yourself doing custom admin views, which is neither bad nor hard, but you might feel overwhelmed by the task, since it's a bit hard to grasp at first. ~Chris El mi�, 10-10-2007 a las 07:51 -0700, MarcoX escribi�: > Hi to all, > I have a problem on the configuration of the users in django. > In my plan I have 4 sites. I would want that in the admin view I can > specify for some users the possibility of being able to make > determined actions for determined sites. > For example, the user X can write the object Y only for the site Z. > > Thank you > > > > --~--~-~--~~~---~--~~ 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: Users vs Sites
There *can* be other solutions, but most would be cumbersome and ugly, like adding a "group" column to each table (the simple way), or using a polymorphic relationship (the cleaner, leaner, and harder way). You'll find yourself coding an authorization system on top of django's. And when it's done, there is the thing I'd call "let the admin know about it". What kind of system are you pretending to build? Maybe a few more details could get me on the right track. ~ Chris El mi�, 10-10-2007 a las 10:20 -0700, MarcoX escribi�: > thank you, Chris. > > The solution of my problem is therefore very difficult to implement. > The branch of which you speak to me is still in testing. And however > it seems that it cannot resolve my problem completely. > Therefore not are others (simpler) solutions? > > MarcoX > > On 10 Ott, 18:31, Chris Hoeppner <[EMAIL PROTECTED]> wrote: > > You'd need row-level permission for that, and that's outside of the > > admin's intended philosophy. Though, there's such a branch being > > developed, and I can recall seeing somewhere a django app for that > > purpose. Just google it and it should pop up. > > > > Also, since row-level permission is not built into the admin in any way, > > you'd find yourself doing custom admin views, which is neither bad nor > > hard, but you might feel overwhelmed by the task, since it's a bit hard > > to grasp at first. > > > > ~Chris > > > > El mi?, 10-10-2007 a las 07:51 -0700, MarcoX escribi?: > > > > > Hi to all, > > > I have a problem on the configuration of the users in django. > > > In my plan I have 4 sites. I would want that in the admin view I can > > > specify for some users the possibility of being able to make > > > determined actions for determined sites. > > > For example, the user X can write the object Y only for the site Z. > > > > > Thank you > > > > --~--~-~--~~~---~--~~ 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: Python 2.3 deployment
Hi guys! Thanks for those responses. So, the random.randint function does exist: # python Python 2.3.5 (#1, Aug 25 2005, 09:17:44) [GCC 3.4.3 20041212 (Red Hat 3.4.3-9.EL4)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import random >>> random.randint > And here's whar Thomas suggests: AssertionError at / /usr/lib/python2.3/random.pyc El vie, 19-10-2007 a las 15:12 +0200, Thomas Guettler escribi�: > > File > > "/usr/lib/python2.3/site-packages/django/contrib/sessions/models.py", line > > 19, in get_new_session_key session_key = md5.new("%s%s%s%s" % > > (random.randint(0, sys.maxint - 1), os.getpid(), time.time(), > > settings.SECRET_KEY)).hexdigest() > > > > AttributeError: 'module' object has no attribute 'randint' > > You can test what random module you are using: > > insert a line above: assert False, random.__file__ > > You can test the random module: > > python /usr/lib64/python2.4/random.py > 2000 times random > 0.003 sec, avg 0.497669, stddev 0.288045, min 0.00160483, max 0.99949 > 2000 times normalvariate > > > HTH, > Thomas > > > --~--~-~--~~~---~--~~ 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: Python 2.3 deployment
Thanks, Malcolm! For some reason, updating django to trunk solved it. My system admins told me kindly that it's not their problem. Very nice indeed. El vie, 19-10-2007 a las 21:12 +1000, Malcolm Tredinnick escribi�: > On Fri, 2007-10-19 at 11:56 +0100, Chris Hoeppner wrote: > > Hey guys! > > > > I have no choice but deploy to this server, running CentOS 4.4, with no > > option to upgrade python beyond 2.3, and I'm getting this: > > > > Mod_python error: "PythonHandler django.core.handlers.modpython" > > > > Traceback (most recent call last): > > > > File "/usr/lib/python2.3/site-packages/mod_python/apache.py", line 299, > > in HandlerDispatch > > result = object(req) > > > > File > > "/usr/lib/python2.3/site-packages/django/core/handlers/modpython.py", line > > 178, in handler > > return ModPythonHandler()(req) > > > > File > > "/usr/lib/python2.3/site-packages/django/core/handlers/modpython.py", line > > 155, in __call__ > > response = middleware_method(request, response) > > > > File > > "/usr/lib/python2.3/site-packages/django/contrib/sessions/middleware.py", > > line 95, in process_response > > obj = Session.objects.get_new_session_object() > > > > File > > "/usr/lib/python2.3/site-packages/django/contrib/sessions/models.py", line > > 37, in get_new_session_object > > obj, created = > > self.get_or_create(session_key=self.get_new_session_key(), > > > > File > > "/usr/lib/python2.3/site-packages/django/contrib/sessions/models.py", line > > 19, in get_new_session_key > > session_key = md5.new("%s%s%s%s" % (random.randint(0, sys.maxint - 1), > > os.getpid(), time.time(), settings.SECRET_KEY)).hexdigest() > > > > AttributeError: 'module' object has no attribute 'randint' > > Something's a bit broken with your setup, then. Certainly > random.randint() existedin Python 2.3 (I just tested it). > > Do a quick test to confirm that it really is missing in a shell: > > Python 2.3.5 (#1, Mar 11 2007, 08:55:14) > [GCC 4.1.1 20070105 (Red Hat 4.1.1-51)] on linux2 > Type "help", "copyright", "credits" or "license" for more > information. > >>> import random > >>> random.randint > 0x672110>> > > If that fails, your python installation is very non-standard. You could > also try looking at the results of "rpm -qV python" to check that there > hasn't been any inadvertent (or deliberate) changes to the installed > rpm. > > Note sure what to suggest here. The problem looks to be in your > installation. Start asking serious questions of the sys admin. > > 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 -~--~~~~--~~--~--~---
Python 2.3 deployment
Hey guys! I have no choice but deploy to this server, running CentOS 4.4, with no option to upgrade python beyond 2.3, and I'm getting this: Mod_python error: "PythonHandler django.core.handlers.modpython" Traceback (most recent call last): File "/usr/lib/python2.3/site-packages/mod_python/apache.py", line 299, in HandlerDispatch result = object(req) File "/usr/lib/python2.3/site-packages/django/core/handlers/modpython.py", line 178, in handler return ModPythonHandler()(req) File "/usr/lib/python2.3/site-packages/django/core/handlers/modpython.py", line 155, in __call__ response = middleware_method(request, response) File "/usr/lib/python2.3/site-packages/django/contrib/sessions/middleware.py", line 95, in process_response obj = Session.objects.get_new_session_object() File "/usr/lib/python2.3/site-packages/django/contrib/sessions/models.py", line 37, in get_new_session_object obj, created = self.get_or_create(session_key=self.get_new_session_key(), File "/usr/lib/python2.3/site-packages/django/contrib/sessions/models.py", line 19, in get_new_session_key session_key = md5.new("%s%s%s%s" % (random.randint(0, sys.maxint - 1), os.getpid(), time.time(), settings.SECRET_KEY)).hexdigest() AttributeError: 'module' object has no attribute 'randint' --~--~-~--~~~---~--~~ 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: Python 2.3 deployment
Huh I lied. The django update only forced me to call that view with POST, and now that I'm doing, it's throwing the same traceback. I'm not sure what this might be. I'll check again with the system admins. El vie, 19-10-2007 a las 21:12 +1000, Malcolm Tredinnick escribi�: > On Fri, 2007-10-19 at 11:56 +0100, Chris Hoeppner wrote: > > Hey guys! > > > > I have no choice but deploy to this server, running CentOS 4.4, with no > > option to upgrade python beyond 2.3, and I'm getting this: > > > > Mod_python error: "PythonHandler django.core.handlers.modpython" > > > > Traceback (most recent call last): > > > > File "/usr/lib/python2.3/site-packages/mod_python/apache.py", line 299, > > in HandlerDispatch > > result = object(req) > > > > File > > "/usr/lib/python2.3/site-packages/django/core/handlers/modpython.py", line > > 178, in handler > > return ModPythonHandler()(req) > > > > File > > "/usr/lib/python2.3/site-packages/django/core/handlers/modpython.py", line > > 155, in __call__ > > response = middleware_method(request, response) > > > > File > > "/usr/lib/python2.3/site-packages/django/contrib/sessions/middleware.py", > > line 95, in process_response > > obj = Session.objects.get_new_session_object() > > > > File > > "/usr/lib/python2.3/site-packages/django/contrib/sessions/models.py", line > > 37, in get_new_session_object > > obj, created = > > self.get_or_create(session_key=self.get_new_session_key(), > > > > File > > "/usr/lib/python2.3/site-packages/django/contrib/sessions/models.py", line > > 19, in get_new_session_key > > session_key = md5.new("%s%s%s%s" % (random.randint(0, sys.maxint - 1), > > os.getpid(), time.time(), settings.SECRET_KEY)).hexdigest() > > > > AttributeError: 'module' object has no attribute 'randint' > > Something's a bit broken with your setup, then. Certainly > random.randint() existedin Python 2.3 (I just tested it). > > Do a quick test to confirm that it really is missing in a shell: > > Python 2.3.5 (#1, Mar 11 2007, 08:55:14) > [GCC 4.1.1 20070105 (Red Hat 4.1.1-51)] on linux2 > Type "help", "copyright", "credits" or "license" for more > information. > >>> import random > >>> random.randint > 0x672110>> > > If that fails, your python installation is very non-standard. You could > also try looking at the results of "rpm -qV python" to check that there > hasn't been any inadvertent (or deliberate) changes to the installed > rpm. > > Note sure what to suggest here. The problem looks to be in your > installation. Start asking serious questions of the sys admin. > > 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: webhostingbuzz, anyone tried
Is anyone on the MediaTemple Django Container Beta Program? El jue, 08-11-2007 a las 17:59 +, hass escribi�: > I too am on webfaction, it's worth it, and dirt cheap. > > > > --~--~-~--~~~---~--~~ 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: Still unable to log into the admin interface
Yeah, the book makes you comment those, but makes you uncomment them again in the next (or the next) chapter =) On 07/07/2008, at 17:44, Fernando Rodríguez wrote: > > El lun, 07-07-2008 a las 12:30 -0400, Karen Tracey escribió: > > > >> >> [snip] >> >> MIDDLEWARE_CLASSES = [] #( >> #'django.middleware.common.CommonMiddleware', >> #'django.contrib.sessions.middleware.SessionMiddleware', >> #'django.contrib.auth.middleware.AuthenticationMiddleware', >> #'django.middleware.doc.XViewMiddleware', >> #) >> >> This is a problem. Un-comment these, because Admin needs them. >> >> [snip] >> >> >> INSTALLED_APPS = ( >> 'django.contrib.auth', >> 'django.contrib.contenttypes', >> #'django.contrib.sessions', >> #'django.contrib.sites', >> 'django.contrib.admin', >> 'mysite.books', >> >> >> Admin is also going to need django.contrib.sessions. > > > Thanks Karen. I remember commenting out those entries, and I remember > being instructed to do so (in the book, I believe) because they were > "not necessary for the time being" :-P > > > I'll see if I can find the exact page (if it was indeed in the book > and > not on some webpage) and notify the authors. > > Thanks again. :-) > > > > > --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Project Management App
Hey there! I wonder if anyone knows if there's an app resembling ActiveCollab (or Basecamp, for illustration's sake) that I could plug into a django project. If not, would it be a worthy project with an audience? Chris --~--~-~--~~~---~--~~ 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: middleware that works with Ajax
Hey Mr. Baxter, This is new to me. Dojo will be the official js toolkit for django? Above jQuery? How come? ~ Chris El mar, 08-04-2008 a las 18:47 +0100, andy baxter escribió: > Claudio Escudero wrote: > > Hi, > > > > Someone knows there is any middleware that works with Ajax, similar to > > RJS of Ruby on Rails? > > > Do you mean middleware specifically written for django? If so not sure, > but it might be worth looking at dojo (http://www.dojotoolkit.org/). It > is a javascript toolkit which provides an API to make cross platform > programming easier, and also supports ajax and a variety of widgets. I > think it will be the official javascript toolkit of django at some point > as well. > > > --~--~-~--~~~---~--~~ 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: Google App Engine & Django
There's something that I don't really grasp about appengine models. I see the similarities between them and django models, tho Django knows where to look for them, and thus knows how to manage those classes. Appengine has it's own stuff, and at the bottom of the django page it's said that you don't need to run manage.py to setup the models. How does this work then? Am I to write the models (in appengine-slang) and just place them were I used to place django models? It really makes no difference beside the import phrase if you place them elsewhere, assumedly, but perhaps AE is just looking elsewhere or uses some discovery system we should be aware of? I haven't (yet! still browsing) seen any reference to this. Okay, anything built on django models won't work. I don't care. I don't use the admin interface but in the *very* early stages, as scaffolding, and then build my own admin usually. And if AE provides consistent user auth, there I have all I need to get building on AE and scrap hosting headaches from my todo list. I recon, it's early. Beta. Probably oob (out of beta) very soon (tm). Like a couple years. But I'm in to start and get the hang of it. If everything rolls, it's on to get The Standard Django Hoster for ages. And even if it's non-free, if it once-and-forever takes the hassle of setting up some hosting for django out of my life, I'll pay them in gold bars! I will continue traversing the docs and share anything I discover (tho I'm sure not the first one, even from us on the list). And if you happen to get one of those you-gotta-wait accounts, and have the valour to try and get django up and running, please share the joy. ~ Chris El mar, 08-04-2008 a las 05:16 -0700, Marc Garcia escribió: > Well, it seems that you just need to migrate your django models to > appengine models. Anyway, I think that there is an important day for > django. I haven't enought time to check it all, but I think in a close > future we'll be able to run our django 1.0 projects on google > infrastructure. > > For know I think that it's too early to migrate, because probably > isn't a very mature project, and specially because it's working on > django 0.96 (and most django users use trunk or sometimes newforms- > admin, like me). > > Marc > > On Apr 8, 1:31 pm, "Marty Alchin" <[EMAIL PROTECTED]> wrote: > > On Tue, Apr 8, 2008 at 2:28 AM, Ramin Firoozye <[EMAIL PROTECTED]> wrote: > > > Caveat: there's a waiting list for signing up. > > > > Another caveat, according to that same page you linked: > > > > "Since App Engine does not support Django models, leave all DATABASE_* > > settings set to an empty string. The authentication and admin > > middleware and apps should be disabled since they require Django > > models. The functionality these provide is covered by the App Engine > > Users API and Admin Console respectively. Sessions also depend on > > Django models and must be disabled as well." > > > > Without models, the vast majority of Django apps won't run at all. > > > > -Gul > > --~--~-~--~~~---~--~~ 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: app engine db backend project
I've been looking into this too last night. Though I never before looked into a backend and I'm not on qsrf branch, after looking into the trunk's backends, I can tell that they're a tad over my head. It's a shame that this is not documented (though I'm not whining at the devs for not writing it, I recon there are more important things to do than document maybe-unstable low-level components). If I can do anyhing to help, I'm in. ~ Chris El mar, 08-04-2008 a las 15:00 -0700, Greg Taylor escribió: > This would be great, I'd love to see this although I'm not really > experienced enough to help much. > > On Apr 8, 10:21 am, "Peter Baumgartner" <[EMAIL PROTECTED]> wrote: > > Anybody interested in starting an app engine/big table db backend > > project? Should be interesting and might help pave the way for some > > other non-traditional databases like CouchDB or SimpleDB. While I'm > > not a database expert, I'm sure I can chip in. > > > > It seems like most of the basic functionality is already there and > > more advanced queries could be simulated with multiple queries and > > some magic on the backend. > > > > -- > > Pete > > --~--~-~--~~~---~--~~ 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: middleware that works with Ajax
Russ for president! This is actually one of the big reasons to prefer django over and above so many other frameworks. Take rails for example. You *can* use whatever js stuff you fancy, but if you don't use *their* stuff, you're giving up on much of what the framework offers. ~ Chris El jue, 10-04-2008 a las 07:50 +0800, Russell Keith-Magee escribió: > On Thu, Apr 10, 2008 at 6:42 AM, Todd O'Bryan <[EMAIL PROTECTED]> wrote: > > > > On Wed, Apr 9, 2008 at 6:54 AM, Russell Keith-Magee <[EMAIL PROTECTED]> > > wrote: > > > On Wed, Apr 9, 2008 at 1:47 AM, andy baxter > > > > > > > > Do you mean middleware specifically written for django? If so not sure, > > > > but it might be worth looking at dojo (http://www.dojotoolkit.org/). It > > > > is a javascript toolkit which provides an API to make cross platform > > > > programming easier, and also supports ajax and a variety of widgets. I > > > > think it will be the official javascript toolkit of django at some > > point > > > > as well. > > > > > > No, it won't. The Core devs have said on a number of occasions that we > > > aren't in the business of recommending JS toolkits, and I don't think > > > that position will change any time soon. > > > > > Isn't some JS toolkit getting used in newforms-admin? > > Not to the best of my knowledge. There is some javascript, but it has > all been custom written. > > Yours, > Russ Magee %-) > > > --~--~-~--~~~---~--~~ 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 API interface adapter for Google App Engine
Great stuff, man! I'll try to have an in-depth look this weekend and I'll se if I can help with anything. This seems like a nice solution, until someone pokes up a proper backend (stating that I'm not sure if that's possible, bearing in mind that GAE's datastore is not a RDBM). ~ Chris El vie, 11-04-2008 a las 12:02 -0700, Siddhi escribió: > Hi, > > I'm working on an interface adapter for Google App Engine's datastore. > I've just started out and have created a project for it here with some > basic code - http://code.google.com/p/django-gae-helpers/ > > The intro page has an explanation of what I'm trying to do - > http://code.google.com/p/django-gae-helpers/wiki/Intro > > And you can get the current code from the repository - > http://code.google.com/p/django-gae-helpers/source/browse/trunk/gaeadapter.py > > It is released under MIT license. > > So far a few of the methods have been implemented, basically those > that I needed to port one of my projects. I think it would be pretty > cool if we could adapt most of the API like this. Any thoughts? > > -- > Siddharta Govindaraj > http://siddhi.blogspot.com > http://www.silverstripesoftware.com/blog/ > > > --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
I'd like to learn more about Django internals
Hi there, As the subject says, I'd love to learn more about how django works internally. I've been doing python stuff for about a year or more, but still can't seem to get my head around a big part of the black magic. I wonder if there's something I'm missing? ~ Chris --~--~-~--~~~---~--~~ 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: I'd like to learn more about Django internals
Thanks for your kind reply, Malcolm. I think I'll just take the "roll up your sleeves" way and dive in. Try to poke at the code, change things, see what happens (as in, what is affected by the change I've made, discover dependencies and usage of code pieces), and maybe give things like backends (sessions or db, don't care) a try. I've been using django for a while now, and would eventually like to give something back. Maybe trying to give in to the hype and build my way to get django sessions working on GAE would be a nice learning process? I bet something will be published before I can get my head around how a backend works, but it should be a nice personal experience. Aside: While typing this I discovered ticket #7008 [1] [1] http://code.djangoproject.com/ticket/7008 El sáb, 12-04-2008 a las 21:34 +1000, Malcolm Tredinnick escribió: > > On Sat, 2008-04-12 at 11:15 +0100, Chris Hoeppner wrote: > > Hi there, > > > > As the subject says, I'd love to learn more about how django works > > internally. I've been doing python stuff for about a year or more, but > > still can't seem to get my head around a big part of the black magic. I > > wonder if there's something I'm missing? > > If you're asking "is there a silver bullet", then... well... no. > > There are at least a couple of ways to become familiar with a random > bunch of code that you're interested in. One is to start out with a > problem, say, a traceback and work outwards from there. The traceback > will give you a call stack and then you can investigate the code > surrounding that to work out what might be going on. Another approach is > to follow data paths. Track a piece of data as it enters the system all > the way through until it exits. > > In Django, that means tracking a request. So start from one of the > request handlers (django.core.handlers.wsgi, for example) and trace > through what happens to the incoming HTTP request. This will be > decidedly easier if you have a small application that interacts with > Django, because at some point URL resolution will take place, then a > view function will be called, you might access some model stuff > (entering the ORM) and then it's back to the handler for returning the > response. Without an application of some sort being involved, you won't > be able to trace the path from request to view to ORM to template, etc. > > Alternatively, although Django is large codebase, most of the components > are reasonably self-contained. Pretty much all the directories under > django/ represent self-contained pieces (utils/ -- containing things > that are used across Django's internals -- is the real exception there). > So you could pick a directory with an interesting sounding name and > start reading the code. Split up django/db into a couple of pieces: > django/db/models/ and django/db/backends, since they are slightly > different responsibilities. > > Your question is a little general, so if you have some specific area > you're interested in, or if you're trying to work out which piece is > responsible for some piece of functionality, ask a more specific > question. If you're just wanting to learn about the code in general, > though, the only trick is to roll up your sleeves and dive in. Learn > about a little piece at a time and you'll slowly build up knowledge. > > 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: How we can integrate Django app in Google appengine.
I'm not sure wether you're asking how to run django on GAE [1], or how to do that using appengine's webapp framework [2]. [1] http://code.google.com/appengine/articles/django.html [2] http://code.google.com/appengine/docs/gettingstarted/ Bear in mind that AFAIK right now there's no official way to make django components that use the ORM work. Beside that, there's a ticket with a patch for a GAE DS session backend [1], and there are efforts to make the whole thing tie together too [2]. [1] http://code.djangoproject.com/ticket/7008 [2] http://code.google.com/p/google-app-engine-django/ ~ Chris El sáb, 12-04-2008 a las 08:42 -0400, rajiv bammi escribió: > Dear developers, > > Just a basic query, i am still not able to understand that how we can > integrate Django app with Google appengine.. > > Let say we have a simple program in Django which says hello world.. > how using django i can do it in Google Appengine.. > > Thanks & Regards > Rajiv > > > --~--~-~--~~~---~--~~ 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 API interface adapter for Google App Engine
After looking into that for a while, I can't seem to understand what works and what not... ** From the file README within the project's checkout: The helper provides the following functionality: * The ability to use most manage.py commands * A BaseModel class that appears the same as the standard Django Model class. * The ability to serialize and deserialize model instances to JSON, YAML and XML. * Access to Django's test framework with a test datastore and support for fixtures. Right. What does the BaseModel do then? Can I use it, inherit my models from it, and code them the django-way and everything works? Is that the intended way, but not-yet-working? ~ Chris El sáb, 12-04-2008 a las 05:07 -0700, Eric escribió: > Here's a project being developed by Google. Guido is even involved: > http://code.google.com/p/google-app-engine-django/ > > On Apr 12, 5:58 am, Chris Hoeppner <[EMAIL PROTECTED]> wrote: > > Great stuff, man! > > > > I'll try to have an in-depth look this weekend and I'll se if I can help > > with anything. > > > > This seems like a nice solution, until someone pokes up a proper backend > > (stating that I'm not sure if that's possible, bearing in mind that > > GAE's datastore is not a RDBM). > > > > ~ Chris > > > > El vie, 11-04-2008 a las 12:02 -0700, Siddhi escribió: > > > > > Hi, > > > > > I'm working on an interface adapter for Google App Engine's datastore. > > > I've just started out and have created a project for it here with some > > > basic code -http://code.google.com/p/django-gae-helpers/ > > > > > The intro page has an explanation of what I'm trying to do - > > >http://code.google.com/p/django-gae-helpers/wiki/Intro > > > > > And you can get the current code from the repository - > > >http://code.google.com/p/django-gae-helpers/source/browse/trunk/gaead... > > > > > It is released under MIT license. > > > > > So far a few of the methods have been implemented, basically those > > > that I needed to port one of my projects. I think it would be pretty > > > cool if we could adapt most of the API like this. Any thoughts? > > > > > -- > > > Siddharta Govindaraj > > >http://siddhi.blogspot.com > > >http://www.silverstripesoftware.com/blog/ > > --~--~-~--~~~---~--~~ 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: File Upload, form issue
It would really help to know some more about your setup. Eg, are you using a form generator, using newforms "by hand" or are you making it all the "artisan" way, coding the html yourself? Maybe post a bit of your view code and the relevant template / form bits. ~ Chris El mié, 16-04-2008 a las 03:55 -0700, sparky escribió: > Hello all, > > I have a slightly unusual requirement: I want to use a FileField in a > form but with a TextField in the model. (The content being uploaded is > a big bit of flat text, but I want to store it in the database, not as > a file.) > > The problem is that with the code that I have together the > request.FILES parameter is empty, so the form fails validation, any > suggestions as to where I'm going wrong, thanks. > > sparky > > the form: > class SubmissionForm(forms.Form): > title = forms.CharField(max_length=100) > description = forms.CharField(widget=forms.Textarea) > content = forms.FileField(widget=forms.FileInput) > > > the model: > > class Submission(models.Model): > """ > Submission model > """ > creator = models.ForeignKey(User) > created_datetime = models.DateTimeField(auto_now_add=True) > title = models.CharField(max_length=100) > description = models.TextField() > content = models.TextField() > > > The view code: > if request.method == 'POST': > form = SubmissionForm(request.POST, request.FILES) > if form.is_valid(): > s = Submission(creator=request.user, > created_datetime=datetime.datetime.now(), > title=form.cleaned_data['title'], > description=form.cleaned_data['description'], > content=form.cleaned_data['content']) > > > the template: > > > > {{ form.as_p }} > > > > > > --~--~-~--~~~---~--~~ 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: New site - www.iau.org
This is really great! While I wouldn't like to speak in anybody's name, I think I can safely say that the comunity will benefit from this, and I'm really looking forward to the moment you opensource the code. ~ Chris El jue, 17-04-2008 a las 02:30 -0700, [EMAIL PROTECTED] escribió: > Hi Joe, > > On Apr 16, 11:28 am, "Joe Bloggs" <[EMAIL PROTECTED]> wrote: > > A nice clean site, I would be interested to know:- > > Thanks > > > How long it took to develop? > > Approximately 5 man months (including all activities). Of these 5 > months, only 1 1/2 month have been spent building the actual website > as you see it. The rest of the time has mainly been spent on reverse > engineering a complete mess of an old site. There is a fairly complex > member database behind (the organization has 10.000 members that can > have various sorts of affiliations with lots of groups etc.). Before > this member database was in a MS SQL Server, and had no administration > interface, so the secretaries was manually updating relations in the > database, taking the primary key of one row, and manually inserting it > as a foreign key in another row! Also, the integration of the old > member database on the web, once done through a various TYPO3 > extensions that, if documented, were documented and written entirely > in french (a language I hardly speak :). On top of that, the old > database was in many respects seriously over-model, trying to make it > smarter than good was. Additionally, a lot of the data in the database > was in a poorly shape, so there was lots of cleaning to do. > > > Which django components did you use? > > First of all we use newforms-admin branch, since its a lot more > flexible than the old admin. I've found the branch very stable, and > the developers are good at describing backward incompatible changes. > Besides we use the auth system (works fairly well for 10k members), > and a lot of all the core modules. I found that we only seldom used > generic views, as a get_object_or_404 witha render_reponse was much > more flexible and nearly as easy. The new paginator works as a charm. > > On top of that, we use django-mptt to manage hierarchical data. This > is a really neat application, if you need to eg manage a menu > structure. We also use django-cron. The rest is developed by > ourselves, this include: > > menu system + breadcrumb (inspired by the pycon-tech system) > static pages (basically a bit like flatpages but with tinymce editor > and options for timed publishing and more) > press release and image archive adapted from one our other website > (www.spacetelescope.org - soon to be running django) > simple mass mailing > reporting > > Most of it, we will probably be releasing as open source for others to > use, within the next half year. We need to make another site first, > with some of the same components. > > For site wide search we use google search, as it was easier and > faster, and as we are an non-profit organization, we don't have to > show commercials. > > > Any gotchas ( things that were unexpected or non-obvious ) you had on the > > way? > > Django can get you a lot of the way very quickly, and is a lot more > fun to work with that eg other frameworks for eg Java and PHP. That > said, Django cannot do all, and doesn't pretend to either. Especially > once you start modeling more complex relationships you start to see > what Django doesn't do for you. A simple example is many-to-many > relationships with attributes: Say you want to relate any number of > contacts with any number of groups, with the catch, that a the contact > can have a status within the group (e.g. the contact can be a chair of > the group or just a normal member). The ManyToManyField and the admin > can't handle this, so you have to do your own many to many relation, > and own editor. > > Managing hierarchical data in a relational database has always been a > pain. Django-mptt alleviate you from a lot of the pain, however, it > still need a good administration interface (but seems like they are > working on that). > > Cheers, > Lars > > > > > Regards, > > > > Joe > > > > On Tue, Apr 15, 2008 at 11:03 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> > > wrote: > > > > > Hi, > > > > > We just released a new website for the International Astronomical > > > Union today (an organization of 10.000 professional astronomers, most > > > famous for demoting Pluto as a planet - now it's only a "dwarf > > > planet"). You can access website athttp://www.iau.org > > > > > Besides having a nice front-end for visitors, Django allowed us to > > > quickly build an intuitive and appealing interface for the managing > > > vast amount of membership data and relations for IAU. > > > > > Thanks for viewing, > > > Lars Holm Nielsen > > > ESA/Hubble > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email
Re: Feel free to test queryset-refactor branch
I wonder if anyone has tried coming up with some sort of wannabe-backend for the GAE Datastore? ~ Chris El dom, 13-04-2008 a las 21:23 +1000, Malcolm Tredinnick escribió: > We're getting pretty close to merging queryset-refactor into trunk and > would like to do this as soon as practical. There are still a couple of > enhancements to add (#5420, mostly), one bug to fix (#5937) and some > internal tweaking to do, but all the main stuff is ready to be used. > > So if anybody wants to test it out, go ahead. Read the wiki page[1] if > you've got code that does any slightly unusual stuff, but for existing > code that works on trunk, there shouldn't be any real changes required. > > [1] http://code.djangoproject.com/wiki/QuerysetRefactorBranch > > File any bug reports in Trac against the queryset-refactor > "version" (please do NOT put the qs-rf keyword on the ticket; I'm using > that for other purposes). Bug reports that are regressions from existing > functionality are more interesting and important at the moment than > feature enhancements to the new features, since the latter case can be > dealt with at our leisure (they're not features that people are already > relying upon). > > If you see any different results testing against the branch compared to > trunk, it would be interesting to know about them. Reduce it to a small > example before opening a ticket, wherever possible. Please don't make me > wade through dozens of lines of code just to get to one query that is > relevant. Bear in mind, though, that the difference could be because a > bug existed in trunk and the branch is now giving the correct result. So > make sure your test case is valid (even I got bitten by that in a > project I wrote). > > 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: how do designers create content
El dom, 20-04-2008 a las 12:13 +0530, Kenneth Gonsalves escribió: > > On 20-Apr-08, at 12:03 PM, lee wrote: > > > Do the designers use text base editting like ultraedit or > > or graphics based software like dreamweaver? Most of the artist I know > > don't do much coding and are into photoshop, illustrator and > > dreamweaver. On sites like lawrence.com where there are lots of > > content developers do they create pages in web forms, or editors or > > graphic packages? > > django graphic designers design just like regular graphic designers > Sorry to double post about this. Just to note: Content is edited, not designed. It's presentation is designed. --~--~-~--~~~---~--~~ 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 about Django.db
When you retrieve a row (aka, a model instance), it will be an object with attrs a, a1, aN. I'm not sure I got your point, though. ~ Chris El lun, 21-04-2008 a las 01:11 +0800, 小龙 escribió: > Just as in table Test: > name url sizetime > a a1 a2 a3 > b b1 b2 b3 > > When i get "a" ,how i can get other attrs about a1,a2,a3 while > querying? > > Thanks a lot :D > -- > deSign thE fuTure > http://www.freeis.cn/ > > --~--~-~--~~~---~--~~ 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 do designers create content
El dom, 20-04-2008 a las 12:13 +0530, Kenneth Gonsalves escribió: > > On 20-Apr-08, at 12:03 PM, lee wrote: > > > Do the designers use text base editting like ultraedit or > > or graphics based software like dreamweaver? Most of the artist I know > > don't do much coding and are into photoshop, illustrator and > > dreamweaver. On sites like lawrence.com where there are lots of > > content developers do they create pages in web forms, or editors or > > graphic packages? > > django graphic designers design just like regular graphic designers > There's nothing special about django content design. I think there's a difference between a Graphic Designer and a Web Designer, the former being 100% graphic oriented, like market design, and the last being a tad more code oriented. A web designer will know his way through photoshop, html and css, and maybe even some javascript. Most of them will have basic notions of how backend stuff works, even if they alone won't be able to bust up a system of sorts. Long story short, if your web designer says no-no to code, he's not a web designer. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Deploying Django
Hi guys! I was just wondering myself what the masses are using these days to deploy Django. Are we still using the adviced approach of using mod_python, of have some moved to something like wsgi, scgi, and.. err.. *cgi? I've deployed with mod_python, virtualhosted mod_python with various apps under single instance, wsgi (pretty much a maintenance nightmare, thanks to my stupidity), and I've even tried out cherokee's scgi with nginx as frontend webserver. I just can't decide to use one over another, perhaps because I don't maintain any large sites and can't tell how good or bad these approaches work. Well, just to know. What are you using? This should also be useful for my "little" project, the django deployer, still unnamed. -- Chris Hoeppner <[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 -~--~~~~--~~--~--~---
Re: Deploying Django
El jue, 15-11-2007 a las 12:42 -0800, RajeshD escribió: > > Well, just to know. What are you using? This should also be useful for > > my "little" project, the django deployer, still unnamed. > > I've been using Lighttpd + FCGI on Joyent containers (my favorite > production deployment enviroment). > > In my setups, the Lighty/FCGI combo seems to use server memory more > effectively than Apache/mod_python (in my tests. YMMV) I've been hearing a lot about the lighty+fcgi combo lately. I'll bear that in mind. Thanks, RajeshD. -- Chris Hoeppner <[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 -~--~~~~--~~--~--~---
ImageField file naming
Hi there! I've seen this in patches and stuff before, but most don't work anymore. Perhaps some Django-insider could advice me how to make Django rename uploaded files according to some schema when saving them to disk? Preserving the original filename is ok for most cases, but sometimes it just doesn't make sense. It would be nice to be able to include this in the upload_to parameter. Something like 'upload/%(model_name)s/%(instance_id)s.%(mimetype_extension)s' perhaps? Maybe, if the parameter ends with a slash, the handler could know "ok. this is a directory. let's keep the original filename". Just brainstorming, anyways. I don't know enough about Django internals to come up with a patch like this. ~ Chris --~--~-~--~~~---~--~~ 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 Web Hosting Service
I'm enrolled in the Media Temple Django Container Beta Testing programm, and so far, it's an absolute killer. They've been working close with the Django guys to make it somewhat the "official" django hoster. The django site itself is hosted on a media temple server. Though they're still in Beta, and not publicly available, you could try to ask them if you could get a container to try it. You'll need a grid server account, though. Good Luck. ~ Chris El mi�, 21-11-2007 a las 05:57 -0800, cwurld escribi�: > http://www.webfaction.com/ > > They are amazing and reasonably priced. Their support is great. They > have exceeded my expectations many times. > > Chuck > > On Nov 21, 7:40 am, "Ronaldo Z. Afonso" <[EMAIL PROTECTED]> > wrote: > > Hi all, > > > > Can anybody recommend me a Django Web Hosting Service? > > Thanks. > > > > Ronaldo. > > --~--~-~--~~~---~--~~ 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 Web Hosting Service
Yeah, Slicehost have a nice name in the industry, though you gotta order with some time in advance. Don't rely on them for "I need a server for yesterday" situations ;) ~ Chris El jue, 22-11-2007 a las 04:37 -0800, [EMAIL PROTECTED] escribi�: > > > Can anybody recommend me a Django Web Hosting Service? > > I recommend buying a VPS, and one of the very best VPS services is > slicehost.com which i really recommend! > If VPS is to expensive for you then WebFaction is the solution you > should go with. > > > --~--~-~--~~~---~--~~ 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: ImageField file naming
El mar, 20-11-2007 a las 15:41 -0500, Marty Alchin escribió: > On Nov 20, 2007 3:33 PM, Chris Hoeppner <[EMAIL PROTECTED]> wrote: > > It would be nice to be able to include this in the upload_to parameter. > > Something like > > 'upload/%(model_name)s/%(instance_id)s.%(mimetype_extension)s' perhaps? > > Maybe, if the parameter ends with a slash, the handler could know "ok. > > this is a directory. let's keep the original filename". > > As usual, I'll respond to this as I've been doing a good bit of work > in this area lately. There's no "official" way to do this yet, but > there are ways to get the job done. Take a look at the links below for > more information on some techniques. > > I'm doing a good bit of work on making Django handle renaming a bit > better, and I'm hoping it will land during the next sprint on December > 1. There's no guarantee of that, of course, but that's my personal > goal. That will be documented thoroughly when it lands, and I'll make > an announcement here on django-users whenever that is, sprint or not. > > -Gul Not as if this is a "basic" feature, but I think Django *should* or *might* have builtin support for this kind of things. Not being able to use instance information is quite limiting, somehow... But as The Guys say, Python nor Django are to have everyones pet feature. That's called PHP. --~--~-~--~~~---~--~~ 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 to make such query with django ORM?
Actually, the QuerySet objects are lazy. This is, there's no such query until you access the data. Or so do I believe. El jue, 29-11-2007 a las 01:23 -0800, SmileyChris escribi�: > On Nov 28, 9:08 am, Eratothene <[EMAIL PROTECTED]> wrote: > > I need to get all blogs that belong to certain user and are empty (do > > not have any articles). I can't figure out how to make it with without > > extra() method. > > Since you can't do aggregate methods in the ORM yet, you'll just have > to use extra and do a sub-select to count the articles linked to each. > > --~--~-~--~~~---~--~~ 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: ImageField file naming
I guess you don't have a hint for me to get this working? It seems like everyone's having that rename issue where _get_pk returns none. I'm just blind-guessing, but perhaps the way to go might be "moving" the file on post_save onto another name, since pre_save doesn't provide a pk value? I don't know the Django internals good enough to solve this myself, though I need to get this done ASAP. In a previous project I "solved" this with some really ugly workarounds, that my client has to take care of constantly, and I wouldn't like to do the same this time. Of course, the best solution would be including this functionality in the django core, since everything else is bound to get obsolete sooner or later, and most people wouldn't bother updating this to keep it up with the trunk. I've gone trough the links below, and got some of it working, but the pk thing doesn't work on any of them. Any help, please? ~ Chris El mar, 20-11-2007 a las 15:41 -0500, Marty Alchin escribi�: > On Nov 20, 2007 3:33 PM, Chris Hoeppner <[EMAIL PROTECTED]> wrote: > > It would be nice to be able to include this in the upload_to parameter. > > Something like > > 'upload/%(model_name)s/%(instance_id)s.%(mimetype_extension)s' perhaps? > > Maybe, if the parameter ends with a slash, the handler could know "ok. > > this is a directory. let's keep the original filename". > > As usual, I'll respond to this as I've been doing a good bit of work > in this area lately. There's no "official" way to do this yet, but > there are ways to get the job done. Take a look at the links below for > more information on some techniques. > > I'm doing a good bit of work on making Django handle renaming a bit > better, and I'm hoping it will land during the next sprint on December > 1. There's no guarantee of that, of course, but that's my personal > goal. That will be documented thoroughly when it lands, and I'll make > an announcement here on django-users whenever that is, sprint or not. > > -Gul > > http://scottbarnham.com/blog/2007/07/31/uploading-images-to-a-dynamic-path-with-django/ > http://code.djangoproject.com/wiki/CustomUploadAndFilters > http://gulopine.gamemusic.org/2007/11/customizing-filenames-without-patching.html > > > --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Segmentation Fault on Syncdb
Hi there, I'm getting a segmentation fault on syncdb. No further output. On a pretty much vanilla ubuntu feisty box on grokthis. Output is as follows: # ./manage.py syncdb Segmentation fault # I wonder if this is somewhat a known issue or am I the one missing something? Never got this before. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Automatic Module Discovery (More to python than to django)
Hey there! This has really nothing to do at all with django, beside the fact that many of it's developers should be able to answer from the top of their head. I couldn't think right now of any nice python community, and signing up somewhere else just to fire a single question and probably never ever return didn't seem like something I'd do on a sunday evening. For an app I'm writing, I'd love to know if it is at all possible to do the following workflow: * Given a list of paths, à la PYTHONPATH, go through those paths and it's subpaths and "discover" (aka, import) all python modules found * Loop through all of those modules searching for classes that are subclasses of a certain class, and add their objects to a list, or: * make the modules "execute" (I can't recall if this really happens upon import anyways, sorry), so that I could just use a decorator to do the add-to-a-list thing I'm a tad lost on this subject, and I'd really appreciate any pointers you could give me. ~ Chris --~--~-~--~~~---~--~~ 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: Automatic Module Discovery (More to python than to django)
Hey, pkg_resources throws an ImportError (I'm googling it up as I type), and as for eggs, I really never got my head around them, useful as they might seem. I might probably just go down the easy way and have the things I want to import on the pythonpath (maybe even add the paths "dynamically" on the fly) and using a filename pattern to set the ones appart I want to use. ~ Chris El dom, 23-03-2008 a las 22:27 +0100, Christian Vest Hansen escribió: > There's the pkg_resources module and .eggs. That might be what you're > looking for. > > Try typing this in a python repl: > > >>> import pkg_resources > >>> help(pkg_resources) > > > > On 3/23/08, Chris Hoeppner <[EMAIL PROTECTED]> wrote: > > > > Hey there! > > > > This has really nothing to do at all with django, beside the fact that > > many of it's developers should be able to answer from the top of their > > head. I couldn't think right now of any nice python community, and > > signing up somewhere else just to fire a single question and probably > > never ever return didn't seem like something I'd do on a sunday > > evening. > > > > For an app I'm writing, I'd love to know if it is at all possible to > > do the following workflow: > > > > * Given a list of paths, à la PYTHONPATH, go through those paths and > > it's subpaths and "discover" (aka, import) all python modules found > > * Loop through all of those modules searching for classes that are > > subclasses of a certain class, and add their objects to a list, or: > > * make the modules "execute" (I can't recall if this really happens > > upon import anyways, sorry), so that I could just use a decorator to > > do the add-to-a-list thing > > > > I'm a tad lost on this subject, and I'd really appreciate any pointers > > you could give me. > > > > ~ Chris > > > > > > > --~--~-~--~~~---~--~~ 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: Automatic Module Discovery (More to python than to django)
Just thinking about this... Is there really no way to import something not being on the pythonpath? Maybe importing the file's contents as string and stuff it through some parser function (just ranting here, don't even know if there is such a thing)? What I want is make a few files execute in a certain order, and if I can do that without messing too much with sys.path, even better. Some of these files might even have the same name, so `import module` might not give me all the files I want either. Maybe the following workflow would make it possible, even though it feels *really* hacky: pathbk = sys.path paths = ['/path/1/file1.py', '/path/2/file2.py'] for p in paths: sys.path = [os.path.dirname(p)] f = os.path.join(sys.path[0], '__init__.py') file(, 'w') import os.path.splitext(os.path.basename(p))[0] os.unlink(f) sys.path = pathbk Basically, I'm clearing the pythonpath for each iteration through the files I'm wanting to import, make the pythonpath be solely the folder containing the file, create a __init__.py inside it, and import the module. Feels hacky, yeah. I hope there's some other way to acomplish this. I've been reading up about setuptools. It's something my head just doesn't want to absorb! I'll keep trying it though. Any tips on this? ~ Chris El dom, 23-03-2008 a las 22:27 +0100, Christian Vest Hansen escribió: > There's the pkg_resources module and .eggs. That might be what you're > looking for. > > Try typing this in a python repl: > > >>> import pkg_resources > >>> help(pkg_resources) > > > > On 3/23/08, Chris Hoeppner <[EMAIL PROTECTED]> wrote: > > > > Hey there! > > > > This has really nothing to do at all with django, beside the fact that > > many of it's developers should be able to answer from the top of their > > head. I couldn't think right now of any nice python community, and > > signing up somewhere else just to fire a single question and probably > > never ever return didn't seem like something I'd do on a sunday > > evening. > > > > For an app I'm writing, I'd love to know if it is at all possible to > > do the following workflow: > > > > * Given a list of paths, à la PYTHONPATH, go through those paths and > > it's subpaths and "discover" (aka, import) all python modules found > > * Loop through all of those modules searching for classes that are > > subclasses of a certain class, and add their objects to a list, or: > > * make the modules "execute" (I can't recall if this really happens > > upon import anyways, sorry), so that I could just use a decorator to > > do the add-to-a-list thing > > > > I'm a tad lost on this subject, and I'd really appreciate any pointers > > you could give me. > > > > ~ Chris > > > > > > > --~--~-~--~~~---~--~~ 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 hosting website
After being using VPS based hosting for a while, I have found shared hosting is just not good enough anymore. You just need the flexibility. ~ Chris El lun, 24-03-2008 a las 18:29 -0400, Julian DeFronzo escribió: > Yeah for more flexibility Slicehost or any VPS would be a better > option, but like the others said if something breaks you gotta fix > it. > > However, if you do decide to go with a VPS, you can just send me an > email, and I'd be happy to set it up and maintain it for you ;) > > On Mon, Mar 24, 2008 at 2:09 PM, Bryan Veloso <[EMAIL PROTECTED]> > wrote: > > >Lots more flexibility, but when things break its your fault. > > > Well at least you're able to rebuild instead of begging > customer > service to do it for you. I'll definitely submit my +1 for > Slicehost. > > -Bryan > > > > > > > -- > ~Julian D. > > --~--~-~--~~~---~--~~ 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: Automatic Module Discovery (More to python than to django)
Right this one saved me, Christian =) Thanks a bunch-o-lot! ~ Chris El lun, 24-03-2008 a las 14:50 +0100, Christian Vest Hansen escribió: > For just running another python script from within python, there's a > number of options: > + the exec statement: >>> help('exec') > + the execfile() function (deprecated in py3k) > + the imp module > > On 3/24/08, Chris Hoeppner <[EMAIL PROTECTED]> wrote: > > > > Just thinking about this... > > > > Is there really no way to import something not being on the pythonpath? > > Maybe importing the file's contents as string and stuff it through some > > parser function (just ranting here, don't even know if there is such a > > thing)? > > > > What I want is make a few files execute in a certain order, and if I can > > do that without messing too much with sys.path, even better. Some of > > these files might even have the same name, so `import module` might not > > give me all the files I want either. > > > > Maybe the following workflow would make it possible, even though it > > feels *really* hacky: > > > > pathbk = sys.path > > paths = ['/path/1/file1.py', '/path/2/file2.py'] > > for p in paths: > > sys.path = [os.path.dirname(p)] > > f = os.path.join(sys.path[0], '__init__.py') > > file(, 'w') > > import os.path.splitext(os.path.basename(p))[0] > > os.unlink(f) > > sys.path = pathbk > > > > Basically, I'm clearing the pythonpath for each iteration through the > > files I'm wanting to import, make the pythonpath be solely the folder > > containing the file, create a __init__.py inside it, and import the > > module. Feels hacky, yeah. I hope there's some other way to acomplish > > this. > > > > I've been reading up about setuptools. It's something my head just > > doesn't want to absorb! I'll keep trying it though. > > > > Any tips on this? > > > > > > ~ Chris > > > > El dom, 23-03-2008 a las 22:27 +0100, Christian Vest Hansen escribió: > > > > > There's the pkg_resources module and .eggs. That might be what you're > > > looking for. > > > > > > Try typing this in a python repl: > > > > > > >>> import pkg_resources > > > >>> help(pkg_resources) > > > > > > > > > > > > On 3/23/08, Chris Hoeppner <[EMAIL PROTECTED]> wrote: > > > > > > > > Hey there! > > > > > > > > This has really nothing to do at all with django, beside the fact that > > > > many of it's developers should be able to answer from the top of their > > > > head. I couldn't think right now of any nice python community, and > > > > signing up somewhere else just to fire a single question and probably > > > > never ever return didn't seem like something I'd do on a sunday > > > > evening. > > > > > > > > For an app I'm writing, I'd love to know if it is at all possible to > > > > do the following workflow: > > > > > > > > * Given a list of paths, à la PYTHONPATH, go through those paths and > > > > it's subpaths and "discover" (aka, import) all python modules found > > > > * Loop through all of those modules searching for classes that are > > > > subclasses of a certain class, and add their objects to a list, or: > > > > * make the modules "execute" (I can't recall if this really happens > > > > upon import anyways, sorry), so that I could just use a decorator to > > > > do the add-to-a-list thing > > > > > > > > I'm a tad lost on this subject, and I'd really appreciate any pointers > > > > you could give me. > > > > > > > > ~ Chris > > > > > > > > > > > > > > > > > > > > > > > > > > --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
smtp error
Hey there! I'm getting a quite weird smtp error when sending mail. Here's a traceback: Traceback (most recent call last): File "/usr/lib/python2.5/site-packages/django/core/handlers/base.py" in get_response 77. response = callback(request, *callback_args, **callback_kwargs) File "/var/www/django/satchmo/accounts/views.py" in register 100. send_welcome_email(email, first_name, last_name) File "/var/www/django/satchmo/accounts/views.py" in send_welcome_email 62. send_mail(subject, t.render(c), shop_email, [email], fail_silently=False) File "/usr/lib/python2.5/site-packages/django/core/mail.py" in send_mail 325. return EmailMessage(subject, message, from_email, recipient_list, connection=connection).send() File "/usr/lib/python2.5/site-packages/django/core/mail.py" in send 255. return self.get_connection(fail_silently).send_messages([self]) File "/usr/lib/python2.5/site-packages/django/core/mail.py" in send_messages 163. new_conn_created = self.open() File "/usr/lib/python2.5/site-packages/django/core/mail.py" in open 128. self.connection = smtplib.SMTP(self.host, self.port) SMTPServerDisconnected at /accounts/register/ Connection unexpectedly closed So, first thing, I got a shell and telnet'ed the smtp server. Here's the screenplay: [EMAIL PROTECTED]:~# telnet localhost 25 Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. 220 webdevrack.securitylan.int ESMTP Postfix (Ubuntu) helo localhost 250 webdevrack.securitylan.int mail from: [EMAIL PROTECTED] 250 2.1.0 Ok rcpt to: [EMAIL PROTECTED] 250 2.1.5 Ok abc 502 5.5.2 Error: command not recognized data 354 End data with . abc abc abc abc . 250 2.0.0 Ok: queued as 42E9D16403D Seconds later, the mail was successfully delivered. Here's an excerpt from mail.log: Jul 11 12:58:40 webdevrack postfix/smtpd[5746]: connect from localhost[127.0.0.1] Jul 11 12:59:10 webdevrack postfix/smtpd[5746]: 42E9D16403D: client=localhost[127.0.0.1] Jul 11 12:59:30 webdevrack postfix/cleanup[5749]: 42E9D16403D: message-id=<[EMAIL PROTECTED]> Jul 11 12:59:30 webdevrack postfix/qmgr[5714]: 42E9D16403D: from=<[EMAIL PROTECTED]>, size=388, nrcpt=1 (queue active) Jul 11 12:59:32 webdevrack postfix/smtp[5752]: 42E9D16403D: to=<[EMAIL PROTECTED]>, relay=mail.pixware.org[64.13.227.76]:25, delay=29, delays=27/0.01/1.4/1, dsn=2.0.0, status=sent (250 ok 1184151487 qp 32211) Jul 11 12:59:32 webdevrack postfix/qmgr[5714]: 42E9D16403D: removed Since the simmulation works fine, I don't know where the problem might be. I've given python the same credentials as I used on the command line, though localhost is on mynetworks, and thus doesn't require authentication. Any clues? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
newforms: manually accessing initial value for field
Hi there! I was just wondering how to access the value I've set in the view with Form(initial={'val':somevar}) in the template. Maybe field.value? No. field.initial? No. Any clues? 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 -~--~~~~--~~--~--~---
Re: session in all templates?
Martin Kaffanke escribió: > Am Mittwoch, den 11.07.2007, 13:34 -0400 schrieb Simon Drabble: >> On Wed, 11 Jul 2007, Martin Kaffanke wrote: >> >>> Am Mittwoch, den 11.07.2007, 12:26 -0400 schrieb Simon Drabble: >>>> On Wed, 11 Jul 2007, Martin Kaffanke wrote: >>>> >>>>> Hi there! >>>>> >>>>> How can I configure django to put the session (request.session) in all >>>>> templates? >>>>> >>>>> I want to put a 'Hello Username' for logged in Users, and I want to do a >>>>> dynamic login/logout button into the menu, depends on if there is a >>>>> logged in user or not. >>>>> >>>>> Thanks, >>>>> Martin >>>>> >>>> Extend your templates from a common base, with the session info in the >>>> base. >>> Hum, I do not really understand what you mean... any links? >>> >>> Thanks, >>> Martin >>> >> Start here: >> >> http://www.djangoproject.com/documentation/templates/ >> >> Particularly: >> >> http://www.djangoproject.com/documentation/templates/#extends > > Ok, I knew this already, but I think my problem is a bit different. > > At the moment I use on some places a > > {'session': request.session} for the Context to render the template. > How Can I make the session automaticaly available in the base template, > without having to be aware that I don't forgett this parameter for the > Context? > > Thanks, > Martin I know it's not my problem, but you might consider that there might be a 'why' for the session data not being in the template by default. Anyways, have a look at the auth middleware. It puts the user var into the templates, and that's just what you need. However, I'd prefer to inject the needed vars manually in the view. You know... Business logic and all that stuff. ;) Kind regards, Chris Hoeppner www.pixware.or BTW: Extending a template does not "extend" the values of the vars, as they're assigned by the view on each request, AFAIK. --~--~-~--~~~---~--~~ 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: Avoiding HTTP 301 code using mod_python
You might want to have a look at: http://www.djangoproject.com/documentation/settings/#append-slash Kind regards, Chris Hoeppner www.pixware.org Miguel Filho escribió: > Hello list, > > I'm deploying my site on webfaction.com using mod_python. URL: > http://interno.homelinux.org > > In webfaction.com, I have my Apache instance with mod_python, > listening on a high port, then the main Apache running on the server, > redirect the requests to my Apache instance. A common setup, AFAIK. > > When I try to access an internal URL, like > http://interno.homelinux.org/links, if there is no / at the end, > Django returns an HTTP 301 header, containing the same path, but with > a / at the end. If I type the URL with the / at the end, Django > returns an HTTP 200. Both using mod_python or the `python manage.py > runserver`. > > The problem is when returning the HTTP 301 headers, Django puts in the > response the host with my high port. > > So if I type: > http://interno.homelinux.org/links <-- returns an HTTP 301, headers at > the end of the message. > > Then I get: > http://interno.homelinux.org:2826/links/ > > Using: > http://interno.homelinux.org/links/ <-- slash added, returns an HTTP 200. > > To avoid this, I tried adjusting the URL mapping to this: > (r'^links(/)?', include('interno.links.urls')) > > Adding the (/)? solves the problem, but only if I run my site using > `python manage.py runserver`. If I use mod_python, this does not work, > and Django returns a 301 anyway. > > I tested with Apache2/mod_python in my machine using Debian Lenny, I > have the same behavior as webfaction.com > > Is there anyway to avoid this? I don't understand why the URL mapping > work with the WSGI server, avoiding the 301 responses, but with > mod_python doesn't. > > For logic reasons, I don't want my users accessing my site with a non > standard port. > > Miguel > > Headers: > > GET /links HTTP/1.1 > > Host: interno.homelinux.org > > User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.3) > Gecko/20070310 Iceweasel/2.0.0.3 (Debian-2.0.0.3-1) > > Accept: > text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 > > Accept-Language: en-us,en;q=0.5 > > Accept-Encoding: gzip,deflate > > Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 > > Keep-Alive: 300 > > Connection: keep-alive > > > > HTTP/1.x 301 Moved Permanently > > Date: Thu, 12 Jul 2007 17:49:58 GMT > > Server: Apache/2.0.52 (Red Hat) mod_python/3.3.1 Python/2.5 > > Location: http://interno.homelinux.org:2826/links/ < > > Content-Type: text/html; charset=iso-8859-1 > > Vary: Accept-Encoding,User-Agent > > Content-Encoding: gzip > > Content-Length: 208 > > > > -- > > http://interno.homelinux.org/links/ > > > > GET /links/ HTTP/1.1 > > Host: interno.homelinux.org:2826 > > User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.3) > Gecko/20070310 Iceweasel/2.0.0.3 (Debian-2.0.0.3-1) > > Accept: > text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 > > Accept-Language: en-us,en;q=0.5 > > Accept-Encoding: gzip,deflate > > Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 > > Keep-Alive: 300 > > Connection: keep-alive > > > > > HTTP/1.x 200 OK > > Date: Thu, 12 Jul 2007 17:49:58 GMT > > Server: Apache/2.0.52 (Red Hat) mod_python/3.3.1 Python/2.5 > > Vary: Cookie > > Keep-Alive: timeout=15, max=100 > > Connection: Keep-Alive > > Transfer-Encoding: chunked > > Content-Type: text/html; charset=utf-8 > > > --~--~-~--~~~---~--~~ 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: Getting debug with apache and mod_python
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Alessandro Ronchi escribió: > > > On 13 Lug, 15:24, "Alessandro Ronchi" <[EMAIL PROTECTED]> > wrote: >> With apache and mod_python, and this configuration: > > I've changed my configuration as follows. I get an 500 error but > nothing goes to apache error.log, and I don't know what's the problem. > How can I solve that? > > > > ServerName www.corrierecooperativo.it > ServerAdmin [EMAIL PROTECTED] > DocumentRoot /home/www/html/corrierecooperativo.it > > > SetHandler python-program > PythonHandler django.core.handlers.modpython > PythonPath "['/home/django/django_projects/'] + sys.path" > SetEnv DJANGO_SETTINGS_MODULE > legacoopfc.settings_corrierecooperativo > PythonDebug On > > > SetHandler None > > > > Do you get a 500 with nothing else? Then your problem is in the apache error log, /var/log/apache/error_log Else, you should get either a django error page or a mod_python error uncaught by django. -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFGnJuRN+WrACaI1wcRAj+jAJ4nLUVevmzmI3W6rwYXp3Zn9ZqPjQCeN+7N iD5I9Vi5/PteIJMxBb+Zp/U= =5hkQ -END PGP SIGNATURE- --~--~-~--~~~---~--~~ 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: is there any host servers that supports Django based sites?
Tim Chase escribió: >> Frankly, you'd be hard pressed to find any unix (including >> Linux) based web host that doesn't have Python installed. >> Python is a default component of every Linux distribution I've >> ever used. > > Though to add to this, I have used hosting services that still > used Python 2.2 (or earlier) and IIRC, Django requires Python > version 2.3+ > > -tim You'll wanto to try with at least 2.4. Though it's said that 2.3 *is* supported, it has given me tons of headaches. For safe, go for 2.4 at least. signature.asc Description: OpenPGP digital signature
Bulk data upload
Hi there! I've been working on an ecommerce solution. So far everything works like it should. There's just one "nice to have" feature left: bulk upload. I've thought of using xls (microsoft office's excel files) to make it easy on the client, because teaching them xml or yaml isn't the big deal. After thinking about it, finding a xls parser module for python might not be the problem, but how could I take on product images? How can I bulk upload those? Ok, I can upload a tar or zip file and have it unpacked automatically, but how do I automagically assign the images with the product, having in mind that some might have 5 pics and others might have 2 or none. Any ideas? signature.asc Description: OpenPGP digital signature
Re: Bulk data upload
This approach does sound really interesting, and is pretty close to what I've been planning. I wonder if I might have a look at that ExcelImport class :) Toby Dylan Hocking escribió: >> What about CSV? You can export from Excel as CSV pretty easily and it's a >> fairly easy format to parse in python... > > Either that or tab-delimited text. I have a django app that does bulk data > upload from the admin interface according to the following protocol. > > 1. Users make their bulk upload data tables in excel. > > 2. They log onto the Django admin site, where I have a special ExcelImport > model set up --- it just has a TextField where the data goes. > > 3. They copy the entire table from excel and paste it in the TextField, > then click Save. > > 4. I have a custom save() method for the ExcelImport class that processes > the data and creates the related objects. > >> Thanks, >> >> Dave >> >> -- >> David Reynolds >> [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 > -~--~~~~--~~--~--~--- > signature.asc Description: OpenPGP digital signature