Re: Problem Django Admin app is read only!

63 views
Skip to first unread message

Frank Bieniek

unread,
Jun 6, 2013, 5:42:25 PM6/6/13
to django...@googlegroups.com
Hi,
who is serving your media files? apache?
In debug mode django is not delivering them, if it is run through mod_wsgi

Greets from Ratingen
Frank


Am 06.06.13 17:08, schrieb Enaut Waldmeier:
Hi,

I have a problem with django-admin whenever I deploy my page to the apache server with DEBUG=False django-admin displys all the entries of this app as if they had `has_change_permission(): return false`.

I can't find any errors and it only happens on apache.

what works and what does not:
  • manage.py runserver `DEBUG=True` works
  • manage.py runserver `DEBUG=False` works
  • apache `DEBUG=True` works
  • apache `DEBUG=False` does not work

Works means I can edit and it looks like:

http://imodspace.iig.uni-freiburg.de/django/should.png

Does not work means the entries are black and no modification via django-admin is possible:

http://imodspace.iig.uni-freiburg.de/django/state.png


The code that generates the models:

    class Belegung(models.Model):
        name = models.CharField(max_length=40)
        bemerkung = models.TextField(max_length=200, blank=True)
        begin = models.DateField()
        ende = models.DateField()

        def __unicode__(self): ...

        class Meta:
            verbose_name_plural = "Belegungen"
            ordering = ['begin']


    class CalendarContent(mainpage.ContentBlock):
        month = models.DateField()

        def __unicode__(self): ...
        def save(self, *args, **kwargs): ...
        def headline(self): ...
        def nexturl(self): ...
        def prevurl(self): ...
        def extract_begin_end(self, entries, day):...
        def weeks(self): ...


    class BelegungAdmin(admin.ModelAdmin):
        list_display = ["name", "bemerkung", "begin", "ende"]
        list_filter = ["begin"]
    admin.site.register(Belegung, BelegungAdmin)


    class CalendarContentAdmin(admin.ModelAdmin):
        exclude = ('content_type',)
        pass
    admin.site.register(CalendarContent, CalendarContentAdmin)

Is there some secret switch or something else I have not yet found that can make the fields disabled in django-admin?

I'm just stuck here and would be greatfull for any advice.
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Enaut Waldmeier

unread,
Jun 7, 2013, 2:31:14 AM6/7/13
to django...@googlegroups.com


Am Donnerstag, 6. Juni 2013 23:42:25 UTC+2 schrieb Frank Bieniek:
Hi,
who is serving your media files? apache?
In debug mode django is not delivering them, if it is run through mod_wsgi
 
I know it is not about media files! The css aswell as the images are served correctly by apache. I just can't modify the entries of the "Belegung" app through django-admin.
 

Inixtrom

unread,
Jun 23, 2014, 12:56:34 AM6/23/14
to django...@googlegroups.com
Hi, Did you find a solution for this issue?

Enaut Waldmeier

unread,
Jun 23, 2014, 4:20:37 AM6/23/14
to django...@googlegroups.com
The Problem was that I havn't had a sepparate file for the admin declarations (which should be ok according to the specs). But it didn't work. A more detailed step by step guide how to reproduce the issue was filed https://code.djangoproject.com/ticket/21262 . I think it happened because I registered the wrong object. Do you have a similar problem or did you just want to resolve the issue for me?
Reply all
Reply to author
Forward
0 new messages