Question: `python manage.py flush` removes data from the entire project. I would like to be able to do `python manage.py flush agivenapp` How can I do this?

Answer: 
You can do this with the `migrate` command which takes two positional arguments:

> 
> Updates database schema. Manages both apps with migrations and those without.
> 
> 
> positional arguments:
> 
> 
> **app\_label**  
> 
>  App label of an application to synchronize the state.  
> 
> **migration\_name**  
> 
>  Database state will be brought to the state after that
>  migration. Use the name "zero" to unapply all migrations.
> 
> 
> 

So running a migrate zero followed by a migrate will clear only the data for the given app.

```
$ python manage.py migrate ${APPNAME} zero
$ python manage.py migrate ${APPNAME}    

```
For later versions of Django try in the Django shell:

```
from django.apps import apps
my_app = apps.get_app_config('my_app_name')
my_models = my_app.get_models()
for model in my_models:
    model.objects.all().delete()

```

More on the `apps` module can be found [here](https://docs.djangoproject.com/en/dev/ref/applications/).
Of course, you could convert this to a management command yourself using the management [infrastructure](https://docs.djangoproject.com/en/dev/howto/custom-management-commands/).