from django.contrib.auth.forms import UserCreationForm
from django.shortcuts import render>>Request Method: | POST |
---|---|
>>Request URL: | http://articles/create/ |
>>Django Version: | 1.6.2 |
>>Exception Type: | IntegrityError |
>>Exception Value: | (1048, "Column 'user_id' cannot be null") |
>>Exception Location: | /usr/lib64/python2.6/site-packages/MySQLdb/connections.py in defaulterrorhandler, line 36 |
>>Python Executable: | /usr/bin/python |
>>/var/www/html/article/views.py
in create
>> form.save()
this is my views.py:
def create(request):
if request.POST:
form = ArticleForm(request.POST)
if form.is_valid():
form.save()
return HttpResponseRedirect('/articles/all')
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/a8c07540-4a96-4fb3-b429-19b9feaa5b4b%40googlegroups.com.
Thank you!
i can do create!
Sorry! i'm don't understand create staff site,
i want to create staff site , staff site should have when rogin using ID/PW and have staff profile
i'm realy don't know!
pleae help me
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/ad53110c-50e3-4010-9861-7909167cb4ab%40googlegroups.com.
Request Method: | POST |
---|---|
Request URL: | http://articles/attendance/11/ |
Django Version: | 1.6.2 |
Exception Type: | AttributeError |
Exception Value: | 'function' object has no attribute '_meta' |
Exception Location: | /usr/lib/python2.6/site-packages/django/forms/models.py in model_to_dict, line 124 |
Python Executable: | /usr/bin/python |
Python Version: | 2.6.6 |
Python Path: | ['/usr/lib/python2.6/site-packages/pip-1.5.2-py2.6.egg', '/usr/lib64/python26.zip', '/usr/lib64/python2.6', '/usr/lib64/python2.6/plat-linux2', '/usr/lib64/python2.6/lib-tk', '/usr/lib64/python2.6/lib-old', '/usr/lib64/python2.6/lib-dynload', '/usr/lib64/python2.6/site-packages', '/usr/lib/python2.6/site-packages', '/usr/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg-info', '/var/www/html/ihttest/ihttcs_test/kojin', '/var/www/html/ihttest/ihttcs_test/kojin/static/'] |
Server time: | Mon, 28 Apr 2014 11:19:29 +0900 |
/usr/lib/python2.6/site-packages/django/core/handlers/base.py
in get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)...
/var/www/html/article/views.py
in attendance
form = Attendance_dataForm(request.POST, instance = attendance)
this is my Views.py:
def attendance(request, user_id):To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/47eba7b2-fa2c-42c5-bd18-1a55d3f0ad90%40googlegroups.com.
CSRF verification failed. Request aborted.
Reason given for failure:
CSRF token missing or incorrect.
In general, this can occur when there is a genuine Cross Site Request Forgery, or when Django's CSRF mechanism has not been used correctly. For POST forms, you need to ensure:
RequestContext
for the template, instead of Context
.{% csrf_token
%}
template tag inside each POST form that
targets an internal URL.CsrfViewMiddleware
, then you must use
csrf_protect
on any views that use the csrf_token
template tag, as well as those that accept the POST data.You're seeing the help section of this page because you have DEBUG =
True
in your Django settings file. Change that to False
,
and only the initial error message will be displayed.
You can customize this page using the CSRF_FAILURE_VIEW setting.
Exception Type: | DoesNotExist |
---|---|
Exception Value: | Leavework matching query does not exist. |
Hito,
...
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/57e5ed09-9adf-4e55-9f2c-57528874b479%40googlegroups.com.