Giter Club home page Giter Club logo

Comments (4)

LeaFin avatar LeaFin commented on June 1, 2024

/python2.7/site-packages/constance/admin.py in changelist_view

# First load a mapping between config name and default value
if not self.has_change_permission(request, None):
    raise PermissionDenied
default_initial = ((name, default) for name, (default, help_text) in settings.CONFIG.items())
# Then update the mapping with actually values from the backend
initial = dict(default_initial,
>        **dict(config._backend.mget(settings.CONFIG.keys())))
form = ConstanceForm(initial=initial)
if request.method == 'POST':
    form = ConstanceForm(request.POST)

from django-constance.

normanjaeckel avatar normanjaeckel commented on June 1, 2024

It seems that I have the same problem. Django 1.7c2 does not work with actual master of constance. It works when constance is in the INSTALLED_APPS list earlier then django-contrib-admin.
If not, the problem occurs because the new ready() function of the admin app is called earlier than the read() function of constance.

Nevertheless I don't like the solution of @LeaFin very much: The Config class instance seems to be instanciated twice. Can we find a solution that the Config class isn't setup in the ready() function but earlier?

from django-constance.

kolos666 avatar kolos666 commented on June 1, 2024

Hi, could you add into documentation information about added 'constance' and (if you use db backend) 'constance.backends.database' in the INSTALLED_APPS list earlier then django-contrib-admin. I spend some few hours, before figure out this.

from django-constance.

jezdez avatar jezdez commented on June 1, 2024

This seems to have been a regression when the app loading was rewritten in Django 1.7. This should work with current master again. See 69221ba for the change.

from django-constance.

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.