Reputation: 3272
Is there a way to deploy Django Admin and your main application separately, though both of them sharing the same Models / Business logic services.
I come from Grails background where you can create a plugin which can hold your Entities and common business logic and that plugin can be utilized by other application deployed and scaled separately though using the same Database. You don't have to repackage your plugin again for every change rather its just sibling folder to your other projects.
Can I achieve something similar with Django?
Upvotes: 1
Views: 373
Reputation: 16367
Assuming a typical setup, in order to be useful Django Admin needs access to project's apps and their models.
So a setup that you've described would require at least:
Even if your models and Admin bindings are not dependent on other parts of the codebase, extracting the above components to a separate project and then keeping everything in sync sounds pretty hard.
Summarizing: I would say it's hard but possible if it's something that you really need, but Django Admin hasn't been designed with such use case in mind.
Upvotes: 1
Reputation: 3108
Django admin is actually separate from the main application by placing it on its own url. Even if they know the admin url, users cannot log in to the site's admin unless they have already been assigned Staff status via the admin. You can set the admin prefix to anything you want, so if you want to "hide" the admin login page, just make it something long and random (good for security too), and basically no one but those you tell will even know where the admin site can be found.
Upvotes: 0