Giter VIP home page Giter VIP logo

django-admin-tools's Introduction

django-admin-tools

Travis build codecov-image Documentation Status Pypi version Python versions

Overview

django-admin-tools is a collection of extensions/tools for the default django administration interface, it includes:

  • a full featured and customizable dashboard;
  • a customizable menu bar;
  • tools to make admin theming easier.

The code is hosted on Github.

Django-admin-tools is generously documented, you can browse the documentation online. a good start is to read the quickstart guide.

The project was created by David Jean Louis and was previously hosted on Bitbucket.

Please join the mailing list if you want to discuss of the future of django-admin-tools.

Requirements

django-admin-tools is compatible with Django 1.11 LTS up to Django 4.0 as well Python 2.7, 3.5+.

For older python and django versions please use the 0.8.1 version of django-admin-tools which is available on Pypi.

Installation

To install django-admin-tools, run the following command inside this directory:

python setup.py install

If you have the Python easy_install utility available, you can also type the following to download and install in one step:

easy_install django-admin-tools

Or if you're using pip:

pip install django-admin-tools

Or if you'd prefer you can simply place the included "admin_tools" directory somewhere on your python path, or symlink to it from somewhere on your Python path; this is useful if you're working from a Mercurial checkout.

An installation guide is available in the documentation.

Documentation

Extensive documentation is available, it was made with the excellent Sphinx program

Translations

There is a a transifex project for django-admin-tools.

Screenshots

The django admin login screen:

The django admin login screen

The admin index dashboard:

The admin index dashboard

The admin menu:

The admin menu

Dashboard modules can be dragged, collapsed, closed etc.:

Dashboard modules can be dragged, collapsed, closed etc.

The app index dashboard:

The app index dashboard

django-admin-tools's People

Contributors

alasdairnicol avatar alexrobbins avatar and-nothing-else avatar andybak avatar aramgutang avatar barseghyanartur avatar daadu avatar fzzylogic avatar glic3rinu avatar izimobil avatar jgelens avatar kmike avatar ledzep2 avatar manikos avatar miurahr avatar odero avatar petrdlouhy avatar saboter avatar shtalinberg avatar shtimn avatar spookylukey avatar suvit avatar taranjeet avatar timgates42 avatar volpino avatar vstoykov avatar willstott101 avatar xmstan avatar yakky avatar znotdead avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

django-admin-tools's Issues

Decide what minimum versions of django/python DAT should support

At the moment DAT supports django 1.3 to django 1.7, to ease development and clean up things we should decide what minimum versions the next release should support.

Personally I would vote for django >= 1.7 (mainly because of the new migration system) and python 2.7 or python 3.

Older projects can still use DAT 0.5.2.

What do you think ?

django 1.8 support

Seems to be it's broken

KeyError at /admin/
'request'
Request Method: GET
Request URL:    http://127.0.0.1:8000/admin/
Django Version: 1.8.2
Exception Type: KeyError
Exception Value:    
'request'
Exception Location: /Users/holms/Dropbox/Dev/gitlab/bandmix/lib/python2.7/site-packages/django/template/context.py in __getitem__, line 71
Python Executable:  /Users/holms/Dropbox/Dev/gitlab/bandmix/bin/python
Python Version: 2.7.10
Python Path:    
['/Users/holms/Dropbox/Dev/gitlab/bandmix/project',
 '/Users/holms/Dropbox/Dev/gitlab/bandmix/lib/python27.zip',
 '/Users/holms/Dropbox/Dev/gitlab/bandmix/lib/python2.7',
 '/Users/holms/Dropbox/Dev/gitlab/bandmix/lib/python2.7/plat-darwin',
 '/Users/holms/Dropbox/Dev/gitlab/bandmix/lib/python2.7/plat-mac',
 '/Users/holms/Dropbox/Dev/gitlab/bandmix/lib/python2.7/plat-mac/lib-scriptpackages',
 '/Users/holms/Dropbox/Dev/gitlab/bandmix/lib/python2.7/lib-tk',
 '/Users/holms/Dropbox/Dev/gitlab/bandmix/lib/python2.7/lib-old',
 '/Users/holms/Dropbox/Dev/gitlab/bandmix/lib/python2.7/lib-dynload',
 '/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7',
 '/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin',
 '/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk',
 '/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac',
 '/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages',
 '/Users/holms/Dropbox/Dev/gitlab/bandmix/lib/python2.7/site-packages']
Server time:    Sat, 4 Jul 2015 05:17:20 +0000

Bookmark management actions raise error 500

Version: 0.8
Django: 1.11

Any bookmark request (add/edit/remove) raise TypeError at /admin_tools/menu/add_bookmark/ context must be a dict rather than RequestContext. error:

Traceback:  

File "/home/blue/.virtualenvs/SZN/local/lib/python2.7/site-packages/django/core/handlers/exception.py"
 in inner
  41.             response = get_response(request)

File "/home/blue/.virtualenvs/SZN/local/lib/python2.7/site-packages/django/core/handlers/base.py" in
 _get_response
  187.                 response = self.process_exception_by_middleware(e, request)

File "/home/blue/.virtualenvs/SZN/local/lib/python2.7/site-packages/django/core/handlers/base.py" in
 _get_response
  185.                 response = wrapped_callback(request, *callback_args, **callback_kwargs)

File "/home/blue/.virtualenvs/SZN/local/lib/python2.7/site-packages/django/utils/decorators.py" in inner

  185.                     return func(*args, **kwargs)

File "/home/blue/.virtualenvs/SZN/local/lib/python2.7/site-packages/django/contrib/auth/decorators.py"
 in _wrapped_view
  23.                 return view_func(request, *args, **kwargs)

File "/home/blue/.virtualenvs/SZN/local/lib/python2.7/site-packages/django/views/decorators/csrf.py"
 in wrapped_view
  58.         return view_func(*args, **kwargs)

File "/home/blue/.virtualenvs/SZN/local/lib/python2.7/site-packages/admin_tools/menu/views.py" in add_bookmark

  38.                     'url': bookmark.url,

File "/home/blue/.virtualenvs/SZN/local/lib/python2.7/site-packages/django/shortcuts.py" in render_to_response

  21.     content = loader.render_to_string(template_name, context, using=using)

File "/home/blue/.virtualenvs/SZN/local/lib/python2.7/site-packages/django/template/loader.py" in render_to_string

  68.     return template.render(context, request)

File "/home/blue/.virtualenvs/SZN/local/lib/python2.7/site-packages/django/template/backends/django.py"
 in render
  64.         context = make_context(context, request, autoescape=self.backend.engine.autoescape)

File "/home/blue/.virtualenvs/SZN/local/lib/python2.7/site-packages/django/template/context.py" in make_context

  287.         raise TypeError('context must be a dict rather than %s.' % context.__class__.__name__
)

Exception Type: TypeError at /admin_tools/menu/add_bookmark/
Exception Value: context must be a dict rather than RequestContext.

Shouldn't you use django.shortcuts.render function instead of django.shortcuts.render_to_response?

Model ordering

Is there any way to order the models when using the CustomIndexDashboard?
I thought it might make a difference the order I added them but it does not.

Also is there a way to remove the application link from the list or not allow it to use navigate to the AppIndexDashboard?

Thanks.

-

delete it (accidentally created)

app_dirs must not be set when loaders is defined

I'm trying to use django-admin-tools as instructed here:

http://django-admin-tools.readthedocs.org/en/latest/configuration.html

I get this:

File "/home/age/prj/django-admin/venv/lib/python3.4/site-packages/django/template/engine.py", line 44, in init
"app_dirs must not be set when loaders is defined.")
django.core.exceptions.ImproperlyConfigured: app_dirs must not be set when loaders is defined.

When I remove APP_DIRS = True I get:

"TemplateDoesNotExist at /admin/
admin/index.html
Request Method: GET
Request URL: http://127.0.0.1:8000/admin/
Django Version: 1.9.1
Exception Type: TemplateDoesNotExist
Exception Value: admin/index.html
..."

My environment:
Kubuntu Linux 14.04
Python 3.4
Django 1.9.1

Should theming be overriding base.html the way it does?

I spent an hour today working out why several Django 1.8 changes weren't showing up.

I'd used 'theming' to fix some CSS and it overrides base.html. So we need to update the included base.html to match the Django version

This means maintaining a different base.html for each Django version and figure out how to load the correct one for a given install.

Considering the only reasons for overriding it are to add a single tag loader and a tag that loads some CSS it strikes me that this is too high a price to pay.

There's also the problem that only one app can override base.html - if another app that tries the same technique then it's down to the ordering of INSTALLED_APPS

This can be partially solved with documentation - tell people what to put in their base.html if they need to - but it gets messy.

I wonder if this could be improved in Django core. I'm still mulling it over but I thought I'd start a conversation.

Using MultiTenant - sometimes Admin-Tools dashboard does not show up

I have been successfully using Admin-tools for awhile and really like it. Easy to use and does what I need. However, recently I changed my app to be multitenant (using django-tenants) and sometimes the dashboard file seems to be ignored. Oddly enough, what I have found 'fixes' it is making a change to the settings file. Once I do that and refresh it will work correctly.

Any idea why that would be? I can't always reproduce the issue - which is my biggest concern. If I could reproduce it intentionally and know it wouldn't come back I would be okay with the work around but I haven't found the true cause.

Mixing ModelList and LinkLists

I like my dashboard panels to be grouped by theme.

Therefore - it is useful to be able to intersperse custom admin pages (via links) with changelists:

    self.children.append(MixedList(
        _('Newsletter'),
        children=(
            {models: 'newsletter.models.*'},
            {'title': 'Image library', 'url': reverse('filebrowser:fb_browse')},
        )
    ))

This isn't hard to do but does involve duplicating a fair amount of code from ModelList and LinkList. If I refactored these two classes I could eliminate this. Would this be a contribution worth considering for the release? If so - I'll do it 'properly'. Backwards compatibility shouldn't be a huge issue unless someone is doing something fairly strange with either of these two classes.

Template loader

I just tried updating to 0.7.0 which requires admin_tools.template_loaders.Loader to be added to the TEMPLATES setting. However, I think the check_config behaviour is incorrect, as template loaders can be nested.

See https://github.com/modelbrouwers/modelbrouwers/blob/c1d3e7ec6976fda11f5f00d4ba923a6a506b82d6/src/conf/settings/base.py#L139 and https://github.com/modelbrouwers/modelbrouwers/blob/c1d3e7ec6976fda11f5f00d4ba923a6a506b82d6/src/conf/settings/production.py#L72 for the used configuration.

In development (without the cached template loader) everything is fine.

Support for Django 2 'view'

Django 2 'view' permission type is not supported, so models are not shown as links and the menu is not populated if a user only has 'view' perms.

Update to a secure version of jquery-ui (1.12.1)

The jquery-ui version currently used by admin-tools is vulnerable to XSS exploits (see: https://snyk.io/vuln/npm:jquery-ui:20160721). Would it be difficult to update this?

I have a fork of admin-tools with the update which seems to be working for our use cases, which i can open a PR for, but I can't say I have enough experience with jQuery to be sure that simply bumping the version would not break anything else in the tools.

check_configuration assumes parameters to loaders are always tuples

Specifically:

https://github.com/django-admin-tools/django-admin-tools/blob/master/admin_tools/__init__.py#L38

for loader in loaders:
    if isinstance(loader, (tuple, list)):
        loaders += loader[1]

This code is presumably trying to handle:

TEMPLATE_LOADERS = (
    ('django.template.loaders.cached.Loader', (
        'django.template.loaders.filesystem.Loader',
        'django.template.loaders.app_directories.Loader',
    )),
)

It has multiple issues:

  1. It mutates settings.TEMPLATE_LOADERS - it should leave it alone.
  2. It only handles 'django.template.loaders.cached.Loader', assuming that the parameter must be a tuple/list. It doesn't handle other TEMPLATE_LOADERS which might take different parameters altogether.
  3. It assumes that it TEMPLATE_LOADERS is a tuple, when it could be a list.

Better code would be something like:

loaders = list(loaders)  # our copy
for loader in loaders:
    if isinstance(loader, (tuple, list)):
        if len(loader) > 1:
            arg = loader[1]
            if isinstance(args, tuple):
                # possibly CachedLoader parameters, which are themselves loaders.
               loaders.extend(arg)

(untested)

  1. It raises a hard error if the configuration is "incorrect". For my use case, I need to do something a bit different, which means that "admin_tools.template_loaders.Loader" is never in my TEMPLATE_LOADERS (we have a custom cached loader into which we can include the admin_tools loader, but not using the same parameter mechanism that the stock cached loader uses).

Instead of raising an IncorrectlyConfigured, this should be using the checks framework - https://docs.djangoproject.com/en/1.7/topics/checks/

Default admin when configured with multiple admin sites

Hi,

when ADMIN_TOOLS_MENU is a dict,
I think it would be a good thing to have a fallback default admin.

I have a bounch of urls out of admin routing
that now raise a "Dashboard menu matching" when menu is rendered.

Thanks,

Luca

This app doesn't work with django-debug-toolbar

##django-debug-toolbar is a popular (almost 5000 github stars) app for inspecting what django does inside (especially good for performance optimization of sql queries of ORM). However, if used with your app, the issue similar to bernardopires/django-tenant-schemas#222 appears.

I applied the fix the related pull request of that issue (https://github.com/Cadasta/cadasta-platform/pull/1803/files) in my project's urls.py and it worked. So it will probably work also in your app.

DjangoUnicodeDecodeError when model title contains non-ascii characters

Our models.py contains

class Entry(models.Model):
    class Meta:
        verbose_name_plural = 'Einträge'

This causes django-admin-tools 0.7.0 to explode with

DjangoUnicodeDecodeError at /admin/
'ascii' codec can't decode byte 0xc3 in position 5: ordinal not in range(128). 
You passed in <django.utils.functional.__proxy__ object at 0x106a53310> (<class 'django.utils.functional.__proxy__'>)

The cause are the {% trans item.title|capfirst %} in admin_tools/menu/templates/admin_tools/menu/item.html and admin_tools/dashboard/templates/admin_tools/dashboard/modules/app_list.html.

For one, I'm not sure that doing a capfirst and then translating ist the right thing in the first place: the translations should be coming from the app in question and modifying the lookup strings first with capfirst will break any intentional translation.

But the real problem is the actual translation. Trying to translate those model titles looks wrong, since if I wanted to translate, the right place to do that is in the model's Meta verbose_name/verbose_name_plural. Throwing a munged model's name into the translating engine and hoping for the best will probably not work right most of the time.

The attached patch removes the {% trans %} blocks in favour of the original strings and allows things to continue.

no_translation_patch.txt

Django 1.8 Configuration

Hello.

In upgrading an app that uses admin tools to 1.8 we have a config issue.

The current config:

TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [ ... ],
        'APP_DIRS': False,
        'OPTIONS': {
            'context_processors': [ ... ],
            'loaders': [
                 'admin_tools.template_loaders.Loader',
             ],        
        },
    },
]

The APP_DIRS when set to True allows per app template directory discovery. To use the loaders then APP_DIRS must be False.

Is there a compromise? With APP_DIRS set to False all of the templates break in all of the apps.

As of yet I can't get a working prototype to pull the app templates back in (syntax?), only auto-discover works as of now.

I am guessing the use of loaders is an architectural decision. I have begun to trace the code but I would also like to know if I am missing something or another way of finding a solution.

Thanks in advance

NoReverseMatch at /admin/

NoReverseMatch at /admin/
Reverse for 'admin-tools-dashboard-set-preferences' with arguments '('dashboard',)' and keyword arguments '{}' not found. 0 pattern(s) tried: []
Request Method: GET
Request URL: http://127.0.0.1:8000/admin/
Django Version: 1.9.8
Exception Type: NoReverseMatch
Exception Value:
Reverse for 'admin-tools-dashboard-set-preferences' with arguments '('dashboard',)' and keyword arguments '{}' not found. 0 pattern(s) tried: []
Exception Location: /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/urlresolvers.py in _reverse_with_prefix, line 508
Python Executable: /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
Python Version: 2.7.12
Python Path:
['/Users/denghui/PycharmProjects/t20',
'/Users/denghui/PycharmProjects/t20',
'/Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip',
'/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7',
'/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin',
'/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac',
'/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages',
'/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk',
'/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old',
'/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload',
'/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages',
'/Library/Python/2.7/site-packages',
'/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages']
Server time: Thu, 4 Aug 2016 11:11:57 +0800

Correction for Django Warning for Template Loader +

The following warning is issued:

admin_tools: (admin_tools.W001) You must add "admin_tools.template_loaders.TemplateLoader" in your template loaders variable, see: https://django-admin-tools.readthedocs.org/en/latest/configuration.html

When added as instructed:

TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [  
        ...
        ],
        'APP_DIRS': False,
        'OPTIONS': {
            'context_processors': [
        ...
            ],
            'loaders': [
                'admin_tools.template_loaders.TemplateLoader',

the following error is returned:

  File "PATH/TO/venv/lib/python2.7/site-packages/django/utils/module_loading.py", line 29, in import_string
    return getattr(module, class_name)
ImportError: Module "django.template.loaders.app_directories" does not define a "TemplateLoader" attribute/class

I noticed that admin_tools.template_loaders has a class named Loader as seen:

https://github.com/django-admin-tools/django-admin-tools/blob/master/admin_tools/template_loaders.py#L41

More than happy to issue a PR if that helps, wanted to confirm this minor issue or get corrected in the case I missed something.

Thanks for all the hard work.

Django flat theme support

To support django-flat-theme for django 1.9 and django < 1.9 with django-flat-theme as an external app, we need:

  • a "detect_admin_theme" helper that would return "legacy" or "flat" based on django version or 'flat' in installed_apps
  • additional css files (and maybe sprite image) for the flat theme, that will override necessary css classes of the default files (untouched)
  • modify template tags and templates to include (or not) the new css files

django.conf.urls.patterns() is deprecated and will be removed in Django 1.10

Deprecated 'django.conf.urls.patterns' are still used at some places.

(...)admin_tools/urls.py:10: RemovedInDjango110 Warning: django.conf.urls.patterns() is deprecated and will be removed in Django 1.10. Update your urlpatterns to be a list of django.conf.urls.url() instances instead.

Run
$ python -Wall manage.py test
to see the other warnings.

Django 1.8/1.9 warnings

RemovedInDjango19Warning: Model class django.contrib.contenttypes.models.ContentType 
doesn't declare an explicit app_label and either isn't in an application in INSTALLED_APPS 
or else was imported before its application was loaded. This will no longer be supported in 
Django 1.9.

I've pushed a quick fix for now that is safe but a touch dirty. I've just moved the imports inside their respective methods.

A proper fix would be to not import models in our init.py files as Django 1.8+ is stricter about the order of imports and we end up importing ContentTypes too early. I'll add a bit more detail here when I have time.

Dashboard columns not fully distributed

Say I have 6 modules and specified 5 columns in a dashboard settings. As a result I'm presented 3 columns with 2 modules in each. I would expect having 2 modules in first column and 1 in others.
It's also not possible to drag and drop modules to missing columns because there is no placeholder created in DOM.

incompatible with django.template.loaders.cached.Loader

Currently admin-tools raises an exception if you use django.template.loaders.cached.Loader, which is quite useful with floppyforms to improve performance

This line is responsible: https://github.com/django-admin-tools/django-admin-tools/blob/master/admin_tools/__init__.py#L46 because cached.Loader makes TEMPLATE_LOADERS into a nested list: https://docs.djangoproject.com/en/dev/ref/templates/api/#django.template.loaders.cached.Loader

Perhaps the check could be nested into subitems of TEMPLATE_LOADERS if the item is not isinstance(basestring)?

conflict with django.apps.AppConfig

In new django versions there's ability to create AppConfig classes where developer can provide a verbose name for an application and much more.
But when I use this AppConfig class, the application page (e.g. /admin/app_name/) gives an unfiltered list of all models from all applications ignoring their app_labels.
The issue disappears when I disable admin_tools and use standard django admin panel

work with staticfiles

When using something like Django-storages, django-compressor or related, esp when uploading to s3 or a CDN, the media_url() manual creation of asset URIs breaks down.

This can be fixed by leveraging the staticfiles app, and replacing the/extending the static template insteand of rolling one based on the media_url()

Random Sorting apps in AppIndexDashboard

Hi
I don't get how AppIndexDashboard sort the "self.models" list in the AppIndexDashboard
Why doesn't it respect the alphabetical sorting based on the verbose_name method of the class?

Thank's.
Pietro

Is this plug-in compatible with Django 2.0

Last commit at May 30, 2017
Django 2 release date is Dec, 2017.

Readme is saying, requires 1.7 or newer. But, according to difference of dates, I'm wondering is "Admin Tools" plug-in is compatible with Django 2?

Problem with admin page

ImportError at /admin/
cannot import name 'smart_unicode'
Request Method: GET
Request URL: http://127.0.0.1:8000/admin/
Django Version: 1.10.4
Exception Type: ImportError
Exception Value:
cannot import name 'smart_unicode'
Exception Location: /Users/Miro/Desktop/DjangoProjektApp/myvenv/lib/python3.5/site-packages/cache_utils/utils.py in , line 2
Python Executable: /Users/Miro/Desktop/DjangoProjektApp/myvenv/bin/python
Python Version: 3.5.2
Python Path:
['/Users/Miro/Desktop/DjangoProjektApp',
'/Library/Frameworks/Python.framework/Versions/3.5/lib/python35.zip',
'/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5',
'/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/plat-darwin',
'/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/lib-dynload',
'/Users/Miro/Desktop/DjangoProjektApp/myvenv/lib/python3.5/site-packages']
Server time: Mon, 2 Jan 2017 20:58:37 +0000

When I changed smart_unicode to smart_text in utils.py i get following error:

File "/Users/Miro/Desktop/DjangoProjektApp/myvenv/lib/python3.5/site-packages/cache_utils/utils.py", line 29, in _func_type
argnames = func.func_code.co_varnames[:func.func_code.co_argcount]
AttributeError: 'function' object has no attribute 'func_code'

Can anyone help me to fix this ?

not found admin template

django is 1.11.2

OSError: [Errno 22] Invalid argument: 'E:\\bornadu\\grapheneserver\\templates\\admin:admin\\base.html'

TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [os.path.join(BASE_DIR, 'templates')],

        'OPTIONS': {
            'loaders': [
                    'django.template.loaders.filesystem.Loader',
                    'django.template.loaders.app_directories.Loader',
                    'admin_tools.template_loaders.Loader',
                ],
            'context_processors': [
                'django.template.context_processors.debug',
                'django.template.context_processors.request',
                'django.contrib.auth.context_processors.auth',
                'django.contrib.messages.context_processors.messages',
            ],
        },

    },
]

INSTALLED_APPS = [
    # 'grappelli_menu',
    # 'grappelli',
    # 'material',
    # 'material.theme.yellow',
    # 'material.frontend',
    # 'material.admin',

    #'baton',
    # 'bootstrap_admin',
    # 'adminlte',
    # General use templates & template tags (should appear first)
    # 'django_adminlte',
    # Optional: Django admin theme (must be before django.contrib.admin)
    # 'django_adminlte_theme',
    # 'admin_menu',
    'admin_tools',
    'admin_tools.dashboard',
    'admin_tools.menu',
    'admin_tools.theming',
    'django.contrib.admin',
    ....
]

Documentation issue: INSTALLED_APPS

While reading the documentation on http://django-admin-tools.readthedocs.org/en/latest/configuration.html I read the following:

Then, add the django-admin-tools modules to the INSTALLED_APPS like this:

INSTALLED_APPS = (
    'admin_tools.theming',
    'admin_tools.menu',
    'admin_tools.dashboard',
    'django.contrib.auth',
    'django.contrib.sites',
    'django.contrib.admin'
    # ...other installed applications...
)

Doing so resulted in missing static files (like utils.js). Adding 'admin_tools' to the list seemed to solve this issue (solved it after looking in the sample coniguration: https://github.com/django-admin-tools/django-admin-tools/blob/master/test_proj/settings.py)

This seems like a documentation issue?

App title does not i18n-ed

App titles are always to be capfirst-ed app.label.title().

It should be {% trans app.name %} that priority of name is

  1. verbose_name
  2. app.title()

The verbose_name is initialized as app.title() In django appconfig init() when there is no verbose_name specified. It is because we can always use verbose_name for template name.

Problem is located here

'title': capfirst(app_label.title()),

It always use app.title() instead of verbose_name

RuntimeError: populate() isn't reentrant

Hi all,

I tryed to upgrade from 0.6.0 to 0.7.1 version and when I run django I have the error bellow:
I returned to 0.6.0 version and it's running fine.
Any idea?

File "/usr/local/envs/tests/lib/python3.4/site-packages/django/init.py", line 18, in setup
apps.populate(settings.INSTALLED_APPS)
File "/usr/local/envs/tests/lib/python3.4/site-packages/django/apps/registry.py", line 78, in populate
raise RuntimeError("populate() isn't reentrant")
RuntimeError: populate() isn't reentrant

Thanks.

The error after Django upgrade to 1.10

File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/admin_tools/urls.py", line 2, in
from django.conf.urls import patterns, url, include
ImportError: cannot import name patterns

Next version

Releasing a new version is quite urgent as v0.5.2 is not compatible with django 1.8 (and has issues with 1.7 as well).

On the top of my head, here are the things that block the release:

  • ensure manually that all is working with django 1.7 and 1.8 (unit tests aren't enough)
  • update docs ! and emphasize the fact we no longer support django < 1.7
  • build a release note (and emphasize... see above)
  • release away ;)

Any takers on the tasks above (I have not enough free time to do it right atm... except for the last point ;)) ?

I think we should version this release as 0.6.0 and, hopefully, next release will be a stable one (1.0.0).

django.db.migrations.loader.BadMigrationError: Migrated app 'menu' contains South migrations.

  1. django.db.migrations.loader.BadMigrationError: Migrated app 'menu' contains South migrations. Make sure all numbered South migrations are deleted prior to creating Django migrations.
  2. django.db.migrations.loader.BadMigrationError: Migrated app 'dashboard' contains South migrations. Make sure all numbered South migrations are deleted prior to creating Django migrations.

The solution is renaming the migrations package in south_migrations

At the moment I have fixed it indicating an other 'migrations' package for them putting this code in my settings.py:

SOUTH_MIGRATION_MODULES = {
'cms': 'cms.migrations',
...

#FIX BAD MIGRATION ERRORS THROUGH TEMPORARY WORKAROUND
'menu': 'cms.migrations',
'dashboard': 'cms.migrations',
'django_extensions': 'cms.migrations',
'filer': 'cms.migrations',

...
}

The same problem for django_extensions, but it has been resolved but not pushed to pypi(as you can read here ), and for django_filer (as you can read here )

Mobile browser support with responsive columns

I'm investigating this along with django-flat-responsive, as an alternative to django-grappelli in order to find a solution for using django admin on both mobile devices and desktop. However, with a narrow browser window (e.g. phone), if I've specified 4 columns it just tries to fit all 4 in the screen width. How about making columns a maximum rather than a requirement? And show only the number of columns that can fit, based on a minimum width?

As an alternative to responsive CSS, is there a way to set columns dynamically when we detect the browser?

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.