相关疑难解决方法(0)

Django:AppRegistryNotReady()

Python:2.7; Django:1.7; Mac 10.9.4

我正在使用DjangoTango教程

在第5章中,本教程教授如何创建填充脚本,该脚本可以自动为数据库创建一些数据,以便于开发.

我在manage.py的同一级别创建了一个populate_rango.py.

这是populate_rango.py:

import os

def populate():
    python_cat = add_cat('Python')

    add_page(
        cat=python_cat,
        title="Official Python Tutorial",
        url="http://docs.python.org/2/tutorial/"
    )

    add_page(
        cat=python_cat,
        title="How to Think like a Computer Scientist",
        url="http://www.greenteapress.com/thinkpython/"
    )

    add_page(
        cat=python_cat,
        title="Learn Python in 10 Minutes",
        url="http://www.korokithakis.net/tutorials/python/"
    )

    django_cat = add_cat("Django")

    add_page(
        cat=django_cat,
        title="Official Django Tutorial",
        url="https://docs.djangoproject.com/en/1.5/intro/tutorial01/"
    )

    add_page(
        cat=django_cat,
        title="Django Rocks",
        url="http://www.djangorocks.com/"
    )

    add_page(
        cat=django_cat,
        title="How to Tango with Django",
        url="http://www.tangowithdjango.com/"
    )

    frame_cat = add_cat("Other Frameworks")

    add_page(
        cat=frame_cat,
        title="Bottle",
        url="http://bottlepy.org/docs/dev/"
    ) …
Run Code Online (Sandbox Code Playgroud)

python django django-1.7

37
推荐指数
1
解决办法
2万
查看次数

标签 统计

django ×1

django-1.7 ×1

python ×1