manage.py

Django CommandError: App 'polls' has migrations

橙三吉。 提交于 2019-12-09 04:24:54
问题 Trying to follow the tutorial at Django project. The problem I've come across is that when performing the command: python manage.py sql polls I'm given the error: CommandError: App 'polls' has migrations. only the sqlmigrate and sqlflush commands can be used when an app has migrations So far I can't seem to find any guide on the internet, or this website for a solution to the program. 回答1: The problem is that you are using Django 1.8 while going through 1.6 tutorial. Pay attention to the

Python 2.6 on MacOSX - ImportError: No module named _collections

偶尔善良 提交于 2019-12-08 07:33:50
问题 I'm a little bit baffled by this error I'm getting when I try to runserver or syncdb - the server was running just fine the other night when I last logged on, so I have no idea why all of a sudden it's not working. Google gave me the following page but it doesn't really address my issue. Let me know if you need more if the console information below isn't enough. I really am not very efficient with django yet, complete beginner really, and I'm not sure why this isn't working. Pythoness-410

PyCharm manage.py runserver error

旧巷老猫 提交于 2019-12-07 02:32:35
问题 Sorry to ask a noob question but I have no idea why this is happening. I've just reinstalled Django 1.3, and am trying PyCharm for the first time. When I run python manage.py runserver from Terminal everything goes without a hitch, however if I try to runserver from within PyCharm I get the following: Importing Django settings module settings Traceback (most recent call last): Validating models... 0 errors found Django version 1.3, using settings 'glist.settings' Development server is running

upgrading python django project 1.3 to 1.5

江枫思渺然 提交于 2019-12-06 03:37:39
问题 currently i have python project using django version 1.3 running on mountain lion OS and now i want to upgrade it to django 1.5. But when i put it and try to do python manage.py runserver i get an error saying Error: Can't find the file 'settings.py' in the directory containing 'manage.py'. It appears you've customized things. You'll have to run django-admin.py, passing it your settings module. (If the file settings.py does indeed exist, it's causing an ImportError somehow.) i realized that

Configuring the Django development server output

こ雲淡風輕ζ 提交于 2019-12-05 21:23:24
Is it possible to configure the output from the Django development server to show the IP address of the client making the request? This in our list for "standard mods" to new Django releases. For Django 1.2.1, in django/core/servers/basehttp.py, line 614, change: msg = "[%s] %s\n" % (self.log_date_time_string(), format % args) to msg = "[%s] %s %s\n" % (self.log_date_time_string(), self.client_address[0], format % args) mitchf Other answers I've had suggested to me: Consider Gunicorn as a dev server: http://gunicorn.org/ (orginNell) Consider using class inheritance on basehttp.py to create a

cannot open manage.py after installing django

半城伤御伤魂 提交于 2019-12-03 08:16:39
I have a problem in setting up django. My situation: I have Anaconda Python 2.7 in my Windows 8 computer. On the Anaconda command prompt window, I type: pip install django . This is successful. Then I create a folder named "newproject". On the command prompt I went to the folder "newproject". Then django-admin.py startproject newproject . This is successful. Then I run python manage.py runserver . It tells me "...can't open file 'manage.py': [Errno 2] No such file or directory" I checked out udemy django installation guide and other guides on the net. I have even set up a virtual environment.

Print sql queries in jupyter notebook with django-extensions plugin

蹲街弑〆低调 提交于 2019-11-30 09:34:20
问题 Is it possible to show SQL queries like in this command: python manage.py shell_plus --print-sql but in Jupyter Notebook? I tried this command python manage.py shell_plus --notebook --print-sql but it not worked. 回答1: It's probably a bug in Django Extensions that you don't see SQL queries. A few versions ago, someone asked here how to disable SQL printing in Jupyter. As a workaround, you could use django_print_sql: from django_print_sql import print_sql with print_sql(count_only=False): User

Print sql queries in jupyter notebook with django-extensions plugin

不打扰是莪最后的温柔 提交于 2019-11-29 16:11:53
Is it possible to show SQL queries like in this command: python manage.py shell_plus --print-sql but in Jupyter Notebook? I tried this command python manage.py shell_plus --notebook --print-sql but it not worked. It's probably a bug in Django Extensions that you don't see SQL queries. A few versions ago, someone asked here how to disable SQL printing in Jupyter. As a workaround, you could use django_print_sql : from django_print_sql import print_sql with print_sql(count_only=False): User.objects.count() You may even find that having control over which queries to print is preferable to printing