8

Django 1.6.2 admin has a widget to search and choose permissions allowed for a User model. The widget looks like this. Permission and Group Widget

I have not updated Django version or anything but I notice that the widget is missing. It is running on Apache with mod_wsgi before and now. Now the widget is

Current widget

Any input or directions on why this happened? Thanks.

Community
  • 1
  • 1
quiet_penguin
  • 808
  • 7
  • 18

6 Answers6

1

Maybe your admin.py code is like this

admin.py

admin.site.register(User)

If you extended Django's basic users,

admin.py

from django.contrib.auth.admin import UserAdmin

class MyUserAdmin(UserAdmin):
    model = User

    fieldsets = UserAdmin.fieldsets + (
        (None, {'fields': ('field1', 'field2',...)}),
    )


admin.site.register(User, MyUserAdmin)
J Zero
  • 43
  • 7
1

I am seeing this same problem when creating a custom user model - same two widgets missing but also internal logic somehow broken to assign users to all new created groups.

Is there a definitive solution to this problem? Link to my queston: Group and Permissions Assignment Missing when using Custom User Model

0

This problem went away on its own. As mentioned on the question there were no changes to the code/project. I suspect it was a permissions issue on static files. Did not get time to try and reproduce it again. Will update if I come across this and any solutions. Thanks @cdvv7788 and Simon.

quiet_penguin
  • 808
  • 7
  • 18
0

I had the same exact problem, same exact missing widgets. js, images, css wasn't served to my Admin panel. After almoast 48 hours of research and asking I just had enough and went in to my nginx/sites-available/django conf file and with much rage I've deleted # Proxy the static assests for the Django Admin panel location /static/admin { alias /usr/lib/python2.7/dist-packages/django/contrib/admin/static/admin/; } Guess what, :-) All my problems went away and everything works perfectly on Admin panel. This script was there by default. Maybe I took somewhere the wrong turn, but I had it there.

This problem went away on its own.

Probably, somehow OP had the same issue. But thanks for sharing screenshots couse otherwise I couldn't have differentiate this question from other similar posts.

Laci
  • 566
  • 2
  • 15
  • 39
0

I know the OP's problem has been resolved, but just for the sake of reference, I had the same issue happening when using Cloudflare Rockerloader enabled for my website.

It seemed to interfere with the javascript code and the widgets didn't load correctly. Disabling Rocketloader fixed the issue.

SpiXel
  • 4,338
  • 1
  • 29
  • 45
0

Apache is a web server while Django is an application server.

It is very necessary to remember this. Django does provide us with a development server, but as soon as we turn debug mode off, it takes off the unnecessary load of it's shoulders of processing statics and media files. We need to configure our Nginx/ Apache servers to do this.

Django is very heavy compared to other Web servers that is why it is necessary to use web servers to serve statics/ media in a production environment.

Here, the issue is that your statics are returning a 404 not found. Please configure your web server to serve /static url/ from /static root/ of your app.

Swakeert Jain
  • 776
  • 5
  • 16