|
ashgromnies posted:This post makes me want to learn Django... anyone know of a good cheap webhost that supports using it? It works on Dreamhost, but a lot of goons hate dreamhost. And it's also not super-easy to get working on Dreamhost either. But I've got my little ToME monster search app hosted on there and it runs just fine for the low volume it has to handle.
|
# ¿ Mar 7, 2008 20:15 |
|
|
# ¿ Apr 28, 2024 14:41 |
|
Although I would prefer something that didn't use the negative-space version of the logo, you can buy t-shirts and hoodies with the django logo on it here: http://django.spreadshirt.com/us/US/Shop/ If it was just the text in white I'd totally buy it
|
# ¿ Mar 7, 2008 22:49 |
|
greenskeleton posted:http://www.djangoproject.com/documentation/model-api/#unique-for-date Cool, I didn't even know such a thing existed, though: django docs posted:This is enforced at the Django admin-form level but not at the database level. So, useful, but not db-uniqueness-assuring.
|
# ¿ Mar 13, 2008 18:51 |
|
ashgromnies posted:EDIT: You know what... I love Django and the philosophy behind it but it's just not giving me what I need for development. I like working on things on the fly and implementing new features incrementally and Django offers no way to do that. The best way around that that I've found is to use the initial fixtures support, and just constantly dump/reload your database after schema changes. It's not perfect, but it works and isn't a lot of hassle. I do agree that it is a bit of a pain to have to introduce schema updates using the current setup otherwise.
|
# ¿ Mar 24, 2008 22:07 |
|
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 |
|
http://djangopluggables.com/ Nice repository full of django apps you can plug into your site.
|
# ¿ Apr 10, 2008 17:27 |
|
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 |
|
jarito posted:Is there anyway to have syncdb just drop all the tables and reinsert them? loaddata docs have the information on how to create these fixtures here the syncdb docs state: quote:syncdb will also search for and install any fixture named initial_data with an appropriate extension (e.g. json or xml). See the documentation for loaddata for details on the specification of fixture data files.
|
# ¿ Apr 23, 2008 01:15 |
|
liquidfury posted:I having an issue with the database not updating the coloums when the models are changed. I saw in the thread that it is a known issue. Is there a way to force it to update? I am running Django 0.96.1 It's not just a known issue, it's just the way it's going to be. You have to recreate the database/tables when you make a change to the model. There was a schema-evolution branch in progress, but I don't know what is happening with it. Alternately, manually make the changes
|
# ¿ May 6, 2008 07:52 |
|
Bonus posted:Yes but you see, this way I get to use the awesomely cool yes program. With "no" as an argument for extra fun.
|
# ¿ May 7, 2008 20:49 |
|
James Bennett has apparently just finished up some of the final edits on his upcoming Django book, "Practical Django Projects". You may recognize him from some online sites as ubernostrum, but he's one of the higher profile Django devs and an all-around pretty bright guy. I'm sure his book will be very good, and for anyone looking to get started in the next few months it sounds like this may be a good book to have on the shelf.
|
# ¿ May 29, 2008 04:04 |
|
How fuzzy is it going to be? Are you only interested in exact search string matches? Or stuff that "kinda looks like it"? It might be something that you just pick a solution and run with it for a while to see if you hit a wall. My gut tells me it should be a separate model, but I'm having a tough time coming up with the best structure for it.
|
# ¿ Jun 3, 2008 22:36 |
|
Oh man, opportunity of a lifetime: gently caress this job, I'm gonna go become a CTO! So, since it's obviously spam for email addresses harvested from a Django-centric site ... anyone else get this?
|
# ¿ Jun 4, 2008 23:27 |
|
checkeredshawn posted:In main/models.py when I use def __unicode__(self) instead of def __str__(self) in the Admin interface everything is just a "BlogPost object" or a "Category object", they don't show as the names that I've assigned to them, i.e. 'General' (example of a Category) or 'First blog post' (example of a BlogPost). Is there a way around this? code:
Though I thought it had all been fixed already, are you sure you're using the latest trunk? Not some branch where admin isn't fixed?
|
# ¿ Jun 30, 2008 22:22 |
|
If there are any Houston-area Django lovers in the area, the Houston Python Meetup group is having an Introduction to Django meetup Tuesday, August 26th. Come on out!
|
# ¿ Aug 12, 2008 22:12 |
|
Django 1.0 beta1
|
# ¿ Aug 15, 2008 07:59 |
|
Jo posted:I'm missing something really stupid, but I just can't figure it out. You're missing the import to let it know what DatabaseImage is code:
|
# ¿ Aug 18, 2008 06:02 |
|
Senso posted:EDIT: Huuuh, I moved everything outside my home and put it in /opt, changed all the path definitions and now it works. Djangooooo
|
# ¿ Aug 28, 2008 22:21 |
|
Django 1.0 is final Release notes with what's new edit: also Blog post! No Safe Word fucked around with this message at 02:24 on Sep 4, 2008 |
# ¿ Sep 4, 2008 02:18 |
|
Not immediately but you should begin to migrate at some point. And here's the link to the porting guide: http://docs.djangoproject.com/en/dev/releases/1.0-porting-guide
|
# ¿ Sep 5, 2008 14:54 |
|
MononcQc posted:Is there any way I can achieve that or I'll have to do it the long way without shortcuts? Maybe there's something I missed from the doc again. code:
|
# ¿ Sep 10, 2008 05:41 |
|
For those who were lost as I was: http://www.djangopony.com/ My Little Pwny
|
# ¿ Sep 15, 2008 22:50 |
|
MEAT TREAT posted:
You could do: code:
|
# ¿ Nov 24, 2008 18:15 |
|
nbv4 posted:I have a model that has about 80 boolean values. Whats the Right Way to group these fields together? For instance, 12 of those boolean values are column1_hide, column2_hide, etc, which correspond to which columns the user wants to hide somewhere on the site. I'm going to define a function on the model that returns an array of each column the user wants hidden. If the user has column5_hide and column6_hide set as true, I want that function to return ["column5", "column6"]. I want to be able to iterate through all the columns in the model, instead of doing something like: But if you just need some code to help do what you want with what you've got, this does the job: code:
|
# ¿ Dec 16, 2008 07:45 |
|
nbv4 posted:Doesn't that still violate DRY? If you wanted to add an extra column, you'd have to change that 12 to a 13. DRY means "Don't Repeat Yourself" so it doesn't violate DRY but it does violate the "don't put hardcoded constants in code" best practice. And yeah, data model changes requiring code changes isn't that wacky of an idea in the first place. If you're changing your data model, chances are it's going to require a redeployment of the code anyway. If you want to get really hairy and ugly you can introspect the column names and do it that way but really the best option (in my opinion) is to not have a data model like that.
|
# ¿ Dec 16, 2008 20:44 |
|
ashgromnies posted:I am trying to make an application for recipes using Django. I am starting simple and going from the tutorial but not getting the results I want. In a less strict framework I'd be able to represent what I want to easily but I'm having trouble figuring out how to do it the Django way while keeping the database clean and easy to query to prevent performance issues. code:
edit: vvvv well hot drat, those Django guys are pretty smart vvvv No Safe Word fucked around with this message at 22:31 on Dec 25, 2008 |
# ¿ Dec 25, 2008 21:36 |
|
So Adrian and company are working on an updated Django Book, and the work-in-progress is online for everyone to see like last time, yay! http://www.djangobook.com/en/2.0/ (Django Book 2.0 covers Django 1.0 )
|
# ¿ Jan 9, 2009 16:33 |
|
Has anybody had any luck extending the django.contrib.auth User model in their apps? I've been following the instructions on this blog post, but now when I try to login to the admin interface it's failing. (note: this is with Django 1.0.2 final) If I fire up the manage.py shell, and I do: code:
admin app error message posted:Please enter a correct username and password. Note that both fields are case-sensitive. So I did a bit of digging: code:
|
# ¿ Jan 17, 2009 03:52 |
|
Sharktopus posted:
And I could have sworn there was some sort of RequestContext middleware that either shipped with Django at some point or was on their code.djangoproject.com wiki somewhere that did this for every response automatically but I'll be damned if I can't find it. I don't want to reimplement it half-assed if it's already out there, but I can.
|
# ¿ Mar 21, 2009 04:09 |
|
Mashi posted:Does anyone find the django ORM to be slow? I have some pages with minimal ORM usage taking about 30ms, and others that are loading 30 or so models taking 150ms, but the queries only take about 10ms total. This is on the dev server, with mysql running on the same machine. Try the Django Debug Toolbar to see if it's like a middleware or something else that is slowing stuff down.
|
# ¿ Mar 24, 2009 01:49 |
|
zycl0n posted:EDIT: It appears that after a bit more reading, I was beating my head against the wall. Going with mod_wsgi. http://docs.djangoproject.com/en/dev/howto/deployment/ posted:If you’re new to deploying Django and/or Python, we’d recommend you try mod_wsgi first. In most cases it’ll be the easiest, fastest, and most stable deployment choice. mod_python is kind of a pain in the rear end, to be quite honest
|
# ¿ Apr 21, 2009 21:51 |
|
nbv4 posted:Is django-tagging still the best tagging extension? A google search brings up a lot of blogs that would assume it still is, but the latest official version doesn't even support 1.0. Works pretty well for me, and it has a nice tag cloud template tag that it comes with that works well for my needs
|
# ¿ Apr 29, 2009 20:29 |
|
nbv4 posted:hoooooly balls that worked. I had no idea defautl=0 was causing that. Thanks. Well, I bet if you went to the trouble of changing "unknown" and "not hiring" to the "------" entries on each of those drop-downs it would work too. It sees a partially completed entry and assumes you intended to complete it so it's letting you know which fields in those partially completed entries need to be filled in to complete them.
|
# ¿ May 8, 2009 02:47 |
|
Ferg posted:Anal retentive question: what editors support the syntax highlighting for an HTML view with the {% %} tags? I'm using PyDev currently, though I only defaulted to that because I use Eclipse so much at work. I'm open to other editors if Eclipse can't handle that syntax. vim supports the django template syntax
|
# ¿ May 8, 2009 19:06 |
|
Magicmat posted:How is Windows development support for Django, and Python in general? I'm talking about how well the actual interpreter works, as well as support tools like the version control system of choice for the Django community, and especially IDEs and/or editors. This is just for development; deployment would still be on the usual Linux stack. edit: Catching this before the edit: king_kilr posted:Django (as well as Python) is fully supported on Python. No Safe Word fucked around with this message at 05:13 on Jul 6, 2009 |
# ¿ Jul 6, 2009 02:47 |
|
duck monster posted:It works great. I use Eclipse with PyDev and it works fantastic. Ehhh.. IronPython is, which is generally up to date with CPython, but not 100%. For most uses it's up to date. The latest stable release brings it up to full Python 2.5 support but there's a beta that supports 2.6 and I've heard that it's pretty stable as well.
|
# ¿ Jul 7, 2009 06:33 |
|
Hanpan posted:I want to expand on the ImageField functionality of django. Mainly, I want to check the dimensions of the image the user is upload, and resize / crop where appropriate. I would also like to set compression amount, and perhaps even allow for watermarking. I know there are several libraries out there that do this, but I want to keep it as lightweight as possible. http://www.djangosnippets.org/tags/image/
|
# ¿ Aug 20, 2009 22:23 |
|
Pie Colony posted:I have a custom tag {% vote "292" %} or whatever. Basically inside the code for the tag it checks whether the ID (292) meets some criteria. If it does, I want it to render x template, if it doesn't, I want it to render y. render_to_response returns an HttpResponse, if I recall correctly, custom template tags should just return a string. If you want it to basically load a template and render that then you'll have to create a Template with that path and call .render() and return that. Something like: code:
No Safe Word fucked around with this message at 20:08 on Sep 23, 2009 |
# ¿ Sep 23, 2009 20:05 |
|
Stabby McDamage posted:Also, is there a Django app repository or index? I didn't see one in the OP, and this site basically says "search google code, some random forum, or use something these guys wrote". Perl has CPAN and Python as PyPI, but is there a central repository for Django apps? Maybe PyPI is the answer? Normally I would recommend Django Pluggables but it seems to be down at the moment!
|
# ¿ Nov 2, 2009 04:12 |
|
|
# ¿ Apr 28, 2024 14:41 |
|
Yup, can't use column aliases from the SELECT portion in the WHERE clause. http://old.nabble.com/Column-alias-in-where-clause--td18967124.html
|
# ¿ Nov 10, 2009 02:56 |