News for hackers. Stuff that matters.
Re:Back in the Django saddle by LeafStorm on Monday November 28, 2011 @09:44PM (#3288737)
One thing that I think the Django core team needs to work on is documenting best practices. And I know that there are a bunch of different huge companies who build things in Django and all have different standards for how to develop and deploy, but just running

    $ django-admin.py startproject PROJECT
    $ cd PROJECT
    $ python manage.py startapp
is simply not cutting it.
Re:Back in the Django saddle by mazzer on Tuesday November 29, 2011 @01:52AM (#3289413)
I've always thought there has been dissonance between the remarkable amount of "this is how we did it at the paper" baked into the code and the libertarian "you should do what works for you" in the docs.

(What worked at the paper has always worked well for me, of course, but I've never been too adventurous about straying.)

Re:Back in the Django saddle by oinopion on Tuesday November 29, 2011 @07:32AM (#3290051)
Why? Django (trunk) has new files layout.

    $ django-admin.py startproject testo 
    $ cd testo
    $ ./manage.py startapp testapp

    $ tree                                                                                                    
    .
    ├── manage.py
    ├── testapp
    │   ├── __init__.py
    │   ├── models.py
    │   ├── tests.py
    │   └── views.py
    └── testo
        ├── __init__.py
        ├── settings.py
        ├── urls.py
        └── wsgi.py
Re:Back in the Django saddle by LeafStorm on Tuesday November 29, 2011 @11:51AM (#3291028)
...You know, this actually makes a heck of a lot more sense. Hopefully they'll follow it up with some more docs on how you can develop with virtualenv and the like.
Re:Back in the Django saddle by philipkimmey on Monday November 28, 2011 @10:29PM (#3288889)
I totally agree - having no standards around common problems (like how to deal with tests once they get too big for a single tests.py) is extremely inconvenient.
Re:Back in the Django saddle by bad_user on Tuesday November 29, 2011 @02:41AM (#3289513)
That's because Django, while monolithic, is in many ways based on pythonic principles.

In Ruby, for instance, you really need conventions as in Ruby the concept of packages and how they get included / used is a lot more relaxed.

In Python tests.py is a package as far as Python is concerned. If it gets too big you can make it a directory and break its contents in several sub-packages. I did this with everything else too, like views.py or models.py

The one concept Django has that I consider a flaw is in fact non-pythonic - apps. That's because apps are not just simple packages. Instead apps are packages that have to be specified in an INSTALLED_APPS constant in a top-level "settings" package. This makes using parts of Django in scripts a PITA, as your script needs an accompanying settings file. Also, apps are not properly defined either and in some instances an app must have a "models" subpackage (or at least this used to be the case).

Re:Back in the Django saddle by nicpottier on Tuesday November 29, 2011 @01:38AM (#3289373)
I thought the general solution to this was just to create a /tests directory and stuff everything in there, broken out as you wish?

Did I just make that up?

Re:Back in the Django saddle by 2mur on Tuesday November 29, 2011 @07:30AM (#3290046)
No that's basically how everyone does it. Same thing for models, views, etc. It's all python.
Re:Back in the Django saddle by mkramlich on Tuesday November 29, 2011 @05:51AM (#3289849)
You could ask for a refund. :) Otherwise you just might have to figure out how to do it yourself. That is how the world works fundamentally. You're actually lucky you're getting Django for free, providing so much functionality out-of-the-box. TANSTAAFL.