我有一个小问题,就是从https://github.com/zhebrak/django-statsy尝试exemple
文件
OperationalError at /
no such table: example_post
Request Method: GET
Request URL: http://localhost:8000/
Django Version: 1.11.5
Exception Type: OperationalError
Exception Value: no such table: example_post
Exception Location: /home/jeremie/.virtualenvs/statsy/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py in execute_sql, line 894
Python Executable: /home/jeremie/.virtualenvs/statsy/bin/python
Python Version: 2.7.12
Python Path:
['/home/jeremie/django-statsy',
'/home/jeremie/.virtualenvs/statsy/lib/python2.7',
'/home/jeremie/.virtualenvs/statsy/lib/python2.7/plat-x86_64-linux-gnu',
'/home/jeremie/.virtualenvs/statsy/lib/python2.7/lib-tk',
'/home/jeremie/.virtualenvs/statsy/lib/python2.7/lib-old',
'/home/jeremie/.virtualenvs/statsy/lib/python2.7/lib-dynload',
'/usr/lib/python2.7',
'/usr/lib/python2.7/plat-x86_64-linux-gnu',
'/usr/lib/python2.7/lib-tk',
'/home/jeremie/.virtualenvs/statsy/local/lib/python2.7/site-packages',
'/home/jeremie/.virtualenvs/statsy/lib/python2.7/site-packages',
'/home/jeremie/django-statsy']
Server time: Fri, 15 Sep 2017 15:13:34 -0500
以下是我目前所做的:
git clone https://github.com/zhebrak/django-statsy.git
mkvirtualenv statsy
cd django-statsy
workon statsy
pip install -r requirements.txt
python manage.py makemigrations
python manage.py migrate
python manage.py runserver
我只想在example
文件中输入,看看结果是什么类型的,并测试应用程序本身。为什么我有这个问题?如果我在一个使用Django 1.10
和python 2.7
的项目中工作,你推荐这个应用程序吗?在
下面是我运行localhost:8000
时的结果:image
我怎样才能检验出给出的例子呢?在
根据您在评论中的回复,您似乎还没有创建
example_post
数据库表。{{{3>要在cd2>文件中添加设置,请执行以下操作:如果
example
应用程序不在INSTALLED_APPS
中,则不会创建数据库迁移文件,也不会创建表。在相关问题 更多 >
编程相关推荐