Re: Django on production

2020-02-07 Thread Ira Abbott
Let me have a look… Sent from my Apple Watch > On Feb 7, 2020, at 12:37 AM, Perceval Maturure wrote: > > Dear Django Masters > > I have deployed my project on pythonanywhere with Django on python 3.7I have > one app with two templates , the other is displaying data whilst the other > isn’t.

Re: tasks queues - why a broker and not the DB?

2019-01-15 Thread Ira Abbott
I went with celery/rabbitmq behind a load balancer running on the same image as my server. I haven’t done any corner case testing, but so far it seems to scale up and down well after some tweaking on thresholds. Doing this, rules out some of the smallest instances, as more memory is needed for

Re: how can I work with multi model forms

2018-12-27 Thread Ira Abbott
Hi, Model forms have one model. To have the form update fields in other models, you can overload form_valid in views so that it writes the addition form field to their respective models. Ira Sent from my iPhone > On Dec 26, 2018, at 9:45 AM, Nur Mohsin wrote: > > Hi, in views.py form.save(

Re: Can I define classes in Django settings, and how can I override such settings in tests?

2018-12-27 Thread Ira Abbott
You need an instance to evaluate member variables. These are mutable, so can be different per instance. Settings should use a dictionary. Sent from my iPhone > On Dec 27, 2018, at 3:15 AM, אורי wrote: > > Hi, > > We are using Django for Speedy Net and Speedy Match (currently Django > 1.11

Re: How to send parameters to templates and adjust the page url by path?

2018-12-12 Thread Ira Abbott
hi, This is not much to go on: The 'parameters' are called 'context' You can read: https://docs.djangoproject.com/en/2.1/ref/templates/api/ to learn about templates and context. adding context in a view is done by adding context to a view as follows: def get_context_data(self, *args, *

Re: How to transfer django projects from one pc to another

2018-12-12 Thread Ira Abbott
If DB is local postgres, or mysql, export data on old machine and import on the other after migration. This may takes some experimentation to get keys importing properly. If external and managed (say RDS), then migrations are not needed - the DB is already there and populated. The above expor

Re: How to transfer django projects from one pc to another

2018-12-12 Thread Ira Abbott
This works for sqlite. postgre, etc. you have to do as above. On Monday, December 10, 2018 at 8:03:10 PM UTC-5, Simon A wrote: > > if you are really lazy, you can just zip your whole project. then transfer > to another machine. > > I transfer my projects from work (using windows) to home (using

Re: Need help with db save.

2018-12-12 Thread Ira Abbott
Hi, Profile(newuser.pk,customerid=form1.cleaned_data['customer']) should be: Profile(user_id=newuser.pk,customerid=form1.cleaned_data['customer']) user is a ForeignKey, so you assign user= after performing a get(), or you use the form above with your pk - i.e. 'the user record whose id field

SITE_ID or no SITE_ID, that is the question.

2018-12-12 Thread Ira Abbott
Whether tis nobler to run separate processes or to handle all in one ... Unfortunately, I want to use packages that work both ways, and have not found a suitable workaround other than picking one style, whacking it up to make it play nice and dumping the whole thing in my app directory. Depend