|
bitprophet posted:StabbinHobo, you don't work in the journalism field, do you? Not at a paper in JC perhaps?
|
# ? Mar 31, 2008 23:13 |
|
|
# ? May 16, 2024 18:28 |
|
Well after some careful deliberation, I picked up my first two Python books. Learning Python and Programming Python (both O'Reilly). I'm currently learning PHP, because I desire to get a job in web development (and I feel that, with a nice PHP background that my job choices will be broader). But I plan on picking up the Python books soon and taking a stab at it. Here's to a long future with Python!
|
# ? Apr 1, 2008 00:35 |
|
StabbinHobo posted:indeed. you interview? I did, last summer actually, but ended up going with the place I'm at now (sorry!). Good luck with the hiring, if I run into anyone looking for Django work I'll send them your way Tap posted:Here's to a long future with Python!
|
# ? Apr 1, 2008 01:16 |
|
http://code.google.com/appengine/ Django support out of the box It's the only framework supported http://code.google.com/appengine/articles/django.html Grr... Looks like the parts that are supported are only the request handling, and template engine side. No support for the Django ORM. Looks like there's already a problem on the Dev side about BigTable and the Django ORM mixing since BigTable has built in support for joining. ATLbeer fucked around with this message at 15:50 on Apr 8, 2008 |
# ? Apr 8, 2008 15:29 |
|
I've installed everything on Windows as I'll be testing it on XP before moving to a Linux server. I've installed Apache2, Postgresql 8.3.1, etc. Then I got this error: code:
code:
code:
|
# ? Apr 8, 2008 15:52 |
|
Senso, if you have a minute, you should definitely do a quick search on the Django bug tracker to see if there's a ticket for this already, and if not, make a quick one with the info you just posted - it sounds like this might be a genuine minor bug in the Postgres support, and if so, it'd be great to have it officially reported so it can be fixed in trunk vvv Thanks! bitprophet fucked around with this message at 22:06 on Apr 8, 2008 |
# ? Apr 8, 2008 18:38 |
|
bitprophet posted:Senso, if you have a minute, you should definitely do a quick search on the Django bug tracker to see if there's a ticket for this already, and if not, make a quick one with the info you just posted - it sounds like this might be a genuine minor bug in the Postgres support, and if so, it'd be great to have it officially reported so it can be fixed in trunk Good idea. I assumed it was already fixed but I did a search and found a similar problem with MySQL but not with PostgreSQL. So I've opened Ticket #6987.
|
# ? Apr 8, 2008 20:21 |
|
I've decided to take a look into Django and I had some quick questions. From Java / ASP development, I've gotten spoiled in having really good IDE's. Is there a good ide for Python? By good I mean at least has syntax highlighting, intellisense and debugger integration. Project management would be a bonus but I guess it is not required.
|
# ? Apr 9, 2008 01:58 |
|
jarito posted:I've decided to take a look into Django and I had some quick questions. From Java / ASP development, I've gotten spoiled in having really good IDE's. Is there a good ide for Python? By good I mean at least has syntax highlighting, intellisense and debugger integration. Project management would be a bonus but I guess it is not required. Gotta specify your platform... Any programmer's editor will do syntax highlighting for Python, and most of the extensible ones (Vim, Emacs, TextMate, etc) will probably have third party Django template language bundles available. Debugger integration varies; debuggers aren't typically (in my experience) terrifically useful/applicable to Web development, but for stuff that can be tested outside of the Web context, there are Python debuggers such as pdb, and again many editors have hooks for them. From what I've seen, though, most Django devs don't find themselves needing the big beefy IDE setup that Java, etc practically require. Autocomplete, syntax highlighting and a terminal = good to go.
|
# ? Apr 9, 2008 02:09 |
|
I generally develop on Windows these days due to a lot of ASP.NET projects, but I still run Linux so either of those would be fine. So the only options are Vim / Emacs (TextMate is OSX only, yes?). That's disappointing. There aren't any plugins for Eclipse or something of that nature that do intellisense? I've never been that fond of vim / emacs, but I guess I can use them if I really have too. I disagree about the debugger comment, but that's a whole different conversation.
|
# ? Apr 9, 2008 02:16 |
|
jarito posted:I generally develop on Windows these days due to a lot of ASP.NET projects, but I still run Linux so either of those would be fine. So the only options are Vim / Emacs (TextMate is OSX only, yes?). That's disappointing. There aren't any plugins for Eclipse or something of that nature that do intellisense? I've never been that fond of vim / emacs, but I guess I can use them if I really have too. Oh, no, I wasn't giving an exhaustive list. Pretty sure the default Python distribution comes with something called IDLE, that might be Windows only, not sure. No idea how good it is - I use TextMate which is OS X only. Eclipse should definitely have Python support, not sure if it has Django specific support. Google around for "(python OR django) IDE" and I'm sure you'll find blog posts / discussions. vvv I actually use vim more than TM nowadays since I spend a lot of time remotely editing...it is pretty awesome bitprophet fucked around with this message at 02:58 on Apr 9, 2008 |
# ? Apr 9, 2008 02:33 |
|
bitprophet posted:Eclipse should definitely have Python support, not sure if it has Django specific support. Google around for "(python OR django) IDE" and I'm sure you'll find blog posts / discussions. Eclipse has PyDev for Python support, nothing specific to Django that I've found. I actually prefer vim anyway though (on Windows and Linux)
|
# ? Apr 9, 2008 02:41 |
|
I've tried so many editors but, on Windows, Notepad++ is the one I prefer. It's quick, has dozens of specific plugins, good syntax highlighting and code folding, tabs and more.
|
# ? Apr 9, 2008 02:48 |
|
I normally use Wing IDE Personal. There's supposed to be a way to integrate Django with it for Debugging and what not but i havn't really messed with it all since its easier to just debug with the dev server normally.
|
# ? Apr 9, 2008 02:52 |
|
http://djangopluggables.com/ Nice repository full of django apps you can plug into your site.
|
# ? Apr 10, 2008 17:27 |
|
ATLbeer, thanks for the awesome first Django/Web experience. I haven't done much web development and basically spent most of my time working on imaging libraries and various python projects. So this is a refreshing experience and exciting since I am getting right into the action rather then learning php or brushing up my ruby skills. So thanks! Also, I am using Eclipse and PyDev(an eclipse extension for python development) and it works wonderfully with Django after you add the django site-package path. For anyone who is looking for an editor check it out pydev/eclipse is fairly advanced. I also tried dong some django work in wingIDE, but its pricey unless you go thru the free copy for open source developers process(the biggest hurdle is waiting for the snail mail).
|
# ? Apr 10, 2008 23:24 |
|
I've just been getting into Django and I really really like it. Here's the long-winded rant/odyssey about how I finally found a way to develop web-apps that finally seems makes sense to me: I've been using PHP for the past five years and have always hated it. As Larry Wall once said, PHP really does bring "worse is better" to new levels. Though I appreciate PHP's practicality for small scripts, it's universal support, and how it was responsible for making the development of dynamic websites accessible to mere mortals, it really is just a horrible awful programming language. For the past few years I've been trying to find a viable Perl alternative. I know Perl pretty darn well and it just seems every time every time I try to get something like Catalyst, Embperl, or Mason working, it just turns into a nightmare. The CPAN installs always fail, nothing can "just work" from the beginning, and I'm forced to try and figure out if I want Apache::Session, Embperl::Session, Apache::SessionX, and then it forces me to decide where to store the data for my sessions, and oh wait, CentOS 3 or 4? has mod_perl 1.99.FAIL which will make everything blow up no matter what you do, and they refuse to issue a working alternative RPM. Can't Perl just work??? It's a fun, expressive language, and I don't know if these problems arise from the "there is more than one way to do it" philosophy, or the fact that the "all-star" Perl developers are all focused on bulking up Perl 6's vaporware. I also tried to just develop simple applications with mod_perl. Mod_perl is pretty clean and simple these days (since the 1.0 -> 2.0 insanity) and has really good support across distros and cpanel. I wrote some Apache handlers with mod_perl and I thought it was totally awesome how lightning fast they were, especially with database access. The only problem is that in order to write a web app on mod_perl alone, I'd really be on my own. I'd have to pick and choose my CPAN modules and hope that people are using them in the future, and "roll my own" of so many things, that it just didn't seem practical for rapid web application development. So I ran back to PHP and cried a lot. About a month or so ago I decided to try Ruby out. I had seen their screencasts, and a post-grad friend of mine always raves about Ruby's OOP purity, so I figured I'd give Ruby and Rails a chance. I learned a bit of Ruby, and it's definitely not as mature as Python and Perl in terms of having a large collection of libraries for doing various things. I downloaded the MySQL extension and started goofing around and had some fun. The language didn't feel as responsive on the command line like Python and Perl, but that's no problem. Then I started trying to learn Rails. At this point the latest version is 2.x and I just couldn't seem to find ANY decent up-to-date learning material aside from the reference manual. The tutorials and screencasts I did find, left me with a simple webapp that worked, but without any understanding of how all the RoR's black magick involved in created that app (like scaffolding) works. One major tutorial (I think it was the official one) had blatently wrong errors that I had to work around. In the end I just felt like I spent two days watching a bunch of guys "show off". After doing a little more research on the poor status of rails documentation, the general consensus of the blogging community seems that the Rails people are more interested in getting you to buy the book. I also didn't like that the current recommended strategy for production use of rails is to Proxy requests through Apache to a bunch of mongrel processes. In order to do this, you need a bleeding edge version of Apache which just isn't practical if you want to deploy on an existing server. I managed to setup a mongrel cluster on my home computer (4-core 2.6ghz core 2 CPU) and if I recall correctly I got about 1000 requests per second on a hello world app. This isn't terrible, about the same speed as a hello world PHP app, but I could get django to go much much faster. I also didn't like Ruby so much as a language. I think it's amazing that it's essentially a pure OOP language like SmallTalk, only with modern syntax (even though its purity might make the language a little less practical in terms of speed) I was also happy to find built-in support for Perl's regular expressions; however, I feel Ruby took a bit too much of the ugliness of Perl with it. (Matz even admits this) Another really really big problem with Ruby is that it doesn't support [a=http://spec.ruby-doc.org/wiki/Ruby_Threading]"real" threads[/url]. This was a really bad design choice considering the way CPUs are being built these days, and that flaw alone, is reason enough to not take Ruby as a "serious" language for general purpose for business use. (Yes this will probably be fixed with other VMs or implementations in the future) So after failing miserably in learning Ruby on Rails, I found out about Django. I went through the getting started tutorial, and as soon as I read that the preferred production setup was PostgreSQL with Apache/mod_python, I instantly knew these guys were serious about developing a practical, scalable framework. As I started learning how to do things, I was amazed that, it seemed like the first time ever, that things were actually making sense!. Probably what I love the most is that the Django people take an amazing approach to documentation: instead of showing off all these neat magical features, they start by showing you the "dumb" way to do something so you can understand what's happening from top to bottom, then they gradually show you all the shortcuts and design patterns Django offers to make life easier. And best of all, Django is FAST! On one of my xeon servers, I could get a hello world app in Django to perform pretty much on-par with a mod_perl apache module. Not only was the framework simple, it was lightweight. So I'm very excited about Django, but I won't know for sure if it's the as good as I hope it will be until I actually write a full web application with it. So in closing, I'd just like to say that I sincerely thank those of you (especially ATLbeer) who are putting their time and effort into making Django better and more mainstream.
|
# ? Apr 11, 2008 22:18 |
|
I have a quick question regarding the subclassing of models. My code has a few models which share a decent amount of common attributes and I am wondering if making a superclass then subclassing it would work well. I heard some chatter last year about subclassing not working well with models is this still the case(maybe in 0.96)? Is inheritance broken for models?
|
# ? Apr 13, 2008 04:49 |
|
I don't want to make a new thread so I'll ask here. I'm looking at doing a new web project either in php or python. I've tentatively started with php using code igniter. It's been a few years since I used php heavily and have been working mostly on java/struts apps and a little asp.net. I've been finding it a little difficult to work in java all day and then switch gears to php at night. Generally speaking, is python/django going to be an easier transition for web apps than php?
|
# ? Apr 13, 2008 15:41 |
|
tehk posted:I have a quick question regarding the subclassing of models. Model subclassing is still not officially in, but the queryset-refactor branch (which will hopefully hit trunk in the next, I dunno, month or two maybe?) has implemented it: http://code.djangoproject.com/changeset/7126#file8 So if you're willing to use an unstable branch, you could check out that version of Django and give it a whirl. I haven't used it at all. Withnail posted:I've been finding it a little difficult to work in java all day and then switch gears to php at night. Generally speaking, is python/django going to be an easier transition for web apps than php? Depends partly on what you mean by "easier"; PHP's syntax is a little closer to Java than Python's is (what with the semicolons and curly braces and all). In terms of overall web development paradigms, I've never used Struts so I can't really say there.
|
# ? Apr 13, 2008 15:59 |
|
I have a quick question about master templates and such. I have one master template that works fine, but I was curious how to handle dynamic data in the different blocks. Let's say I have something like this for the master template (lots of the basic code omitted).code:
|
# ? Apr 13, 2008 20:13 |
|
jarito, you can use context to determine if the user is logged in or not, I can't think of the exact sytanx in my head right now, but the template code would be something like "If user.something (can't reacall the name, its in the docs though)" then {{ user.username }}, else, print your login block. You can either use a context processor to put a form object in the context of every page, a template tag, or manually code in a form.
|
# ? Apr 13, 2008 23:48 |
|
jarito posted:I have a quick question about master templates and such. I have one master template that works fine, but I was curious how to handle dynamic data in the different blocks. Let's say I have something like this for the master template (lots of the basic code omitted). You can actually do this logic in the master template(assuming you want it in all child templates): code:
You will need to have RequestContext for this to work(of course).
|
# ? Apr 14, 2008 00:32 |
|
Thanks for all the help guys, I will give that a shot.
|
# ? Apr 14, 2008 00:56 |
|
Okay, another newbie question . I'm used to be easily able to do multiple operations on one page (from ASP.NET) so I might be off, but here's what I want to do. I would normally do this all one one page (AJAX will come later). 1. Have the user enter a piece of data. 2. Perform a web service request and display options. 3. User selects an option. 4. Store data from the selected option in the DB. I have the web request working, but I don't really seem to be able to get the control flow to work. I have a view named 'add'. Here is the urls.py code:
code:
The problem is that the 'request.POST.__contains__('books_isbn'):' always seems to return true since the error I get is: code:
Also as a side note, what is the standard tab=space settings for python code?
|
# ? Apr 15, 2008 03:15 |
|
jarito posted:I also tried 'request.POST.has_key('books_isbn') with the same results. Am I going about this the wrong way? Is there a more accepted way to do what I am trying to do? code:
code:
May I also suggest you put the ISBN in the URL? ISBNs are only numbers and hyphens so it should look fine, and allow people to copy and paste the URL. Example: http://mysite.com/book/isbn/978-3-16-148410-0/ jarito posted:Also as a side note, what is the standard tab=space settings for python code? The Real Ambassador fucked around with this message at 07:13 on Apr 15, 2008 |
# ? Apr 15, 2008 07:05 |
|
bitprophet posted:Model subclassing is still not officially in, but the queryset-refactor branch (which will hopefully hit trunk in the next, I dunno, month or two maybe?) has implemented it: http://code.djangoproject.com/changeset/7126#file8 PHP's syntax is sort of like javas. But honetstly, PHP's actual language isn't in the ballpark. Python does real OO, and does it loving well (Granted php5 is starting to look a bit more like real oo) and for added fun, you can still hang out in java land using Jython (or c# land using ironpython) and it all works smooth as poo poo. Hell, Java's Groovy is a pretty much self confessed rip of python but java-ish. In re to the glowing review a bunch of posts back. Python is awesome, but its threading won't get you multiple core utilisation without some deep thought. Incidently tell guido to make that global interpreter lock gtfo, since thats what holds the multicore stuff back.
|
# ? Apr 15, 2008 07:43 |
|
duck monster posted:PHP's syntax is sort of like javas. But honetstly, PHP's actual language isn't in the ballpark. Python does real OO, and does it loving well (Granted php5 is starting to look a bit more like real oo) and for added fun, you can still hang out in java land using Jython (or c# land using ironpython) and it all works smooth as poo poo. Hell, Java's Groovy is a pretty much self confessed rip of python but java-ish. It really irritates me when people think languages are similar because they both have curly brackets. The Real Ambassador fucked around with this message at 09:04 on Apr 15, 2008 |
# ? Apr 15, 2008 08:59 |
|
The Real Ambassador posted:It really irritates me when people think languages are similar because they both have curly brackets. Heh, well I was only throwing that out because it's been years since I used Java heavily (university; been using Python exclusively since I graduated) and didn't feel qualified to speak on the more meaningful similarities/differences. That's why I italicized syntax, an attempt to highlight the fact that it wasn't really something to seriously compare with. The real point of my reply was the request for clarification of what he was asking for, should have left it at that. bitprophet fucked around with this message at 15:38 on Apr 15, 2008 |
# ? Apr 15, 2008 15:35 |
|
I know this is a big vague, but hopefully someone may have an ideacode:
http://dpaste.com/45018/ - Full error message http://dpaste.com/45019/ - My views, line 100 is the delete part
|
# ? Apr 15, 2008 21:58 |
|
Wulfeh posted:I know this is a big vague, but hopefully someone may have an idea I'm not sure what contact_record = Contact is supposed to be doing, that's assigning the Contact model class to that variable, which then gets clobbered on the next line. It seems like it should possibly work, I don't know what __init__ is missing an arg, because the rest of it looks fine. It's kind of hard to unwind the full debug page dump from that pastebin. A screenshot would be more helpful (to me). Also, from your views: code:
|
# ? Apr 15, 2008 22:08 |
|
Wulfeh posted:I know this is a big vague, but hopefully someone may have an idea Oh woops, contact_record = Contact was left there by accident when I was trying to debug. That can be ignored really. No Safe Word posted:Also, from your views: I remember passing over that when I started learning Python a few weeks ago, but yea, now it will stick with me since you mentioned it.
|
# ? Apr 15, 2008 22:15 |
|
I'm having a problem making my first Django Model class save(). I keep getting an AttributeError with the message: 'Foo' object has no attribute 'id' The docs make it pretty clear that you don't have to specify an id field, that it'll add one for you if you don't, so what could be keeping it from working? I'm using a Manager, I have a Meta class that sets a different db_table and an __init__ that sets all the fields, but nothing else that's all that complicated. Any ideas? Also, I just started using Python last week to play around with the Google App Engine and got hooked on Django this week, it's pretty sweet. Seems to make things just about as easy as possible, I think. Except, of course, when none of your objects will save
|
# ? Apr 19, 2008 08:36 |
|
ImJasonH posted:I'm having a problem making my first Django Model class save(). I keep getting an AttributeError with the message: 'Foo' object has no attribute 'id' Please paste (or pastebin, e.g. dpaste.com) your model code? Hard to troubleshoot without. Been a while since I tinkered with save() but I am reasonably sure objects do not get an id until after their first save, so depending on what you're doing that might be the issue. Also, "an __init__ that sets all the fields" could be dangerous depending on what that means exactly, which is another reason I'd like to see your code
|
# ? Apr 19, 2008 16:21 |
|
bitprophet posted:Please paste (or pastebin, e.g. dpaste.com) your model code? Hard to troubleshoot without. http://dpaste.com/45833/ I changed it __init__ to a method, in case that was the problem, and it appears to at least be getting further. Now the problem is: code:
|
# ? Apr 19, 2008 21:17 |
|
Try switching the 0 and 1 to true and false, maybe it forgets to do a type check before turning it into a string. Not sure if SQLite shits itself when you try to set a boolean field to 0 or 1. also what the christ self._aligns.keys().index(chunks[14]) is just self._align[chunks[14]]. deimos fucked around with this message at 21:45 on Apr 19, 2008 |
# ? Apr 19, 2008 21:42 |
|
deimos posted:Try switching the 0 and 1 to true and false, maybe it forgets to do a type check before turning it into a string. Not sure if SQLite shits itself when you try to set a boolean field to 0 or 1. Which 0 and 1s? The only boolean field I have is already set with True and False. _aligns is a dictionary, and I need to store the index of the matching key, not the value of it. It's a dictionary because later on when I output the results I'll want the full value and not the abbreviated one that's in the logs. ImJasonH fucked around with this message at 22:06 on Apr 19, 2008 |
# ? Apr 19, 2008 22:02 |
|
ImJasonH posted:Which 0 and 1s? The only boolean field I have is already set with True and False. Dict key order is not guaranteed between implementations so you might want to rethink that strategem, make it into a multi-dimensional list. There's no need to turn this data into a number when a 3 character string will do, if you want to normalize normalize right but if you're gonna keep your data denormalized at least do so in a legible manner. I jumped to conclusions with the 0/1 thing. Try making the fields of a less restrictive type and see (ie. PositiveInteger instead of PositiveSmallInteger) it might be a bug in the backend. Your code somewhat stinks of SAVAGELY OPTIMIZED overtones. deimos fucked around with this message at 23:52 on Apr 19, 2008 |
# ? Apr 19, 2008 23:45 |
|
deimos posted:Your code somewhat stinks of SAVAGELY OPTIMIZED overtones. You're probably right, I could probably save myself a lot of trouble by just storing strings in the database instead of ints. In fact, yeah, I'm going to tweak this some and simplify.
|
# ? Apr 20, 2008 00:13 |
|
|
# ? May 16, 2024 18:28 |
|
ImJasonH posted:You're probably right, I could probably save myself a lot of trouble by just storing strings in the database instead of ints. In fact, yeah, I'm going to tweak this some and simplify. I am not against storing ints where ints are due, but making them small or large really isn't saving you a lot. Still I'd love to know if it's some sort of backend issue with django so that a proper ticket can be opened.
|
# ? Apr 20, 2008 02:33 |