Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Git
Aug 21, 2004

That's one hell of an OP. I'll kick off the stupid questions:

I've been coding small Django apps mostly for personal use for a while now and it's awesome. However, I don't think I've ever had cause to use anything other than render_to_response from django.shortcuts. Am I an idiot for using it exclusively? If so, what should I be doing instead?

Adbot
ADBOT LOVES YOU

Git
Aug 21, 2004

Sounds like you guys need to play with Apache's MaxRequestsPerChild option. I'm pretty sure the Django docs recommend giving it a value of 1 for development so code changes are reflected instantly.

Git
Aug 21, 2004

FrontLine posted:

I haven't tested this yet but I'll trust that it works... although to be honest it looks weird. In any case if no one posts a better solution I'll run with it.

Another solution is to just set the DJANGO_SETTINGS_MODULE environment variable outside of your script before running it.

Alternatively, you can set it temporarily just for your script by executing your program from the command line with the command
code:
DJANGO_SETTINGS_MODULE=myproject.settings python createobject.py

Git
Aug 21, 2004

Mashi posted:

{# this is where I want login.html included #}

Sounds like you want to {% include login.html %}

Git
Aug 21, 2004

Magicmat posted:

So the answer is that Django development is no better on Windows than Rails?

Django development is fine on Windows. I didn't encounter any problems or notice any quirks or anything from doing so during my albeit brief usage of Windows for development. I did get annoyed enough by general Windows stuff to offload my code to a Linux server and edit it remotely, though that's a reflection on my OS preferences rather than any sort of sleight against Python or Django.

As for IDEs, it seems like most developers I know use Eclipse with PyDev, and the rest seem to use Wing or Komodo. Personally, I prefer just using a text editor, specifically TextMate on OS X, gedit on Linux, and Notepad++ on the rare occasions I use Windows.

Adbot
ADBOT LOVES YOU

Git
Aug 21, 2004

This is a pretty cool IBM developerWorks article on writing better Django models, with a mind to improving query performance and with the use of model managers.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply