|
I was having a lot of trouble getting Django running on windows until I found this guide which sped things up. The official guide just wasn't saying how to do this installation on windows very well. I am a product of Rails and have been running through a few tutorials here. I am new to this so I'll be back with a few questions later on once I've finished exploring a little more. Impressed with some of the things it does and unimpressed with the difficulty involved in doing them. Perhaps I don't understand the purpose in Django's complexity yet but maybe some alias' are in order, those are just my first impressions. Nolgthorn fucked around with this message at 20:11 on Mar 6, 2008 |
# ¿ Mar 6, 2008 20:08 |
|
|
# ¿ Apr 29, 2024 17:53 |
|
Is there any reason to put your template files outside of the project directory? Specs seem to encourage this, but they also mention that each app of your project is checked for a templates folder just in case. I am for some reason having trouble using generic views with app/templates folders. My project seems to be looking at app/templates/app/template.html, where the second /app shouldn't be there. OP, the admin interface is cool and all but it reminds me of scaffolding in Rails. It's nothing nearly as fascinating as Django's generic views, the automatically generated authentication and permissions system or Django's development web server never needing to be restarted. It's awesome
|
# ¿ Mar 7, 2008 15:42 |
|
Yes, I have. I was curious as to when you would want to use the app/templates folder instead of using the one referenced in settings... Also I was just bringing it up for discussion how generic views don't seem to support the app/templates folders, only the settings referenced ones. The other really cool feature about Django, does it actually go through to figure out exactly what data will be needed then gets it all at once? I don't have to explicitly tell the application ahead of time what all will be needed? I just want to check with you guys to see if that's true, it seems too good.
|
# ¿ Mar 7, 2008 16:02 |
|
Bonus posted:So if you have In your example would Django not look ahead and see that you wanted 'all_results', therefore only have to hit the database once to get it and return the value of 'result' from that? What if you have code:
Edit: Wait, I think I'm getting it, the reason is that 'my_results' is a model object. As soon as that model is dumped into another variable then the model object needs to contain data. So, it's not as if Django looks ahead to find out what all you are going to be using entirely before hitting the DB. Nolgthorn fucked around with this message at 16:58 on Mar 7, 2008 |
# ¿ Mar 7, 2008 16:50 |
|
My psychic nerd head exploder beams are in full effect!
|
# ¿ Mar 7, 2008 17:00 |
|
I am trying to extend the User model and implement django-profiles so that my users can CRUD their own accounts at will. Update: I found the error was in AUTH_PROFILE_MODULE, I was referencing my project instead of the application that has UserProfile defined in it. Edit: nevermind Nolgthorn fucked around with this message at 17:40 on Mar 8, 2008 |
# ¿ Mar 8, 2008 16:02 |
|
Is there a good way of creating "HTML helpers", in the way that Rails does it, so that I could type {% paginnnnnnnnnnnator %} and have that just read from another template? Do I just need to include it on the page then and what does the code look like to do that? What if I'm calling it multiple times in the same page, is there a way to do it properly with a minimal of code and duplication? Can I pass arguments?
|
# ¿ Mar 11, 2008 09:19 |
|
What are you going to do in order to ensure that two of the same slugs aren't generated on the same day?
|
# ¿ Mar 13, 2008 04:52 |
|
Learning to use Django is hard, can you recommend me a book to read apart from 'The Django Book'?
|
# ¿ Apr 26, 2008 14:08 |
|
Upon further reading, it seems the documentation (which I was reading before) when coupled with 'The Django Book' make for a good amount of well written documentation. I think I'm starting to understand what's going on. The confusion came from how different the scope is here, Rails really does tie you down and make things difficult in a lot of respects. Django only loads what it is using on each page? Rails doesn't require you to load/initialize/import anything at all, I suspect that makes each Rails app somewhat resource intensive in comparison. I see other benefits to the way Django is doing it, I'm just surprised. That amount of control and manual 'work' is unheard of in the Rails community.
|
# ¿ Apr 28, 2008 11:42 |
|
Most notably chapters 8 and 9 of the Django Book are being really helpful, these are answering a lot of questions I had which were slowing down my learning process. Things like "Why are some of these in quotes and others not?" or "Why do some methods need to be explicitly imported and others are just magically working, how does it do that?" I generally had this feeling like I needed an instructor or a book to explain what I wasn't getting. I am loving this now, those new to this should be sure and read those chapters. Hah! I'm building my personal project in Django. It's going to be a content driven comedy web site updated and moderated by it's users, move over sa. Hahahaha!
|
# ¿ Apr 28, 2008 14:25 |
|
I've made one or two custom template filters which I would like to use on every or almost every single page of the web site. I have a utils application, in it I've created a templatetags folder and added my_filters.py in there. How can I have access to the methods in my_filters without loading it from every template? That would be easier. Currently, I always have to put {% load my_filters %} to the top of each one.
|
# ¿ May 17, 2008 10:48 |
|
bitprophet posted:http://www.djangosnippets.org/snippets/160/ Cool, in order to get it to work I had to use something like this but it works. code:
I would be concerned, that if importing does use up resources, then more resources are being used than necessary. Thoughts?
|
# ¿ May 18, 2008 03:09 |
|
Honestly REST has no place in Django, it is by far the worst feature ever added to Rails... what is the point of it, it's huge, it's obtrusive to coding anything, it offers negligible benefit to users. In fact it's worse for users if it is implemented incorrectly as it was initially with Rails, with the funky semicolons in the URL. Is there any reason at all that we would need REST in Django? I understand you don't have to use REST in Rails but when you don't, you cannot use a lot of the new or upcoming features. It's like development in RESTless rails just stopped dead after the idea popped up and it's unnecessary.
|
# ¿ May 24, 2008 01:33 |
|
I am hoping I can find some help, currently I am trying to build a page which will create a new object, save it to the database and redirect me to the new object. The object being created spans over two tables, this is the first time I've done this so I want to be sure I'm doing it correctly before I continue doing it wrong for the rest of the project. The object is named Conversation and it is basically a thread topic with first post. CommentContainer is the post, Comment is going to contain previous edits but I'm not concerned about it too much right now. EDIT: I've updated my code into working status. urls.py code:
code:
code:
code:
It seems I was being a little bit greedy and that Generic views don't really do what I wanted, in that the view needed to save two models at once. If I could get it any shorter at all that would be great, In Rails I can fit it into about 5 or 10 lines of code which is why it feels like I'm not doing this right. If I refresh the page after I've posted Firefox asks me if I want to resend the data, I don't want it to give me the opportunity to do this. Nolgthorn fucked around with this message at 11:52 on May 27, 2008 |
# ¿ May 25, 2008 23:38 |
|
No Safe Word posted: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. But this other book says I could most assuredly learn Django in 24 hours. So what's James Bennett going to do about that?
|
# ¿ May 29, 2008 05:16 |
|
|
# ¿ Apr 29, 2024 17:53 |
|
Neato, is a developers library more or less what you find on the Django web site? I'm curious.
|
# ¿ May 29, 2008 18:12 |