Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3235622
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T17:31:40+00:00 2026-05-17T17:31:40+00:00

How would you go about making a pluggable django app, that can accept data

  • 0

How would you go about making a pluggable django app, that can accept data from any model and then perfom some action with that data (i.e Save to DB, Send email). This functionality should be generic and should not be tied to a specific model.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T17:31:40+00:00Added an answer on May 17, 2026 at 5:31 pm

    It depends on what functionality your app would provide and in what way you’d expect users of your app to use it’s api. For interacting with other models you don’t know about there are a few ways, depending on what your reusable app does. You can make forms, views etc that would accept a model class or instance as a property or parameter. The other way would be for the users of your app to specify their relevant models in settings.py much like auth deals with user profiles. For example if your app needs to know about a model class that provides info about gadgets the user would specify:

    #user's settings.py
    GADGETS_MODEL='myapp.CustomSuperFunGadgets'
    

    To get the class for the user specified model you would do:

    from django.core.exceptions import ImproperlyConfigured
    from django.conf import settings
    if not getattr(settings, 'GADGETS_MODEL', False):
            raise ImproperlyConfigured('You need to set GADGETS_MODEL'
                                              'in your project settings')
    try:
        app_label, model_name = settings.GADGETS_MODEL.split('.')
    except ValueError:
        raise ImproperlyConfigured('app_label and model_name should'
                        ' be separated by a dot in the GADGETS_MODEL set'
                        'ting')
    
    try:
        model = models.get_model(app_label, model_name)
        if model is None:
                  raise ImproperlyConfigured('Unable to load the gadgets '
                        'model, check GADGETS_MODEL in your project sett'
                        'ings')
    except (ImportError):
         raise ImproperlyConfigured('Unable to load the gadgets model')
    #at this poing model will hold a reference to the specified model class
    

    Another way of interacting with models you don’t know about is your app to provide custom model fields or managers or special properties that would just attach signal handlers to the model they are attached to.

    As I said it all depends on what problem your reusable app is trying to solve, and the approach you should take is always based on that.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How would you go about making an application that can edit it's own look
I'm thinking about making a Cocoa app (desktop) that includes a CouchDB database. How
How would a go about making a program where the user enters a string,
How would you go about proving that two queries are functionally equivalent, eg they
I'm wondering how i would go about making the following application: a user signs
I was looking online for a script that demonstrates how I would go about
How would one go about making sure the InProc session memory gets stored in
How would I go about making every method call of every groovy class of
How would one go about making a progress bar in html/css/javascript. I don't really
How would I go about making the button open in a new window, emulating

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.