Ho installato Django-cms con lo script djangocms-installer
e tutto funziona bene, tranne che ricevo un mucchio di avvertimenti RemovedInDjango18Warning
nella shell ogni volta che avvio il server, faccio qualcosa con gestisci .py, o anche fare una scheda di gestione.py-completamento automatico (più fastidioso)! Così ho pensato di mettere a tacere le avvertenze, utilizzando warnings
modulo:Impossibile tacitare gli avvisi che produce django-cms
# in manage.py, just after `import os; import sys`:
import warnings
warnings.filterwarnings("ignore")
Vorrei ottenere più specifico con il silenziamento, ma si scopre che anche questo semplice caso non fa nulla, vengono comunque visualizzati gli avvertimenti ! Che cosa sto facendo di sbagliato?!
Gli avvertimenti:
/Users/fran/.virtualenvs/dkde2015/lib/python2.7/site-packages/cms/publisher/manager.py:5: RemovedInDjango18Warning: `PublisherManager.get_query_set` method should be renamed `get_queryset`.
class PublisherManager(models.Manager):
/Users/fran/.virtualenvs/dkde2015/lib/python2.7/site-packages/cms/models/managers.py:15: RemovedInDjango18Warning: `PageManager.get_query_set` method should be renamed `get_queryset`.
class PageManager(PublisherManager):
/Users/fran/.virtualenvs/dkde2015/lib/python2.7/site-packages/cms/admin/change_list.py:39: RemovedInDjango18Warning: `CMSChangeList.get_query_set` method should be renamed `get_queryset`.
class CMSChangeList(ChangeList):
/Users/fran/.virtualenvs/dkde2015/lib/python2.7/site-packages/cms/admin/forms.py:340: RemovedInDjango18Warning: Creating a ModelForm without either the 'fields' attribute or the 'exclude' attribute is deprecated - form PagePermissionInlineAdminForm needs updating
class PagePermissionInlineAdminForm(forms.ModelForm):
/Users/fran/.virtualenvs/dkde2015/lib/python2.7/site-packages/cms/admin/forms.py:442: RemovedInDjango18Warning: Creating a ModelForm without either the 'fields' attribute or the 'exclude' attribute is deprecated - form ViewRestrictionInlineAdminForm needs updating
class ViewRestrictionInlineAdminForm(PagePermissionInlineAdminForm):
/Users/fran/.virtualenvs/dkde2015/lib/python2.7/site-packages/cms/admin/forms.py:491: RemovedInDjango18Warning: Creating a ModelForm without either the 'fields' attribute or the 'exclude' attribute is deprecated - form PageUserForm needs updating
class PageUserForm(UserCreationForm, GenericCmsPermissionForm):
/Users/fran/.virtualenvs/dkde2015/lib/python2.7/site-packages/django/forms/widgets.py:143: RemovedInDjango18Warning: `PagePermissionInlineAdmin.queryset` method should be renamed `get_queryset`.
.__new__(mcs, name, bases, attrs))
/Users/fran/.virtualenvs/dkde2015/lib/python2.7/site-packages/django/forms/widgets.py:143: RemovedInDjango18Warning: `ViewRestrictionInlineAdmin.queryset` method should be renamed `get_queryset`.
.__new__(mcs, name, bases, attrs))
/Users/fran/.virtualenvs/dkde2015/lib/python2.7/site-packages/django/forms/widgets.py:143: RemovedInDjango18Warning: `PageUserAdmin.queryset` method should be renamed `get_queryset`.
.__new__(mcs, name, bases, attrs))
Grazie per il suggerimento. Funziona localmente con runserver, ma sfortunatamente non è davvero un'opzione per le installazioni remote. Inoltre, non riesco a specificare gli avvisi esatti che voglio mettere a tacere, invece li zittisce tutti (anche se i documenti dicono il contrario). Suppongo che stia facendo qualcosa di sbagliato anche qui :( – frnhr
Sì, so che la risposta non è una soluzione completa, ma spero che possa essere utile comunque. Ho provato brevemente a specificare gli avvertimenti esatti da filtrare nella riga di comando, ma – Alasdair