django-orfano è un app Django che può essere utilizzato per eliminare tutti i file orfani.
Setup
installare tramite easy_install o pip
easy_install django-orfani
con pip
Pip installare django-orfani
aggiungerlo alle applicazioni installate in django settings.py
INSTALLED_APPS = (
& Nbsp; 'django_orphaned',
& Nbsp; ...
)
ora aggiungere questo alla tua settings.py ('app' è il nome del progetto in cui si trova models.py):
ORPHANED_APPS_MEDIABASE_DIRS = {
& Nbsp; 'app': {
& Nbsp; 'root': MEDIABASE_ROOT, # MEDIABASE_ROOT => posizione predefinita degli elementi caricati ad esempio / Var / www / MediaBase
& Nbsp;}
}
il minimo da fare è eseguire questo comando per visualizzare tutti i file orfani
python manage.py deleteorphaned --info
e di cancellare tutti i file, infine orfani
python manage.py deleteorphaned
Requisiti :
- Python
- Django
I commenti non trovato