Back in the Django saddle
holovaty.com
holovaty.com
the move surprised me a bit, AFAIR when this topic (moving to a DVCS) was raised on DjangoCons, Russel explained that's not a priority (correct me if my memory fails).
forgot to link the hn post in comments on your blog, glad you came here so fast. cheerz
For a lot of people in the Python world, choosing a DVCS just means picking what CPython picked (hg). At the time, that decision was at least partly due to the fact that git had poor Windows support, and less about the languages involved (GitHub/Ruby weren't a factor anyway since it would be a self-hosted git install).
If the decision was to be made again today, most people I've talked to think git would be the choice.
Is this no longer the case in some way?
It's not like SHA1 is tantamount to leaving the barn door open, but it doesn't sit well with me to stick with it, until it is replaced natively.
[1]: http://comments.gmane.org/gmane.comp.python.django.devel/332...
At least on Linux, I installed it and had no issue whatsoever.
$ django-admin.py startproject PROJECT
$ cd PROJECT
$ python manage.py startapp
is simply not cutting it.Did I just make that up?
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).
(What worked at the paper has always worked well for me, of course, but I've never been too adventurous about straying.)
$ 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.pySuch as?
Any advice?
For testing a basic website, you'll probably want to test any custom managers or model methods, and your views. A good guide to getting started is here: http://toastdriven.com/blog/2011/apr/10/guide-to-testing-in-...
For full-stack tests, you can use something like Splinter (http://splinter.cobrateam.info/).
I suspect most people (that is, developers who use the framework but don't necessarily contribute to it) probably couldn't tell that a BDFL has basically been MIA - it doesn't feel like development's stopped altogether (although again, yes, it can obviously be sped up, everyone's got their own pet features, etc.)
In my real word scenarios I'm often faced with requirements of vastly different scale and highly variable deadlines. I also have to consider the likelihood of the code being added to in the future - potentially by someone else on my team who is less experienced by me. All these things taken together - and more - constitute what I am calling a "problem".
My Django apps all run to thousands of lines of code and are well documented and thoroughly tested. It's fairly routine for the lifecycle of these apps to stretch over years, with an ongoing requirement for maintenance and new features. If I need to create a social network for my company which ties into their existing information sources, then Django is where I start.
On the other hand, my Flask apps tend to run to the small hundreds of lines of code. They're usually hacked together quickly for a very specific use case and there's very little in the way of documentation. They might not even work correctly except in fairly limited circumstances (e.g. no time to write form validation code) and might get thrown away after being used a small number of times. If I need to create a tool to allow users to purge parts of our Varnish cache then Flask is where I start.
Perhaps not everybody uses the two frameworks in quite the same way, but I find that they complement each other well.
People use Sinatra AND Rails (the Ruby equivalents to Django/Flask) in the same project all the time.
GitHub for example uses Rails for the major functionality and Sinatra for REST apis and such.
And while I like Bottle and Flask, their aim is widely different from Django's.