'function' object has no attribute 'rindex'

2006-12-26 Thread Mike Tuller
I seem to have everything installed correctly, and the python paths seem to be correct. I am going through the tutorial in the online book, and I run into a problem. When I run the first application http://127.0.0.1/now/ I get the following error: 'function' object has no attribute 'rindex' My u

Re: 'function' object has no attribute 'rindex'

2006-12-26 Thread Mike Tuller
I downloaded the 0.95 version. I don't think it was the development version. Is that what I should be using? On 12/26/06, Adrian Holovaty <[EMAIL PROTECTED]> wrote: On 12/26/06, Mike Tuller <[EMAIL PROTECTED]> wrote: > I seem to have everything installed correctly, and t

Re: 'function' object has no attribute 'rindex'

2006-12-26 Thread Mike Tuller
I printed the book out, so what I have doesn't have the comments. I will download the development version and see what happens. Thanks for the help. On 12/26/06, Don Arbow <[EMAIL PROTECTED]> wrote: On Dec 26, 2006, at 7:46 PM, Adrian Holovaty wrote: > > On 12/26/06, Don Arbow <[EMAIL PROTECTE

name 'current_datetime' is not defined

2007-02-03 Thread Mike Spradling
I'm baffled. I'm just getting started with django and am reading the 'Django Book'. In chapter 3 I'm told, - Make a file called views.py that contains: from django.http import HttpResponse import datetime def current_datetime(request): now = datetime.datetime.now() html = "It

Re: name 'current_datetime' is not defined

2007-02-03 Thread Mike Spradling
I figured it out, I left off from mysite.views import current_datetime On Feb 3, 8:50 am, "gordyt" <[EMAIL PROTECTED]> wrote: > Howdy Mike, > > > def current_datetime(request): > > now = datetime.datetime.now() > > html =

Q Object Oddity

2007-02-03 Thread Mike Axiak
Hey, I'm using Django release (currently 0.95.0, waiting for etch to move to 0.95.1) with some patches (lazyuser patch comes to mind) on an internal development. The question is, I was trying to do some Q object combinations and was met with some weird results: y = Q(satprepreginfo__program = p

Re: Q Object Oddity

2007-02-03 Thread Mike Axiak
incorrectly? -Mike SELECT COUNT(DISTINCT("auth_user"."id")) FROM "auth_user" INNER JOIN "program_registrationprofile" AS "auth_user__registrationprofile" ON "auth_user"."id" = "auth_user__registrationprofile"."

Re: Q Object Oddity

2007-02-03 Thread Mike Axiak
ed this and used two inner joins, which IMHO is an incorrect interpretation. -Mike On Feb 3, 8:15 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hi, > > On 4 Lut, 00:46, "Mike Axiak" <[EMAIL PROTECTED]> wrote: > > > y = Q(satprepreginfo_

passing arguments to the login_required decorator

2007-02-07 Thread Mike H
n a syntax or name error. The only solution I have working is to write my own decorator that calls the decorator in contrib.auth but that seems messy. How can I pass in the user to authenitcate and the login url arguments to the decorator directly? Tha

Authenticate during middleware call

2007-02-10 Thread Mike H
plains about no "backend" attribute. Has anyone got a better solution to this? Many thanks. Mike --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send ema

Re: Authenticate during middleware call

2007-02-11 Thread Mike H
Hi all, I figured out the problem I was having, the example in the documentation I followed for doing the authentication backend didn't have the first 'self' argument, so the authentication was never triggered. Mike On 2/10/2007, "Mike H" <[EMAIL PROTECTED]&g

Existing database into django models?

2006-06-19 Thread Mike Crowe
al ones will be ready when we are. However, here's my question: The existing DB is very well laid out. Is there a way to convert that DB Schema into django models? Doesn't have to be purely automatic, but any tool which would help this migration would

Way to validate database inserts/updates not associated with forms?

2006-03-07 Thread Mike B
n someone point me in the right direction? Thanks, Mike --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To un

Re: Way to validate database inserts/updates not associated with forms?

2006-03-07 Thread Mike B
You can still create a Manipulator object to validate your data. Thanks, and I may be clueless here, but it seems as if manipulators don't work within the iterator context.  If I am using an interator to iterate over records that I want to modify and then update using save(), how do I add in a mani

Can I pass a python iterator to a template?

2006-03-09 Thread Mike Kent
nd fill in the data values. When I actually try this, I get a traceback ending with: /home/mike/Work/projects/django/trunk/django/core/template/defaulttags.py in render 83. context.push() 84. try: 85. values = self.sequence.resolve(context) 86. except VariableDoesNotExist: 87. values

How to enter all model-related data on one form?

2006-03-12 Thread Mike Kent
I want to create a form for entering data and all of its related data, on one form. Here's a simplified model to illustrate: class Author(meta.Model): name = meta.CharField(maxlength=40) class Book(meta.Model): title = meta.CharField(maxlength=40) authors = meta.ManyToManyField(Auth

Re: How to enter all model-related data on one form?

2006-03-13 Thread Mike Kent
Thanks for the reply, Adrian. Yep, I have already got the admin interface to my model enabled, that's how I got my initial data into the database. However, for the end-user interface, I wanted to go with a different look. I probably worded what I wanted badly: the key concept is that, for a Bo

RE: django admin

2021-10-10 Thread Mike Dewhirst
Try manage.py collectstatic--(Unsigned mail from my phone) Original message From: Baraka Nzavi Date: 11/10/21 07:32 (GMT+10:00) To: Django users Subject: django admin hello guys...what leads to the admin interface misbehaving in that the styling does not show -- You rece

RE: Permissions Model Inefficiency Killing DB

2021-11-24 Thread Mike Dewhirst
Do you think this is a consequence of permission complexity?I have instinctively avoided individual permissions for purely management reasons and stuck to user membership of auth groups (roles) and given permissions exclusively to groups.That postpones lookups to when they are needed.I can't im

RE: Models

2022-01-21 Thread Mike Dewhirst
Not safely. You would need to script everything behind the scenes - including migration.A safer approach might be to use a generic table which contains the necessary meta information (char, int etc) as data alongside the actual data in each row. I would also consider booking sessions with a psyc

Django docs failing with search docs - certificate has expired

2022-02-02 Thread Mike Dewhirst
Error 503 certificate has expired certificate has expired Guru Mediation: Details: cache-syd10147-SYD 1643862123 79021947 Varnish cache server -- Signed email is an absolute defence against phishing. This email

Django docs failing

2022-02-02 Thread Mike Dewhirst
The following error occurs when searching the docs for a term. It looks like the content delivery network node in Sydney Australia has had a certificate renewal glitch. Error 503 certificate has expired certificate has expired Guru Mediation: Details: cache-syd10147-SYD 1643862123 79021947

FIXED [Was: Django docs failing]

2022-02-02 Thread Mike Dewhirst
The internet seems to be self healing! On 3/02/2022 3:47 pm, Mike Dewhirst wrote: The following error occurs when searching the docs for a term. It looks like the content delivery network node in Sydney Australia has had a certificate renewal glitch. Error 503 certificate has expired

Off topic slightly - Apache https redirect

2022-02-06 Thread Mike Dewhirst
There seems to be a multitude of ways to redirect from http to https.Letsencrypt rewrote my conf for port 80 traffic to https but when a customer used http://mysite.com it brought up the Apache "this is working" page.Any pointers to the absolutely correct way?ThanksMike--(Unsigned mail from my

Re: Off topic slightly - Apache https redirect

2022-02-07 Thread Mike Dewhirst
: Re: Off topic slightly - Apache https redirect On Sunday, February 6, 2022 at 9:12:38 PM UTC-5 Mike Dewhirst wrote:There seems to be a multitude of ways to redirect from http to https.Any pointers to the absolutely correct way?How about something like this?   ServerName example.com  ServerAlias

Re: collectstatic files chown'ed by root

2022-02-14 Thread Mike Dewhirst
On 14/02/2022 10:14 pm, 'Tim' via Django users wrote: Hi all, I'm deploying Django 4 via docker-compose. For security reasons, the Dockerfile creates a non-root user before running the entrypoint.sh script (which does migrations, collectstatic and starts the server with gunicorn). All app file

Re: The SECRET_KEY setting must not be empty - os.environ.get('SECRET_KEY')

2022-03-01 Thread Mike Dewhirst
pment etc. I keep those credentials in separate files in a standard location on every server. That is only suitable for servers I control. Cheers Mike Thank you! -- You received this message because you are subscribed to the Google Groups "Django users" g

Re: How Important Is Writing Unit Tests For Django Applications?

2022-03-12 Thread Mike Dewhirst
d the unit tests the easier it is to refactor your view code. 3.    Do you use Coverage? You will see all the Django code is tested. Only your own code to test I do integration testing at a high level as well as down low. Really does wonders for refactoring confidence. YMMV Mike -- You rec

Tweak admin 'Action' to avoid Cannot call delete() after .distinct()

2022-03-20 Thread Mike Dewhirst
I am using tweaked querysets to populate the Admin and fully understand why this error occurs. I am using Actions to perform bulk operations on selected records so I do need the Action selector widget. How can I remove the 'Delete selected...' option? Thanks Mike TypeError

TypeError: Cannot call delete() after .distinct() in the Admin

2022-04-07 Thread Mike Dewhirst
How can I remove the 'Delete' option from Django Admin actions? Many thanks Mike -- Signed email is an absolute defence against phishing. This email has been signed with my private key. If you import my public key you can automatically decrypt my signature and be sure it came from me

Re: TypeError: Cannot call delete() after .distinct() in the Admin

2022-04-07 Thread Mike Dewhirst
Sorry - just found it in the docs M On 7/04/2022 5:05 pm, Mike Dewhirst wrote: How can I remove the 'Delete' option from Django Admin actions? Many thanks Mike -- Signed email is an absolute defence against phishing. This email has been signed with my private key. If you import

RE: Calculated Fields

2022-04-10 Thread Mike Dewhirst
--(Unsigned mail from my phone) Original message From: tech george Date: 11/4/22 03:50 (GMT+10:00) To: django-users@googlegroups.com Subject: Calculated Fields Hello,I am trying to calculate fields directly from a model but no luck. I want to get total_price from quantity, re

Re: Calculated Fields

2022-04-10 Thread Mike Dewhirst
On 11/04/2022 2:48 pm, tech george wrote: Hello Mike, Unfortunately it's not calculating the fields as I wanted, instead it's calculating as below; reorder_level * unit_price + quantity Try using brackets like this ... self.total_price = (self.reorder_level + sel

Possible Django Admin or auth bug or Mozilla bug

2022-04-13 Thread Mike Dewhirst
to get things wrong. Has anyone seen this? Thanks Mike -- Signed email is an absolute defence against phishing. This email has been signed with my private key. If you import my public key you can automatically decrypt my signature and be sure it came from me. Just ask and I'll send it t

Re: Possible Django Admin or auth bug or Mozilla bug

2022-04-13 Thread Mike Dewhirst
nction () { this.reset(); }); ... but this looks a bit like a sledgehammer. What might that do to other browsers? I guess I'll give that a try and see what happens. Cheers Mike On 13/04/2022 11:19 pm, Antonis Christofides wrote: It happens here as well as far as I can see (tested on a Debi

Re: Possible Django Admin or auth bug or Mozilla bug

2022-04-13 Thread Mike Dewhirst
On 14/04/2022 11:36 am, Mike Dewhirst wrote: Thanks Antonis OK - the problem has two workarounds. One is to use Chrome. Two is https://code.djangoproject.com/ticket/33386 which suggests including some javascript to disable Firefox autocomplete ... $('form').attr('autocomplet

Re: Possible Django Admin or auth bug or Mozilla bug

2022-04-14 Thread Mike Dewhirst
are trying to accomplish (except if extrastyle comes earlier than extrajs). On 14/04/2022 06.37, Mike Dewhirst wrote: On 14/04/2022 11:36 am, Mike Dewhirst wrote: Thanks Antonis OK - the

Re: Python Question re Executing a Script (Mike)

2022-05-01 Thread Mike Dewhirst
On 2/05/2022 10:31 am, Brent Hunter wrote: Hello Mike, Thanks for your reply.  My apologies, I should have provided more background information. I was recently running a Windows 10 machine and I believe it was running Python 3.8.  All I did was create a batch file titled Start-AIG.bat

Re: Using External HTML files in Django

2022-05-02 Thread Mike Dewhirst
On 3/05/2022 8:44 am, Hazho Human wrote: Why not serving that specific URL with Nginx or Apache? On Tue, 3 May 2022 at 03:15, Santhosh sridhar wrote: Hi, I have few html files which are not part of my django project templates directory. I want to render these html files as a

Bug using Admin with Stripe - but whose is it?

2022-05-06 Thread Mike Dewhirst
calhost:8088/admin/chemical/chemical/20/change/payment/change/ Django Version: 3.2.13 Exception Type: ValueError Exception Value: Field 'id' expected a number but got '20/change/payment'. Exception Location: D:\Users\mike\envs\xxai\lib\site-packages\dja

Re: Bug using Admin with Stripe - but whose is it?

2022-05-06 Thread Mike Dewhirst
OK - don't worry about this for the time being. The problem is obviously where I haven't yet looked. So I'm now going to simplify every bit of code/html/css following the successful acquisition of the Stripe token to see if it suddenly starts working. M On 6/05/2022 6:07 pm

Re: Migrating ManyToManyField to bigint?

2022-05-15 Thread Mike Dewhirst
On 14/05/2022 11:44 pm, Jeremy Lainé wrote: Hi! I'm currently looking at how to migrate all my models from AutoField to BigAutoField. For all the explicitly defined models the process seems pretty straightforward: * change DEFAULT_AUTO_FIELD to BigAutoField * generate migrations * appl

Re: Migrating ManyToManyField to bigint?

2022-05-16 Thread Mike Dewhirst
users Subject: Re: Migrating ManyToManyField to bigint? Hi Mike,Thanks for the reply. For future reference, it was pointed out to me that I missed both an explicit note in the documentation [1] and an issue tracking a potential change in the future [2].Do you have any suggestions as to the

Re: PHP website | a way to refresh the page without reloading

2022-05-18 Thread Mike Dewhirst
BTW, you probably need to look at javascript or HTMX for updating parts of a page without reloading. Cheers and welcome! Mike Dias André, greetings. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and

Please criticise use of global keyword in Admin

2022-05-18 Thread Mike Dewhirst
. Many thanks Mike #admin.py for the billing app rec_fields = [ "company", "chemical", "invoice", "currency", "currency_amount", "gst_amount", "gst_rate", "gst_name",

Re: Please criticise use of global keyword in Admin

2022-05-19 Thread Mike Dewhirst
Sorry to have wasted your time. Thanks again. Mike Then, it seems to me that most of the times you don't need the "global" keyword in your code, because you aren't assigning to "receipt_fields". "receipt_fields" is a name that points to an array, and

Re: Please criticise use of global keyword in Admin

2022-05-19 Thread Mike Dewhirst
Thank you Antonis and Michael - this is how it ended up ... Cheers Mike REC_FIELDS = [ "invoice", "amount_due", "gst_amount", "amount_paid", "amount_owing", "paid_by", "date_paid", ] CONS_FIEL

How can I work around the Django 3.2.10 cve release

2022-05-19 Thread Mike Dewhirst
t How can I fix the following error and move forward to 3.2.13? Many thanks Mike - - - - - - - - Exception Type: ValueError at /admin/chemical/chemical/29/change/payment/change/ Exception Value: Field 'id' expected a number but got '29/change/payment'. Environment:

Re: How can I work around the Django 3.2.10 cve release

2022-05-20 Thread Mike Dewhirst
ause I have to study the docs to make sense of it every time. If there is an easier way I'll do it! you can see the backport change here : https://github.com/django/django/commit/d4dcd5b9dd9e462fec8220e33e3e6c822b7e88a6 I looked at the tests and see they are actually looking for '\n

Re: How can I work around the Django 3.2.10 cve release

2022-05-20 Thread Mike Dewhirst
From: lavanya gowda Date: 21/5/22 13:43 (GMT+10:00) To: Django users Subject: Re: How can I work around the Django 3.2.10 cve release Hi mike and jason kindly help me to my query also i have shared my query in group  its emergencymy humble request :-please help me here i do have some co

Re: How can I work around the Django 3.2.10 cve release

2022-05-21 Thread Mike Dewhirst
XI-D 25 Date: 21/5/22 18:02 (GMT+10:00) To: django-users@googlegroups.com Subject: Re: How can I work around the Django 3.2.10 cve release Hey why don't you use django v4 for your projects? On Fri, 20 May, 2022, 08:43 Mike Dewhirst, wrote:My billing (Stripe) mechanism is working righ

Re: How can I work around the Django 3.2.10 cve release

2022-05-22 Thread Mike Dewhirst
r filing a bug I'm not sure what to say. For the moment I'm stuck with re_path and version 3.2.9 in production. Thanks again for listening and if you think I should post more code I'm happy to do that. Cheers Mike On 21/05/2022 11:38 pm, Jason wrote: https://docs.djangoproject.c

Re: How To expertise Django templates Language(DTL)

2022-05-23 Thread Mike Dewhirst
On 24/05/2022 4:30 am, waqar khan wrote: How To expertise Django templates Language(DTL) Kindy help me, i am intermediate DTL , any budy suggest link , you  tube video or books. This is likely your best bet ... https://docs.djangoproject.com/en/4.0/topics/templates/ -- You received this mes

Re: POS Printer

2022-05-31 Thread Mike Dewhirst
Paul I agree with @Dev. Nice. And generous. I'm saving this email into my 'keep'. Cheers Mike On 1/06/2022 3:22 am, Paul Kudla (SCOM.CA Internet Services Inc.) wrote: ok a few zillion requirements You need something that will generate a pdf file and then send it to a prin

Re: migrations problem in django

2022-06-01 Thread Mike Dewhirst
On 2/06/2022 3:00 am, Paras Kashyap wrote: TypeError: Field.__init__() got an unexpected keyword argument 'max_lenght' You have probably seen this already ... should be 'max_length' Please someone tell me how to fix this error, this error occurs when i try to make migrations -- You received

How to hash fields and detect changes in a record

2022-06-10 Thread Mike Dewhirst
onvinced I have chosen the correct strategy. Hope I've explained the problem adequately. Thoughts appreciated Cheers Mike -- Signed email is an absolute defence against phishing. This email has been signed with my private key. If you import my public key you can automatically decrypt my sign

Re: How to hash fields and detect changes in a record

2022-06-10 Thread Mike Dewhirst
On 10/06/2022 11:24 pm, Ryan Nowakowski wrote: On Fri, Jun 10, 2022 at 05:52:48PM +1000, Mike Dewhirst wrote: The use case is auto-deletion of out-of-date records if they have not changed. That might sound weird but it is the solution I have come to for a particular problem. My software

Re: How to hash fields and detect changes in a record

2022-06-10 Thread Mike Dewhirst
27;ll just convert all the chars in all the fields I'm interested in into integers and sum them into my "hash" field. Should be quick and easy! Cheers Mike On 11/06/2022 12:13 am, Mike Dewhirst wrote: On 10/06/2022 11:24 pm, Ryan Nowakowski wrote: On Fri, Jun 10, 2022 at 05

Re: How to hash fields and detect changes in a record

2022-06-12 Thread Mike Dewhirst
--(Unsigned mail from my phone) Original message From: Ryan Nowakowski Date: 13/6/22 07:09 (GMT+10:00) To: django-users@googlegroups.com Subject: Re: How to hash fields and detect changes in a record On Sat, Jun 11, 2022 at 12:13:16AM +1000, Mike Dewhirst wrote:> On 10

Re: How to hash fields and detect changes in a record

2022-06-14 Thread Mike Dewhirst
r relevant" to the note title if any change is detected. Otherwise the note gets deleted. Cheers Mike -- Signed email is an absolute defence against phishing. This email has been signed with my private key. If you import my public key you can automatically decrypt my signature and be sure

Re: how to deploy python django project using heroku

2022-06-16 Thread Mike Kilmer
Do you have your codebase tracked in a version tracking system like Github? If you do, then, from within Heroku, you can use the Github integration. On Thursday, June 16, 2022 at 11:01:52 AM UTC-5 maheshb...@gmail.com wrote: > please support me how deploy django project using git and heroku > h

CSRF issue in default login

2022-06-17 Thread Mike Kilmer
erent browser. One additional piece of information, I have allauth installed, but it doesn't seem to be correctly configured. It's login page is not loading. Additionally, the problem was there even when I removed allauth from Apps and Authentication Backends. Thanks much. –Mike

Re: CSRF issue in default login

2022-06-17 Thread mike vickers
*an expert in how to best set up django for production. On Fri, 17 Jun 2022 at 11:48, Mike Kilmer wrote: > Hi. > > I'm fairly new to Django. Here's what I need insight on: > > Local server, no issue. > > On production: CSRF 403 error on login. > >

Re: CSRF issue in default login

2022-06-17 Thread Mike Kilmer
STED_ORIGINS = ["https://yourdomain.com";, > "https://www.yourdomain.com";] > > I'd be curious to hear from others, because I'm *not *an expert in how to > best set up django for production. > > > On Fri, 17 Jun 2022 at 11:48, Mike Kilmer wro

Re: CSRF issue in default login

2022-06-17 Thread Mike Kilmer
If you're interested in some piecemeal work, I could use some help. mike at mzoo.org. On Friday, June 17, 2022 at 3:10:16 PM UTC-5 181...@northsouth.edu wrote: > I have basic to intermediate knowledge on Django, but don't find any entry > level job to master my django knowled

Django tried these URL patterns

2022-06-17 Thread Mike Kilmer
This app is set up to create webhooks and receive requests, however the routing has broken and the requests are getting a 404. The path looks like this: http://127.0.0.1:8000/integrations/dc3509ac-1aa8-4c9a-a439-904342d885cd/order The Stack Track/Routing: Using the URLconf defined in fulfill.u

Re: Django tried these URL patterns

2022-06-17 Thread Mike Kilmer
Not sure why, but moving path("integrations/", include("integrations.urls")), above the "" slash seems to have solved the problem. On Friday, June 17, 2022 at 5:45:19 PM UTC-5 Mike Kilmer wrote: > This app is set up to create webhooks and receive requests, howe

RE: remove django polymorphism

2022-07-16 Thread Mike Dewhirst
--(Unsigned mail from my phone) Original message From: Joseph Amiri Date: 17/7/22 05:41 (GMT+10:00) To: Django users Subject: remove django polymorphism hey all.i have models like this :class basemodel(polymorphism):...class teachers(basemodel):...class courses(basemodel):.

Re: Need help on reducing cognitive complexity

2022-07-20 Thread Mike Dewhirst
On 21/07/2022 3:52 pm, Sencer Hamarat wrote: Hi everyone, I have a code block with high cognitive complexity below:     @staticmethod     def in_circle_check(obj_type, item, uuid, item_is_array=False): Partly because the args seem weird. Try writing a docstring which says what the method nee

Model switching - how to avoid saving twice

2022-08-14 Thread Mike Dewhirst
abase ready for conversion into links. Is it possible to do this saving only once? Thanks Mike class Chemical(models.Model):     ...     def save(self, *args, **kwargs):     super().save(*args, **kwargs)     self.convert_notes_to_links(line=line)     def convert_notes_to_links(self, line

How to enable/disable a hyperlink based on the clock

2022-08-23 Thread Mike Dewhirst
Any hints? Thanks mike -- Signed email is an absolute defence against phishing. This email has been signed with my private key. If you import my public key you can automatically decrypt my signature and be sure it came from me. Just ask and I'll send it to you. Your email software can hand

Can an app subclass a core django class to channge its behavior

2022-08-24 Thread Mike Oliver
Hello, I want to follow a microservices architecture and have some shared services I can include in a process flow instead of the 1:1 View:Model Suggestions? MO -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group

Re: Can an app subclass a core django class to channge its behavior

2022-08-24 Thread Mike Oliver
uld you tell us more detail of process flow? > > On Wed, 24 Aug 2022 at 20:52 Mike Oliver < > mikeol...@open4businessonline.com> wrote: > >> Hello, >> >> I want to follow a microservices architecture and have some shared >> services I can include in

Re: Can an app subclass a core django class to channge its behavior

2022-08-24 Thread Mike Oliver
go.middleware.clickjacking.XFrameOptionsMiddleware', ] runserver gives me... ModuleNotFoundError: No module named 'mysite.mymiddleware' On Thursday, August 25, 2022 at 12:04:55 PM UTC+8 Mike Oliver wrote: > Well I have continued to search and now I see that CustomMiddleware will > d

Re: Can an app subclass a core django class to channge its behavior

2022-08-24 Thread Mike Oliver
ervisor.ChutheIOMiddleware", > ] > > Think you should try by shell to make sure you can call it, or importable > `from mysite.mymiddleware import DoseControllerMiddleware`. Shell very > helpful. > On Thu, Aug 25, 2022 at 11:09 AM Mike Oliver < > mike

RE: What do you do with large project and forms?

2022-08-30 Thread Mike Dewhirst
1. Create a forms directory2. Create ../forms/__init__.py3. Move your forms.py into the forms directory4. In ./__init__.py write from .forms import (  FormThis,  FormThat,  EtcForm,)This gives you unchanged forms calling from wherever ... from appname.forms import etc5. When all that is working

Looking for a Django firm

2022-09-12 Thread Mike Dewhirst
Hi all - I'm looking for a Django outfit with an interest in chemistry or customers in the chemical industry in Australia. Possible opportunity. Best to respond off list and there will be an NDA. Cheers Mike -- You received this message because you are subscribed to the Google G

save_model doesn't run on Django version 4

2022-09-13 Thread Mike Kilmer
After having upgraded from Django 3 to 4 the save_model() method isn't running, though the form it imports does. ``` class MyCoolMapAdmin(SuperUserChangeOnlyMixIn, FilterByOwnerAdmin): form = MyCoolModelForm print("this prints on app initialization") def save_model(self, request,

Re: save_model doesn't run on Django version 4

2022-09-13 Thread Mike Kilmer
One thing I'm not sure of it, how to tell if a particular Admin page is triggering a particular Admin instance. On Tuesday, September 13, 2022 at 11:27:54 AM UTC-5 Mike Kilmer wrote: > After having upgraded from Django 3 to 4 the save_model() method isn't > running, though the

Re: On button click need to call a python function...

2022-10-18 Thread Mike Dewhirst
On 18/10/2022 5:04 pm, Saswat Mahapatra wrote: Hi , I am new to django. On button click I need to call a python function which returns 2 values. If both the values are the same then I need to display the same image in 2 places on the web page or else a different image. How to call the python

Sanity check please

2022-10-23 Thread Mike Dewhirst
warnings, caveats Cheers Mike -- Signed email is an absolute defence against phishing. This email has been signed with my private key. If you import my public key you can automatically decrypt my signature and be sure it came from me. Just ask and I'll send it to you. Your email softwar

Re: Update from 3.9 to 3.10.8 and uninstall 3.9

2022-10-24 Thread Mike Dewhirst
B N Date: 24/10/22 19:27 (GMT+10:00) To: Mike Dewhirst Subject: Re: Update from 3.9 to 3.10.8 and uninstall 3.9 Thank you, that was quick.. My problem is/are the technical terms such as path and environment . It took me about 10 hours, (I am retired so have time), to upgrade to Spyder 5.3

Re: Django call_command from Admin

2022-10-25 Thread Mike Oliver
Aziz, I had a similar need and I created my own middleware that checked the request path and did the call when I got a match. See https://docs.djangoproject.com/en/4.1/ref/middleware/ *Mike Oliver** Founder**, Open 4 Business Online* Tel: +1(951)260-0793 | Mobile:**NEW* 639479927462 US Toll

secret api keys

2022-10-26 Thread Mike Dewhirst
repo. I prefer the latter approach. Cheers Mike Original message From: john fabiani Date: 27/10/22 02:09 (GMT+10:00) To: django-users@googlegroups.com Subject: secret api keys Hi, Maybe a dumb question but if I add secret keys in my settings.py file (or should it be placed

Re: secret api keys

2022-10-26 Thread Mike Dewhirst
On 27/10/2022 3:32 pm, Mike Dewhirst wrote: Not a dumb question but frequently asked. There are two approaches - one is to export your secrets as environment vars and read them from there. The other is to keep them in disk files and read them as required. In both cases the idea is to keep

Re: Move apps to different folders or to a root folder

2022-11-06 Thread Mike Dewhirst
On 7/11/2022 2:40 am, Nick Chang wrote: Hello community, I am trying to organize my Django project's structure as the number of apps is growing. So I am attempting to move an app in the sub-folder that contains its model definitions. The app used to be named `.foo

RE: Can't Load Django Dev Sever

2022-11-10 Thread Mike Dewhirst
Try visiting http://localhost:8000 insteadNo guarantees and I'm not going to test it myself ;-)--(Unsigned mail from my phone) Original message From: James Date: 11/11/22 16:13 (GMT+10:00) To: Django users Subject: Can't Load Django Dev Sever Hello,I can't connect to my dja

RE: Possible bug in runserver

2022-11-11 Thread Mike Dewhirst
Try using the inline argument --settings when executing runserver--(Unsigned mail from my phone) Original message From: Matteo Sani Date: 12/11/22 05:38 (GMT+10:00) To: Django users Subject: Possible bug in runserver Hello, I wanted to run Django runserver with custom setti

ALLOWED_HOSTS error

2022-11-21 Thread Mike Dewhirst
t indicate the IP address should be in ALLOWED_HOSTS. My inclination is it shouldn't be there. What is the correct way to deal with this? Many thanks Mike -- Signed email is an absolute defence against phishing. This email has been signed with my private key. If you import my public key yo

Re: ALLOWED_HOSTS error

2022-11-21 Thread Mike Dewhirst
On 22/11/2022 11:54 am, Lakshyaraj Dash wrote: Put only domain names in allowed hosts Thank you - that makes me feel better. Can you tell me why the error is appearing? Is it some sort of hacking attempt? On Tue, Nov 22, 2022, 06:22 Mike Dewhirst wrote: My Django log is full of

Re: Django model design best practice guidance

2022-12-08 Thread Mike Dewhirst
but there are documented solutions. Cheers Mike -- Signed email is an absolute defence against phishing. This email has been signed with my private key. If you import my public key you can automatically decrypt my signature and be sure it came from me. Just ask and I'll send it to you. Your ema

Apache2 hates my Django deployment method

2022-12-10 Thread Mike Dewhirst
hat. The only solution I have is to restart Apache. I have to think this is happening in other projects so I'm wondering if anyone has solved this? Thanks for any feedback Mike -- Signed email is an absolute defence against phishing. This email has been signed with my private key. If you i

Re: Apache2 hates my Django deployment method

2022-12-11 Thread Mike Dewhirst
:warn] and [core:error] before restarting if I have done a reload. I guess I'll give up reloading. Thanks for responding Cheers Mike Templates are picked up because they're not evaluated and compiled, rather they're processed dynamically so any changes there do not req

Re: Apache2 hates my Django deployment method

2022-12-11 Thread Mike Dewhirst
st. I don't think I have the brainspace to identify the actual cause. My best strategy (I think) is to restart on redeployment and wait for for Apache to self-heal. If it is Apache's fault. Thanks for jumping in Cheers Mike On Sunday, December 11, 2022 at 5:45:40 PM UTC-5 Mike Dew

RE: Django deployment on local host

2022-12-14 Thread Mike Dewhirst
The essential difference between local and remote is how you access the website.You need all the same resources including web server, database server etc but you might need a local DNS so local users can find the server by name.You can always test using hosts files on the test machines so they c

Re: Apache and mod_wsgi with django

2023-01-01 Thread Mike Dewhirst
tatus you will be able to gather most of that info before asking for help. Cheers Mike -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django

RE: Card-Payment Integration.

2023-01-02 Thread Mike Dewhirst
I use Stripe. It works well.Mike--(Unsigned mail from my phone) Original message From: Harshwardhan Waghela Date: 2/1/23 22:40 (GMT+10:00) To: Django users Subject: Card-Payment Integration. Can Anyone Can Suggest me of Card-Payment Integration(means Visa, Master-Card...etc)

Re: Card-Payment Integration.

2023-01-02 Thread Mike Dewhirst
On 3/01/2023 3:12 pm, Harshwardhan Waghela wrote: Other Then Stripe ? Speak to your favourite bank and see what they offer. That's what I did before going to Stripe. Otherwise google for local gateway providers. On Monday, 2 January 2023 at 18:05:34 UTC+5:30 Mike Dewhirst wrote:

Re: ModelAdmin

2023-01-04 Thread Mike Dewhirst
link in html using the entity and just replace href="/search" with hx_trigger="/hx_search", for example, so that the existing css works and it looks like an ordinary link. Cheers mike I want a view that would allow non logged users to search a site through checkboxes an

Re: ModelAdmin

2023-01-04 Thread Mike Dewhirst
ly going out of business. I think Whatsapp, Slack etc are all very appropriate places for private conversations. Not so much for a user mutual-support mailing list like this one.  Thanks for understanding Cheers Mike On 5/01/2023 3:31 pm, Satyajit Barik wrote: Yes. It does. ModelAdmin cla

<    2   3   4   5   6   7   8   9   10   11   >