Re: Weird date math bug?

2017-09-03 Thread Lachlan Musicman
On 1 September 2017 at 16:13, Melvyn Sopacua wrote: > A few tips on your code: > > def get_latest_chemo(self): > chemo = ChemoRegime.objects.filter(pat > ient=self).latest('stop_date') > > class ChemoRegime(models.Model): > patient =

Re: from django.utils.six.moves import range, ImportError: cannot import name 'range'

2017-09-03 Thread Derek Zeng
it's the same in either versions of python. the output was captured when i was just debugging it in 3.5. On Sun, Sep 3, 2017 at 2:55 PM, James Schneider wrote: > > > File >

Re: from django.utils.six.moves import range, ImportError: cannot import name 'range'

2017-09-03 Thread James Schneider
File "/Users/coderek/Documents/projects/py3.5/lib/python3.5/site-packages/django/contrib/staticfiles/storage.py", line 21, in from django.utils.six.moves import range ImportError: cannot import name 'range' Are you sure you're using 3.6.2? Do you have another virtualenv with 3.5 and no

Re: Django Gunicorn Import Error: no module name wsgi

2017-09-03 Thread M Hashmi
Try: gunicorn --bind ip:port wsgi:application Make sure you run it from the directory where manage.py is located. Regards, M On Sun, Sep 3, 2017 at 9:04 AM, Jonathan Cheng wrote: > I use Python3.5.2 Django1.9 > > I use `python -m venv venv/weather_station` to create

Django Gunicorn Import Error: no module name wsgi

2017-09-03 Thread Jonathan Cheng
I use Python3.5.2 Django1.9 I use `python -m venv venv/weather_station` to create virtual evnironment (/home/user/venv) This is my project tree in Ubuntu /home/user/myproject: (`export project=/home/user/myproject`) myproject | ├── gunicorn.conf.py ├── static │ ├── admin

Re: from django.utils.six.moves import range, ImportError: cannot import name 'range'

2017-09-03 Thread Derek Zeng
It is a project I developed in ubuntu and currently running on a ubuntu server. I just bought a new mac mini, so I would like to develop on mac. I have isolated the problem to the django version. When I use django==1.10.7, this does not happen. When I use django==1.11a1 this happens. This is

Re: Testing file upload via a form?

2017-09-03 Thread Melvyn Sopacua
It certainly isn't trivial. First and foremost, write fat models and Managers, but lean views. Rather then putting complex queries in views, I have a strong bias to writing manager methods (or QuerySet methods, if I feel it's reusable in more then one Manager - see Manager.from_queryset [1]).

Re: Testing file upload via a form?

2017-09-03 Thread Derek
I have been looking for a decent guide that covers testing in a solid, thorough way - there are lots of fragmented pieces that cover bits-and-pieces of what is needed for tests but not all the cases with a start-to-end comprehensive approach for everything ("Obey the Testing Goat" comes closest).

Re: Testing file upload via a form?

2017-09-03 Thread James Schneider
On Sep 1, 2017 3:00 PM, "Derek" wrote: Thanks Melvyn I already have tests for the processing of data when it has been uploaded - which is actually the critical issue for the application. The "view" is just really a thin wrapper around the two steps : form display & upload