6

Like this question, my admin overrides aren't working in my production environment but they are in my development environment (same django version). I've tried reordering the INSTALLED_APPS tuple in settings.py with no change (was the answer to the question linked above). Here's how I have my project constructed:

/WebDJ/ # project dir
    +devices # unrelated app, but it uses templates (see below)
    +sales
        __init__.py
        admin.py
        models.py  # has Customer and Transaction model classes
    +templates
        +admin
            +sales
                +Customer
                    change_form.html
                +Transaction
                    change_form.html
        +devices # lots of templates under here that work fine
        404.html
        500.html

also:

TEMPLATE_DIRS = ('/WebDJ/templates',)

is set in settings.py. The templates in the devices app are fine. What's not loading are the overrides in the admin directory - so the change form for Customer and Transaction has some extra stuff added to them (overriding the "after_field_sets" block).

Again, it works in my development environment (using PyCharm) but not in my production environment. Any ideas? I'm really stumped on this one.

Community
  • 1
  • 1
machomeautoguy
  • 587
  • 4
  • 19

1 Answers1

16

Answer: on my production machine, apparently it didn't like "Customer" and "Transaction" despite that being the exact name of the models - it needed "customer" and "transaction".

machomeautoguy
  • 587
  • 4
  • 19
  • 3
    I would give you more votes if I could. I wonder why capitalization works in dev but not production. – wilbbe01 Aug 13 '13 at 03:52
  • 4
    if you're developing on Windows and deploying to a Unix variant (such as Linux), then that would explain it - windows directories and filenames are not case sensitive, but Unix ones are. Just a thought. – Brendan Quinn Jan 25 '14 at 16:52
  • 3
    Developing on a case-sensitive Mac OS install and deploying on linux so that's not it. – machomeautoguy Jan 26 '14 at 19:33
  • 2
    Same issue here. This even happened between running django on a docker container locally and deployed to kube. I guess that difference could be explained by attached volumes but its certainly surprising. – agconti Apr 27 '20 at 20:51
  • Thank you a lot, you've probably saved hours of my life – David Jul 12 '21 at 22:43