-
Notifications
You must be signed in to change notification settings - Fork 548
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
创建blogpost失败 #8
Comments
嗯,是的,我再更新一下文档 |
在 web 版跟着做一遍发现始终无法添加 model,还好这里给出了解决办法~ 求快更新 |
@StevenYuysy 快更新是指? |
我这里需要运行 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) 运行 |
@StevenYuysy 感觉应该是代码和编写顺序不一致~。你都这么清楚了,可以直接来个Pull Request。 |
小白一个,还不会 PR 呢。本来学前端的,最近看了你的书,想向你学习!!等我把你的这个教程吃透,还要请多指教了! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
你好:
创建完 blogpost 之后,正确的做法是否是需要到 setting.py 里的 INSTALLED_APPS 添加
blogpost
然后再运行
python manage.py makemigrations
和python manage.py migrate
迁移。The text was updated successfully, but these errors were encountered: