- r - 以节省内存的方式增长 data.frame
- ruby-on-rails - ruby/ruby on rails 内存泄漏检测
- android - 无法解析导入android.support.v7.app
- UNIX 域套接字与共享内存(映射文件)
所以我正在开发我的应用程序并向我的模型添加了一个 slugfield。然后像往常一样继续执行 makemigrations
,出现了一堵巨大的红色错误墙。
Traceback (most recent call last):
File "C:\Users\Andreas\ReaderProject\lib\site-packages\django\db\backends\utils.py", line 64, in execute
return self.cursor.execute(sql, params)
File "C:\Users\Andreas\ReaderProject\lib\site-packages\django\db\backends\sqlite3\base.py", line 337, in execute
return Database.Cursor.execute(self, query, params)
sqlite3.OperationalError: no such table: Reader_manga
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Program Files (x86)\JetBrains\PyCharm 2016.2.3\helpers\pycharm\django_manage.py", line 41, in <module>
run_module(manage_file, None, '__main__', True)
File "C:\Users\Andreas\AppData\Local\Programs\Python\Python35-32\lib\runpy.py", line 182, in run_module
return _run_module_code(code, init_globals, run_name, mod_spec)
File "C:\Users\Andreas\AppData\Local\Programs\Python\Python35-32\lib\runpy.py", line 96, in _run_module_code
mod_name, mod_spec, pkg_name, script_name)
File "C:\Users\Andreas\AppData\Local\Programs\Python\Python35-32\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "D:/WindowsFolders/Documents/Python/ReaderProject\manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "C:\Users\Andreas\ReaderProject\lib\site-packages\django\core\management\__init__.py", line 367, in execute_from_command_line
utility.execute()
File "C:\Users\Andreas\ReaderProject\lib\site-packages\django\core\management\__init__.py", line 359, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "C:\Users\Andreas\ReaderProject\lib\site-packages\django\core\management\base.py", line 294, in run_from_argv
self.execute(*args, **cmd_options)
File "C:\Users\Andreas\ReaderProject\lib\site-packages\django\core\management\base.py", line 342, in execute
self.check()
File "C:\Users\Andreas\ReaderProject\lib\site-packages\django\core\management\base.py", line 374, in check
include_deployment_checks=include_deployment_checks,
File "C:\Users\Andreas\ReaderProject\lib\site-packages\django\core\management\base.py", line 361, in _run_checks
return checks.run_checks(**kwargs)
File "C:\Users\Andreas\ReaderProject\lib\site-packages\django\core\checks\registry.py", line 81, in run_checks
new_errors = check(app_configs=app_configs)
File "C:\Users\Andreas\ReaderProject\lib\site-packages\django\core\checks\urls.py", line 14, in check_url_config
return check_resolver(resolver)
File "C:\Users\Andreas\ReaderProject\lib\site-packages\django\core\checks\urls.py", line 24, in check_resolver
for pattern in resolver.url_patterns:
File "C:\Users\Andreas\ReaderProject\lib\site-packages\django\utils\functional.py", line 35, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File "C:\Users\Andreas\ReaderProject\lib\site-packages\django\urls\resolvers.py", line 313, in url_patterns
patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
File "C:\Users\Andreas\ReaderProject\lib\site-packages\django\utils\functional.py", line 35, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File "C:\Users\Andreas\ReaderProject\lib\site-packages\django\urls\resolvers.py", line 306, in urlconf_module
return import_module(self.urlconf_name)
File "C:\Users\Andreas\AppData\Local\Programs\Python\Python35-32\lib\importlib\__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 986, in _gcd_import
File "<frozen importlib._bootstrap>", line 969, in _find_and_load
File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 662, in exec_module
File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
File "D:/WindowsFolders/Documents/Python/ReaderProject\ReaderProject\urls.py", line 25, in <module>
from Reader import views
File "D:/WindowsFolders/Documents/Python/ReaderProject\Reader\views.py", line 7, in <module>
from .forms import UploadForm
File "D:/WindowsFolders/Documents/Python/ReaderProject\Reader\forms.py", line 12, in <module>
class UploadForm(forms.Form):
File "D:/WindowsFolders/Documents/Python/ReaderProject\Reader\forms.py", line 15, in UploadForm
for manga in mangas:
File "C:\Users\Andreas\ReaderProject\lib\site-packages\django\db\models\query.py", line 256, in __iter__
self._fetch_all()
File "C:\Users\Andreas\ReaderProject\lib\site-packages\django\db\models\query.py", line 1087, in _fetch_all
self._result_cache = list(self.iterator())
File "C:\Users\Andreas\ReaderProject\lib\site-packages\django\db\models\query.py", line 54, in __iter__
results = compiler.execute_sql()
File "C:\Users\Andreas\ReaderProject\lib\site-packages\django\db\models\sql\compiler.py", line 835, in execute_sql
cursor.execute(sql, params)
File "C:\Users\Andreas\ReaderProject\lib\site-packages\django\db\backends\utils.py", line 79, in execute
return super(CursorDebugWrapper, self).execute(sql, params)
File "C:\Users\Andreas\ReaderProject\lib\site-packages\django\db\backends\utils.py", line 64, in execute
return self.cursor.execute(sql, params)
File "C:\Users\Andreas\ReaderProject\lib\site-packages\django\db\utils.py", line 94, in __exit__
six.reraise(dj_exc_type, dj_exc_value, traceback)
File "C:\Users\Andreas\ReaderProject\lib\site-packages\django\utils\six.py", line 685, in reraise
raise value.with_traceback(tb)
File "C:\Users\Andreas\ReaderProject\lib\site-packages\django\db\backends\utils.py", line 64, in execute
return self.cursor.execute(sql, params)
File "C:\Users\Andreas\ReaderProject\lib\site-packages\django\db\backends\sqlite3\base.py", line 337, in execute
return Database.Cursor.execute(self, query, params)
django.db.utils.OperationalError: no such table: Reader_manga
我试图删除我添加的字段但没有用。我几乎完成了 stackoverflow 上的所有建议。
我也忘记将项目添加到github,现在也没有原始数据库文件。
似乎出错的模型:
class Manga(models.Model):
COMPLETED = 'COMP'
ONGOING = 'ONG'
STATUS_CHOICES = (
(COMPLETED, 'Completed'),
(ONGOING, 'Ongoing'),
)
JAPANESE_MANGA = 'JM'
KOREAN_MANGA = 'KM'
CHINESE_MANGA = 'CM'
UNKNOWN_MANGA = 'UM'
TYPE_CHOICES = (
(JAPANESE_MANGA, 'Japanese Manga'),
(KOREAN_MANGA, 'Korean Manhwa'),
(CHINESE_MANGA, 'Chinese Manhua'),
(UNKNOWN_MANGA, 'Unknown'),
)
authors = models.ManyToManyField(Author)
genres = models.ManyToManyField(Genre)
name = models.CharField(max_length=255, default="")
image = models.ImageField(upload_to=upload_manga_cover)
summary = models.TextField(max_length=1000)
rating = models.IntegerField(default=0)
views = models.IntegerField(default=0)
rank = models.IntegerField(default=0)
alt_names = models.TextField(max_length=400, default="")
type = models.CharField(
max_length=255,
choices=TYPE_CHOICES,
default=UNKNOWN_MANGA
)
status = models.CharField(
max_length=255,
choices=STATUS_CHOICES,
default=ONGOING,
)
released = models.DateField()
date_added = models.DateTimeField(auto_now_add=True)
date_modified = models.DateTimeField(auto_now=True)
slug = models.SlugField(unique=True)
def __str__(self):
return self.name
告诉我您还需要了解什么才能提供帮助,我会添加。
最佳答案
我的解决方法是运行
python manage.py makemigrations app_name
代替
python manage.py makemigrations
关于django - 操作错误 : no such table,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39963899/
这个问题在这里已经有了答案: What is the best way to parse html in C#? [closed] (15 个答案) 关闭 3 年前。 string input =
为什么 wrapper #4 没有继承其父表容器的高度?表格嵌套在一个显示 block 包装器中,每个嵌套的div是显示表格,每个表格继承到最里面的一个。是什么原因造成的,我该如何解决? jsfidd
我正在使用带有 Bootstrap 的自定义 css 作为外边框。但顶部边框不可见,除非我将其大小设置为 2 px。 我该如何解决这个问题? HTML #name 1.one 2.two 3.thr
我正在逻辑层面上设计一个数据库,以便稍后将其传递给程序员来交付。我只是粗略地了解它们的工作原理,所以我很难简洁地表达我的问题。这是我的问题: 我有一个名为 MEANINGS 的表。 我有一个名为 WO
在 Laravel 上,我们可以使用 DB::table('table')->get(); 或使用 model::('table')->all() 进行访问;我的问题是它们之间有什么区别? 谢谢。 最
我试图从以下内容中抓取 URL从 WorldOMeter 获取 CoVid 数据,在此页面上存在一个表,id 为:main_table_countries_today其中包含我希望收集的 15x225
这是我的图表数据库:/image/CGAwh.png 我用 SEQUELIZE 制作了我的数据库模型: 型号:级别 module.exports = (sequelize, DataTypes) =>
我真的不明白为什么我的代码不能按预期工作。当我将鼠标悬停在表格的每一行上时,我想显示一个图像(来 self 之前加载的 JSON)。每个图像根据行的不同而不同,我想将它们显示在表格之外的另一个元素中。
假设我的数据库中有一张地铁 map ,其中每条线路的每个站点都是一行。如果我想知道我的线路在哪里互连: mysql> SELECT LineA.stop_id FROM LineA, LineB WH
我最近经常使用这些属性,尤其是 display: table-cell。它在现代浏览器中得到了很好的支持,并且它对某些网格有很多好处,并且可以非常轻松地对齐内容,而无需棘手的标记。但在过去的几天里,我
在 CSS 中,我可以这样做: http://s1.ipicture.ru/uploads/20120612/Uk1Z8iZ1.png http://s1.ipicture.ru/uploads/20
问题作为标题,我正在学习sparkSQL,但我无法很好地理解它们之间的区别。谢谢。 最佳答案 spark.table之间没有区别& spark.read.table功能。 内部 spark.read.
我正在尝试根据 this answer 删除表上的非空约束.但是,它似乎没有在 sqlite_sequence 中创建条目。这样做之后,即使我可以在使用测试表时让它正常工作。 有趣的是,如果我备份我的
var otable = new sap.m.Table();//here table is created //here multiple header I'm trying to create t
下面两种方法有什么区别: 内存 性能 答: select table.id from table B: select a.id from table a 谢谢(抱歉,如果我的问题重复)。 最佳答案 完
我尝试在表格后添加点,方法是使用 table::after 选择器创建一个点元素并使用 margin: 5px auto 5px auto; 将其居中。它有效,但似乎在第一个表格列之后添加了点,而不是
我正在设计一个可以标记任何内容的数据库,我可能希望能够选择带有特定标记的所有内容。 我正在为以下两个选项而苦苦挣扎,希望得到一些建议。如果有更好的方法请告诉我。 选项A 多个“多对多”连接表。 tag
"center" div 中的下表元素导致 "left" div 中的内容从顶部偏移几个像素(在我的浏览器中为 8 ).在表格之前添加一些文本可消除此偏移量。 为什么?如何在不要求在我的表格前添加“虚
我是一名优秀的程序员,十分优秀!