开发者

Running manage.py dumpdata on apps with dots in their names

I'm trying to do moving some data from my development machine to a server using dumpdata but ran into a problem. So, say I want to dump the data that belongs to the app django.contrib.auth.

django.contrib.auth is in my INSTALLED_APPS.

This happens when I run

$ python manage.py dumpdata django.contrib.auth

Error: Unknown application: django.contrib.auth

The strange thing is that I can do manage.py 开发者_开发百科testserver (i.e. nothing is broken) or do

$ python

>>> import django.contrib.auth

So there is nothing wrong with the python path.

I can run dumpdata on apps that are located straight in my project's dir.

If I leave out the apps' names, django.contrib.auth's tables are dumped as expected.

So, why can't I point out a specific app with dots in the name? I have tried to dump other apps that are located in site-packages with the same result.


Try instead:

python manage.py dumpdata auth

The dumpdata command doesn't require the (fully qualified) package name of the app, only the name.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜