Giter VIP home page Giter VIP logo

Comments (4)

jpic avatar jpic commented on May 17, 2024

If glom is in INSTALLED_APPS, then it will import the app in glom.default_app_config, for example with glom.default_app_config = 'glom.django.app.AppConfig' then this allows AppConfig to do the registration in ready().

https://docs.djangoproject.com/en/2.0/ref/applications/

from glom.

mahmoud avatar mahmoud commented on May 17, 2024

@jpic that's some good detailed info! Interestingly that would involve making glom into a django app, even if not directly depending on django as an installation requirement. Am I understanding that correctly? Definitely worth a think, even if it doesn't answer the question for SQLAlchemy and other libraries with interesting types.

from glom.

jpic avatar jpic commented on May 17, 2024

Well, there will be a conflict if another library that's not compatible with Django decides to use glom.default_app_config, load the module it contains as a string, and expect anything else than a Django App, otherwise, everything will be fine.
Otherwise, we could have a django app in glom/django_glom, then the user can add glom.django_glom to INSTALLED_APPS and benefit from auto registration with the App class, that could also autodiscover glom.py files from INSTALLED_APPS like Django already does for the admin or models.
Otherwise, you can move glom/ to src/glom and change the setup script to it install all modules from src/, then it will install src/glom_django, src/glom_sqlalchemy, etc ... you can see examples in yourlabs/django-autocomplete-light or yourlabs/crudlfap, their setup.py install all modules in src/ subdirectory which is great to keep control on depencency coupling.
But before SQLAlchemy I'd like to check if glom can support also Django Forms or WTForms library 😂
Let me know if you want me to propose a patch of one of the things i'm talking about ;)

from glom.

jpic avatar jpic commented on May 17, 2024

Forgot to show example django app auto discovery for registration: https://github.com/yourlabs/crudlfap/blob/master/src/crudlfap/apps.py

from glom.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.