Re: setup.py for Django project?

2017-09-07 Thread Ben Lopatin
I've seen this on a few projects before and each time transitioned the project away from it. As you note, for whatever advantages it seems like there may be, it's very much atypical and also unnecessary. I don't see how it makes writing Fabric tasks significantly easier (presumably you don't ne

Re: sub accounts in django

2016-05-19 Thread Ben Lopatin
This is the scenario I wrote django-organizations to handle (http://django-organizations.readthedocs.io/en/latest/). On Wednesday, May 18, 2016 at 12:04:02 PM UTC-4, Mehdy M. Haghy wrote: > > Creating sub accounts is a pretty common scenario. > you have clients like (copmany1, company2, ..., comp

Re: What is the purpose of the include function?

2014-10-29 Thread Ben Lopatin
Hi Daniel, in this case I would think the latter would fail - the `include` function loads a URL conf module and then finds the `urlpatterns` attribute, whereas `admin.site.urls` is a class method that dynamically builds a list of URL patterns based on your installed apps. There's nothing to im

Re: Restricting file access to users who uploaded the file.

2014-10-21 Thread Ben Lopatin
What you want to do is first restrict access to the model instance to which the file is associated. Presumably this model has a foreign key to your User model which you'd associate with the uploading user. Then your view will return some non-200 response, like a 401 response if the requesting u

Re: Multiple django web applications

2013-09-27 Thread Ben Lopatin
drakko, using virtualenv will certainly help in isolating your projects and dependencies. You can host both on the same server, how you go about doing this will depend in part on your setup. If you're using Apache with mod_wsgi I think - if memory serves correctly - that you could just use diff