GithubHelp home page GithubHelp logo

创建blogpost失败 about growth-in-action HOT 6 CLOSED

phodal avatar phodal commented on May 14, 2024 1
创建blogpost失败

from growth-in-action.

Comments (6)

phodal avatar phodal commented on May 14, 2024

嗯,是的,我再更新一下文档

from growth-in-action.

StevenYuysy avatar StevenYuysy commented on May 14, 2024

在 web 版跟着做一遍发现始终无法添加 model,还好这里给出了解决办法~ 求快更新

from growth-in-action.

phodal avatar phodal commented on May 14, 2024

@StevenYuysy 快更新是指?

from growth-in-action.

StevenYuysy avatar StevenYuysy commented on May 14, 2024

我这里需要运行 python manage.py makemigrations之后才能继续进行下去,而 web 版只说了需要 python manage.py migrate ,如果我只运行那一句的话,就提示

Operations to perform:
  Apply all migrations: admin, contenttypes, auth, sessions
Running migrations:
  No migrations to apply.
  Your models have changes that are not yet reflected in a migration, and so won't be applied.
  Run 'manage.py makemigrations' to make new migrations, and then re-run 'manage.py migrate' to apply them.

另外,如果我没有在 url.py 注释掉

#apiRouter = routers.DefaultRouter()
#apiRouter.register(r'blogpost', BlogpostSet)

urlpatterns = patterns('',
    (r'^$', 'blogpost.views.index'),
    url(r'^blog/(?P<slug>[^\.]+).html', 'blogpost.views.view_post', name='view_blog_post'),
    url(r'^admin/', include(admin.site.urls)))
#) + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)

运行python mange.py test的时候就会说 apiRouter 未定义,以及settings没有STATIC这个属性

from growth-in-action.

phodal avatar phodal commented on May 14, 2024

@StevenYuysy 感觉应该是代码和编写顺序不一致~。你都这么清楚了,可以直接来个Pull Request。

from growth-in-action.

StevenYuysy avatar StevenYuysy commented on May 14, 2024

小白一个,还不会 PR 呢。本来学前端的,最近看了你的书,想向你学习!!等我把你的这个教程吃透,还要请多指教了!

from growth-in-action.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.