Request Method: GET
Request URL: http://localhost:8080/user/create
Django Version: 1.5.1
Exception Type: TypeError
Exception Value: ____init____() got an unexpected keyword argument 'instance'
Exception Location: /place/venv/local/lib/python2.7/site-packages/django/views/generic/edit.py in get_form, line 35
Python Executable: /place/venv/bin/python
Python Version: 2.7.3
Run Code Online (Sandbox Code Playgroud)
class UserCreateView(CreateView):
model = models.User
form_class = forms.UserForm
Run Code Online (Sandbox Code Playgroud)
url(r'^user/create$', UserCreateView.as_view(), name='user_create'),
Run Code Online (Sandbox Code Playgroud)
class UserForm(forms.Form):
GROUP_CHOICES = [(-1, '[Choose]')]
GROUP_CHOICES += [(group.id, group.name.capitalize()) for group in auth.models.Group.objects.all()]
email = forms.EmailField(
label='Email',
widget=forms.TextInput(attrs={'placeholder': 'Email'})
)
first_name = forms.CharField(
label='First Name',
widget=forms.TextInput(attrs={'placeholder': 'First Name'})
)
last_name …
Run Code Online (Sandbox Code Playgroud) 追溯:
[2014-09-16 17:27:04,912: ERROR/MainProcess] Task my_project.tasks.get_items[8481cd42-ec19-441f-b32d-03280570053c] raised unexpected: BdbQuit()
Traceback (most recent call last):
File "/vagrant/venv/local/lib/python2.7/site-packages/celery/app/trace.py", line 240, in trace_task
R = retval = fun(*args, **kwargs)
File "/vagrant/venv/local/lib/python2.7/site-packages/celery/app/trace.py", line 437, in __protected_call__
return self.run(*args, **kwargs)
File "/vagrant/my_project/my_app/tasks.py", line 21, in get_items
logging.debug('{} {}'.format(settings.API_KEY, settings.API_SECRET))
File "/vagrant/my_project/my_app/tasks.py", line 21, in get_items
logging.debug('{} {}'.format(settings.API_KEY, settings.API_SECRET))
File "/usr/lib/python2.7/bdb.py", line 49, in trace_dispatch
return self.dispatch_line(frame)
File "/usr/lib/python2.7/bdb.py", line 68, in dispatch_line
if self.quitting: raise BdbQuit
BdbQuit
Run Code Online (Sandbox Code Playgroud)
我检查了这个问题并尝试使用celery.contrib.rdb但在执行 telnet 后我被发送到:
vagrant@vagrant-ubuntu-trusty-64:~$ …
Run Code Online (Sandbox Code Playgroud) 我需要在Ubuntu 14.04上从Python 2.6的源代码编译和安装M2Crypto 0.20.1.我现在无法迁移到Python2.7,但我们正在计划.我从https://launchpad.net/~fkrull/+archive/deadsnakes安装了Python2.6 .我安装了libssl-dev和python2.6-dev,文件/usr/include/x86_64-linux-gnu/openssl/opensslconf.h具有644作为权限并由root拥有.
但是setup.py install
对于M2Crypto失败如下:
Running setup.py install for M2Crypto
building 'M2Crypto.__m2crypto' extension
swigging SWIG/_m2crypto.i to SWIG/_m2crypto_wrap.c
swig -python -I/usr/include/python2.6 -I/usr/include -includeall -o SWIG/_m2crypto_wrap.c SWIG/_m2crypto.i
SWIG/_evp.i:9: Error: Unable to find 'openssl/opensslconf.h'
SWIG/_ec.i:7: Error: Unable to find 'openssl/opensslconf.h'
error: command 'swig' failed with exit status 1
Complete output from command /vagrant/venv/bin/python2.6 -c "import setuptools, tokenize;__file__='/vagrant/venv/build/M2Crypto/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-3vnOUl-record/install-record.txt --single-version-externally-managed --compile --install-headers /vagrant/venv/include/site/python2.6:
running install
running build
running build_py
creating build …
Run Code Online (Sandbox Code Playgroud) 我从 Node.js 世界开始,我注意到节点进程不会自动重启。
四处搜索我发现 nodemon 可以完成这项工作,但我也发现 PM2 是 nodemon 的替代品。那么我应该尝试使用 PM2 进行开发还是将其留在生产中并使用 nodemon 进行开发(这似乎很容易设置)?
我有这门课:
class Point(PointAbstract):
"""
Class used to expand shapely.geometry.Point functionality
"""
def __unicode__(self):
return '%s, %s' % (self.x, self.y)
def __repr__(self):
return '%s, %s' % (self.x, self.y)
def __str__(self):
return '%s, %s' % (self.x, self.y)
Run Code Online (Sandbox Code Playgroud)
当我尝试通过ipdb评估实例时,我得到:
> /home/...
151 p = Point(float(each[4]), float(each[3]))
--> 152 for i, _each in enumerate(headers):
153 if not _each in headers_to_ignore:
ipdb> p
*** SyntaxError: SyntaxError('unexpected EOF while parsing', ('<string>', 0, 0, ''))
Run Code Online (Sandbox Code Playgroud)
我希望有类似的东西:
123.0, 321.0
Run Code Online (Sandbox Code Playgroud)
我错过了什么?