Re: virtualenv with dev server

2011-07-14 Thread Carles Barrobés
Try running > python Scripts\django-admin.py runserver On windows, the .py extension will be registered with your defaut installation of python and that's the one it's using if you call the script directly Carles On 14 Jul, 09:54, Mike Dewhirst wrote: > Trying to get virtualenv working for th

Re: templating best practices in django

2011-01-09 Thread Carles Barrobés
In terms of best practices for Django templates, I recommend that you try to use template inheritance extensively, in similar ways as when you would use subclassing: - Create a base.html template with everything that appears in all your pages (common header and footer, generic html headers...). -

Re: Model Inheritance.

2010-10-28 Thread Carles Barrobés
Your "place" object will contain an attribute called "restaurant" to access the object as an instance of the subclass. If this place object is an instance of another place subclass, accessing the restaurant attribute will raise a DoesNotExist error. Carles. On 28 Oct, 01:39, Tom Eastman wrote:

Re: Configuring URLs for different views

2010-10-02 Thread Carles Barrobés
I sometimes use the direct_to_template generic view for a different purpose than yours (test a template), but the same URL pattern might be useful to you: # test a template (r'^direct/(?P.*)$', 'django.views.generic.simple.direct_to_template'), Although you'd better use a better regex to

Re: Separating application media from project media

2010-09-30 Thread Carles Barrobés
If the ideal solution for you is different sites, one authentication, I found a reference in... http://stackoverflow.com/questions/556907/how-to-get-distinct-django-apps-on-same-subdomain-to-share-session-cookie ...pointing to a "django-cas" application that is meant for that purpose (Single Sign-

Re: Why Django Apps Suck

2010-09-29 Thread Carles Barrobés
> Given this control flow let's try to do some of the typical > modifications mentioned above: > Authorization: > Django has a beautiful mechanism for authorization, which is using > decorators (@may_do_a_b_or_c) directly in the views.py. > Tempting, but will not be modifyable in any way once you l

Re: Separating application media from project media

2010-09-29 Thread Carles Barrobés
At some point I also thought this was a good idea. This way I can reuse the app and all its visual stuff as well. But the problem is that for most cases you will want your templates and media to be consistent with a site's design and look&feel. This means that for two projects (sites) re-using the