Question

I've tried looking through documentation but I'm a bit stuck on some things--

When I enter django admin and try to change the directory for an imagefield, I hit Browse and it ends up browsing my local hard drive. I also can't change the imagefield manually so I resort to opening up the shell and changing the picture using a shell command for each object. Is there a way I could possibly fix this so that I could edit the imagefield manually?

Also, is it possible to set up an admin interface for one particular object? I've had it set up so that admin can access an application, but would be able to edit any object for that app. I'm setting up a site where I'd like to allow each person to have an admin account that would be able to edit their particular object.

Was it helpful?

Solution

I hit Browse and it ends up browsing my local hard drive. I also can't change the imagefield manually so I resort to opening up the shell and changing the picture using a shell command for each object.

The path of the image stored is a relative path to settings.MEDIA_URL. You can of course change path in the form.clean and many more places, but I don't see why you would. This method has the advantage that, as long as you keep the media folder in a particular structure, you can throw it anywhere and just alter your MEDIA_URL

I've had it set up so that admin can access an application, but would be able to edit any object for that app.

Yes. You can do that by controlling permissions. You can set per object permissions implementations of which are available in many third party apps like django-authority and many others.

If you want to keep it simple, you may also just dynamically override the queryset based on the requested user as described in the docs.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top