You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm having problem getting this to work. I've used this package elsewhere with no problems. What's different is: 1) I'm using Python 3.7 + Django 2.1; 2) the model in question also subclasses another class that alters the default ModelAdmin - but I don't see how either of these should affect it not finding the modelclone/change_form.html.
It appears that Django is not trying to locate the template within site-packages:
Django tried loading these templates, in this order:
Using engine django:
django.template.loaders.app_directories.Loader: /usr/local/lib/python3.7/site-packages/django/contrib/admin/templates/modelclone/change_form.html (Source does not exist)
django.template.loaders.app_directories.Loader: /usr/local/lib/python3.7/site-packages/django/contrib/auth/templates/modelclone/change_form.html (Source does not exist)
django.template.loaders.app_directories.Loader: /usr/local/lib/python3.7/site-packages/django_extensions/templates/modelclone/change_form.html (Source does not exist)
from django.contrib import admin
import modelclone
from gatekeeper.admin import GatekeeperSerialAdmin
from .models import Homepage
class HomepageAdmin(modelclone.ClonableModelAdmin, GatekeeperSerialAdmin):
model = Homepage
admin.site.register(Homepage, HomepageAdmin)
I could make it work by explicitly adding '/usr/local/lib/python3.7/site-packages/modelclone/templates' to the DIRS list in TEMPLATES, but that's not a workable solution if the server setup changes.
Actually - that didn't quite work: you can bring up the instance in the Admin and there's a "duplicate" button. When you click it, the duplicate admin comes up but there's no "save" button, just "close".
Any suggestions/ideas or pointing out where I screwed up :-) would be greatly appreciated.
The text was updated successfully, but these errors were encountered:
Yup it's in INSTALLED_APPS. It's weird because I've used this code in other projects without any problems, even ones where I installed it LONG into the development cycle (so if there would be the potentials for conflcts it would be then). This time, I'm starting with a blank slate (so the environment is pretty much out of the box), and it's just not happy.
This is the intermediate step screen (i.e., I've clicked on the "Duplicate" button.
As you can see, there's no way to save this object. The only option is "close".
Please advise.
I'm having problem getting this to work. I've used this package elsewhere with no problems. What's different is: 1) I'm using Python 3.7 + Django 2.1; 2) the model in question also subclasses another class that alters the default ModelAdmin - but I don't see how either of these should affect it not finding the modelclone/change_form.html.
It appears that Django is not trying to locate the template within site-packages:
TEMPLATES in the settings.py is:
and the admin.py's class is:
I could make it work by explicitly adding
'/usr/local/lib/python3.7/site-packages/modelclone/templates'
to the DIRS list in TEMPLATES, but that's not a workable solution if the server setup changes.Actually - that didn't quite work: you can bring up the instance in the Admin and there's a "duplicate" button. When you click it, the duplicate admin comes up but there's no "save" button, just "close".
Any suggestions/ideas or pointing out where I screwed up :-) would be greatly appreciated.
The text was updated successfully, but these errors were encountered: