我在南方工作我的django项目时遇到了麻烦,我已经按照南方文件将应用程序转换到南方并且也看了一下(为什么我的南方迁移不起作用?)但都是徒劳的.
加入南INSTALLED_APPS并运行后syncdb,
Synced:
> django.contrib.messages
> django.contrib.staticfiles
> smartmin
> nsms.console
> django_extensions
> pagination
> restaurant_detail
> live
> debug_toolbar
> orders
> django.contrib.admindocs
Not synced (use migrations):
- django.contrib.auth
- django.contrib.contenttypes
- django.contrib.sessions
- django.contrib.sites
- guardian
- south
- django_quickblocks
- rapidsms
- rapidsms_httprouter
- sorl.thumbnail
- djangoratings
- agon_ratings
- django.contrib.admin
(use ./manage.py migrate to migrate these)
Run Code Online (Sandbox Code Playgroud)
在这一点上我执行这个命令,python manage.py migrate这给出了错误django.db.utils.DatabaseError: relation "south_migrationhistory" does not exist
LINE 1: …
在我的设置中,我已经设置DEBUG=False但是这在开发和生产中都产生了500错误.所以我环顾四周并遇到了这个(设置DEBUG = False导致500错误)并尝试了它.
ALLOWED_HOSTS = ['www.heroku.com']
Run Code Online (Sandbox Code Playgroud)
但这不起作用,我做得对不对?我主持与heroku
我目前发现难以安装PIL在精确的穿山甲上.我已经按照本教程(http://www.sandersnewmedia.com/why/2012/04/16/installing-pil-virtualenv-ubuntu-1204-precise-pangolin/)
当我做:
pip install PIL
Run Code Online (Sandbox Code Playgroud)
我收到错误:
Could not find any downloads that satisfy the requirement PIL
No distributions at all found for PIL
Run Code Online (Sandbox Code Playgroud)
看着谷歌但无济于事.
我有一个领域
logo=models.ImageField(upload_to="restaurant_detail/restaurant_detail", help_text = "upload your restaurant logo")
Run Code Online (Sandbox Code Playgroud)
这会返回一个错误,Data truncated for column 'logo' at row 1
所以我继续用这个声明解决它
alter table my_table modify logo varchar(500)
Run Code Online (Sandbox Code Playgroud)
(我增加了字符.)
这有效,但每次我重置数据库时我都要再次执行此操作,当我尝试执行上面的alter语句并插入数据时,它仍然会失败并显示Data truncated for column 'logo' at row 1错误.
如何永久修复此问题而无需一直更改表格?
我正在使用Amazon S3来提供静态文件,并使用heroku作为Paas.我按照本教程.我做了一个,
python manage.py collectstatic
Run Code Online (Sandbox Code Playgroud)
在当地它工作得很好,但当我做了,
heroku run python manage.py collectstatic --noinput
Run Code Online (Sandbox Code Playgroud)
我收到错误,
django.core.exceptions.ImproperlyConfigured: Error importing storage module storages.backends.s3boto: "No module named storages.backends.s3boto"
Run Code Online (Sandbox Code Playgroud)
我在这做错了什么
所以我是一名初学程序员并正在学习编程:在cousera上制作高质量的代码课程.我有一个文件restaurant_small.txt
restaurant.txt格式是评分的餐厅,
georgieporgie:50
dumpling r us:70
queens cafe:60
Run Code Online (Sandbox Code Playgroud)
我可以逐行阅读
dictionary = {}
our_file = open(file)
#using an iterator to read files
for line in iter(our_file):
dictionary = ??
Run Code Online (Sandbox Code Playgroud)
我想能够建立一个字典{'restaurant':'rating'}
我如何去做这个,一步一步简单的欣赏
django ×5
heroku ×2
amazon-s3 ×1
django-south ×1
migration ×1
mysql ×1
python ×1
python-2.7 ×1
ubuntu ×1