This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.
Closed 10 years ago.
I am testing django-userena demo project. I have installed sendmail.
I see this error when I sign up:
Environment:
Request Method: POST
Request URL: http://127.0.0.1:8000/accounts/signup/
Django Version: 1.3.1
Python Version: 2.7.2
Installed Applications:
['django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.admin',
'easy_thumbnails',
'guardian',
'south',
'userena',
'userena.contrib.umessages',
'demo_project.profiles']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'userena.middleware.UserenaLocaleMiddleware')
Traceback:
File "/home/elie/.django-projects/showpill/local/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
111. response = callback(request, *callback_args, **callback_kwargs)
File "/home/elie/.django-projects/showpill/local/lib/python2.7/site-packages/userena/decorators.py" in _wrapped_view
28. return view_func(request, *args, **kwargs)
File "/home/elie/.django-projects/showpill/local/lib/python2.7/site-packages/userena/views.py" in signup
69. if form.is_valid():
File "/home/elie/.django-projects/showpill/local/lib/python2.7/site-packages/django/forms/forms.py" in is_valid
121. return self.is_bound and not bool(self.errors)
File "/home/elie/.django-projects/showpill/local/lib/python2.7/site-packages/django/forms/forms.py" in _get_errors
112. self.full_clean()
File "/home/elie/.django-projects/showpill/local/lib/python2.7/site-packages/django/forms/forms.py" in full_clean
267. self._clean_fields()
File "/home/elie/.django-projects/showpill/local/lib/python2.7/site-packages/django/forms/forms.py" in _clean_fields
287. value = getattr(self, 'clean_%s' % name)()
File "/home/elie/.django-projects/showpill/local/lib/python2.7/site-packages/userena/forms.py" in clean_username
49. user = User.objects.get(username__iexact=self.cleaned_data['username'])
File "/home/elie/.django-projects/showpill/local/lib/python2.7/site-packages/django/db/models/manager.py" in get
132. return self.get_query_set().get(*args, **kwargs)
File "/home/elie/.django-projects/showpill/local/lib/python2.7/site-packages/django/db/models/query.py" in get
344. num = len(clone)
File "/home/elie/.django-projects/showpill/local/lib/python2.7/site-packages/django/db/models/query.py" in __len__
82. self._result_cache = list(self.iterator())
File "/home/elie/.django-projects/showpill/local/lib/python2.7/site-packages/django/db/models/query.py" in iterator
273. for row in compiler.results_iter():
File "/home/elie/.django-projects/showpill/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py" in results_iter
680. for rows in self.execute_sql(MULTI):
File "/home/elie/.django-projects/showpill/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py" in execute_sql
735. cursor.execute(sql, params)
File "/home/elie/.django-projects/showpill/local/lib/python2.7/site-packages/django/db/backends/util.py" in execute
34. return self.cursor.execute(sql, params)
File "/home/elie/.django-projects/showpill/local/lib/python2.7/site-packages/django/db/backends/mysql/base.py" in execute
86. return self.cursor.execute(query, args)
File "/home/elie/.django-projects/showpill/local/lib/python2.7/site-packages/MySQLdb/cursors.py" in execute
174. self.errorhandler(self, exc, value)
File "/home/elie/.django-projects/showpill/local/lib/python2.7/site-packages/MySQLdb/connections.py" in defaulterrorhandler
36. raise errorclass, errorvalue
Exception Type: DatabaseError at /accounts/signup/
Exception Value: (1146, "Table 'demo_project.auth_user' doesn't exist")
edit
Sorry I couldn't update this question earlier, i was so busy, when I run syncdb, i see this error
Environment:
Request Method: POST
Request URL: http://127.0.0.1:8000/accounts/signup/
Django Version: 1.3.1
Python Version: 2.7.2
Installed Applications:
['django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.admin',
'easy_thumbnails',
'guardian',
'south',
'userena',
'userena.contrib.umessages',
'demo_project.profiles']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'userena.middleware.UserenaLocaleMiddleware')
Traceback:
File "/home/elie/.django-projects/showpill/local/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
111. response = callback(request, *callback_args, **callback_kwargs)
File "/home/elie/.django-projects/showpill/local/lib/python2.7/site-packages/userena/decorators.py" in _wrapped_view
28. return view_func(request, *args, **kwargs)
File "/home/elie/.django-projects/showpill/local/lib/python2.7/site-packages/userena/views.py" in signup
70. user = form.save()
File "/home/elie/.django-projects/showpill/local/lib/python2.7/site-packages/userena/forms.py" in save
86. userena_settings.USERENA_ACTIVATION_REQUIRED)
File "/home/elie/.django-projects/showpill/local/lib/python2.7/site-packages/userena/managers.py" in create_user
62. userena_profile = self.create_userena_profile(new_user)
File "/home/elie/.django-projects/showpill/local/lib/python2.7/site-packages/userena/managers.py" in create_userena_profile
104. activation_key=activation_key)
File "/home/elie/.django-projects/showpill/local/lib/python2.7/site-packages/django/db/models/manager.py" in create
138. return self.get_query_set().create(**kwargs)
File "/home/elie/.django-projects/showpill/local/lib/python2.7/site-packages/django/db/models/query.py" in create
360. obj.save(force_insert=True, using=self.db)
File "/home/elie/.django-projects/showpill/local/lib/python2.7/site-packages/django/db/models/base.py" in save
460. self.save_base(using=using, force_insert=force_insert, force_update=force_update)
File "/home/elie/.django-projects/showpill/local/lib/python2.7/site-packages/django/db/models/base.py" in save_base
553. result = manager._insert(values, return_id=update_pk, using=using)
File "/home/elie/.django-projects/showpill/local/lib/python2.7/site-packages/django/db/models/manager.py" in _insert
195. return insert_query(self.model, values, **kwargs)
File "/home/elie/.django-projects/showpill/local/lib/python2.7/site-packages/django/db/models/query.py" in insert_query
1436. return query.get_compiler(using=using).execute_sql(return_id)
File "/home/elie/.django-projects/showpill/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py" in execute_sql
791. cursor = super(SQLInsertCompiler, self).execute_sql(None)
File "/home/elie/.django-projects/showpill/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py" in execute_sql
735. cursor.execute(sql, params)
File "/home/elie/.django-projects/showpill/local/lib/python2.7/site-packages/django/db/backends/util.py" in execute
34. return self.cursor.execute(sql, params)
File "/home/elie/.django-projects/showpill/local/lib/python2.7/site-packages/django/db/backends/mysql/base.py" in execute
86. return self.cursor.execute(query, args)
File "/home/elie/.django-projects/showpill/local/lib/python2.7/site-packages/MySQLdb/cursors.py" in execute
174. self.errorhandler(self, exc, value)
File "/home/elie/.django-projects/showpill/local/lib/python2.7/site-packages/MySQLdb/connections.py" in defaulterrorhandler
36. raise errorclass, errorvalue
Exception Type: DatabaseError at /accounts/signup/
Exception Value: (1146, "Table 'demo_project.userena_userenasignup' doesn't exist")
2nd EDIT
this is the output of syncdb
Syncing...
Creating tables ...
Installing custom SQL ...
Installing indexes ...
No fixtures found.
Synced:
> django.contrib.auth
> django.contrib.contenttypes
> django.contrib.sessions
> django.contrib.sites
> django.contrib.messages
> django.contrib.admin
> south
> demo_project.profiles
Not synced (use migrations):
- easy_thumbnails
- guardian
- userena
- userena.contrib.umessages
(use ./manage.py migrate to migrate these)
This is the output of ./manage.py migrate
Running migrations for easy_thumbnails:
- Nothing to migrate.
- Loading initial data for easy_thumbnails.
No fixtures found.
Running migrations for guardian:
- Nothing to migrate.
- Loading initial data for guardian.
No fixtures found.
Running migrations for userena:
- Nothing to migrate.
- Loading initial data for userena.
No fixtures found.
Running migrations for umessages:
- Nothing to migrate.
- Loading initial data for umessages.
No fixtures found.
please note that eventhough i am seeing the error, the username and email are being saved in the db.
if I login, it says your account has been disabled
if i try to reset my password it says
That e-mail address doesn't have an associated user account. Are you sure you've registered?
You need to run syncdb: manage.py syncdb
You've worked out that you need to also use the various south commands.
Now two questions arise: are you still getting these errors after running south (I assume you are); and secondly, does the table specified in the error message (Exception Value: (1146, "Table 'demo_project.userena_userenasignup' doesn't exist")) actually exist? Examine your database to work out if the table exists, and if so, if it exists in the right database.
I think you need to delete your database. Then do a manage.py syncdb and a manage.py migrate again on a fresh DB. When you run manage.py migrate it shouldn't give you the output you posted. Your output doesn't change or create any tables and that could be the issue. Perhaps the table you need hasn't been created.
This is what the output should look like after a manage.py syncdb.
This is what the output should look like after a manage.py migrate.
You should have 21 tables in total for the demo_project provided with userena.
For general help the steps to get this project working should be.
Create a virtual environment and pip install django-userena
Pull out the demo_project that comes with userena
Activate the virtualenv, cd to the project dir and do your manage.py syncdb and manage.py migrate
Run the project
I have done this now and can confirm that the demo_project will work if these steps are done.
*Remember that if you signup a user on the /accounts/signup/ page. That this user will not be able to signin to the /admin/ by default. And your superuser user will not be able to access his profile under /accounts/(profile)/ unless you give him a profile in the admin.
Related
Django==1.11.3, wagtail==1.11.1
I did a backup of my PostgreSQL on remote server and did a restore on my local server so I can get an exact copy of all the changes. I've done it this way for a long long time and its always worked like a charm. But this time, I did the restore and got the error below:
column wagtailcore_page.draft_title does not exist
LINE 1: ...ore_page"."numchild", "wagtailcore_page"."title", "wagtailco...
I deleted my database and restored fresh but that did nothing. I deleted all migrations, did the --fake migration to try and reset, but nothing; still getting the error. I am at a loss on this one and could use some feedback. Thank you.
Here's my trace file:
Environment:
Request Method: GET
Request URL: http://127.0.0.1:8001/
Django Version: 1.11.3
Python Version: 3.5.0
Installed Applications:
['app',
'home',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.sites',
'django_summernote',
'rest_framework',
'wagtail.contrib.settings',
'wagtail.contrib.modeladmin',
'wagtail.wagtailcore',
'wagtail.wagtailadmin',
'wagtail.wagtaildocs',
'wagtail.wagtailsnippets',
'wagtail.wagtailusers',
'wagtail.wagtailimages',
'wagtail.wagtailembeds',
'wagtail.wagtailsearch',
'wagtail.wagtailsites',
'wagtail.wagtailredirects',
'wagtail.wagtailforms',
'wagtail.contrib.wagtailsitemaps',
'wagtail.contrib.wagtailroutablepage',
'wagtail.contrib.wagtailstyleguide',
'wagtailmenus',
'compressor',
'taggit',
'modelcluster',
'docs',
'wagtail.contrib.table_block']
Installed Middleware:
['django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'wagtail.wagtailcore.middleware.SiteMiddleware',
'wagtail.wagtailredirects.middleware.RedirectMiddleware']
Traceback:
File "/Users/rooster/.pyenv/versions/3.5.0/envs/alpha_omega/lib/python3.5/site-packages/django/db/backends/utils.py" in execute
65. return self.cursor.execute(sql, params)
The above exception (column wagtailcore_page.draft_title does not exist
LINE 1: ...ore_page"."numchild", "wagtailcore_page"."title", "wagtailco...
^
) was the direct cause of the following exception:
File "/Users/rooster/.pyenv/versions/3.5.0/envs/alpha_omega/lib/python3.5/site-packages/django/core/handlers/exception.py" in inner
41. response = get_response(request)
File "/Users/rooster/.pyenv/versions/3.5.0/envs/alpha_omega/lib/python3.5/site-packages/django/core/handlers/base.py" in _legacy_get_response
244. response = middleware_method(request)
File "/Users/rooster/.pyenv/versions/3.5.0/envs/alpha_omega/lib/python3.5/site-packages/wagtail/wagtailcore/middleware.py" in process_request
20. request.site = Site.find_for_request(request)
File "/Users/rooster/.pyenv/versions/3.5.0/envs/alpha_omega/lib/python3.5/site-packages/wagtail/wagtailcore/models.py" in find_for_request
129. return get_site_for_hostname(hostname, port)
File "/Users/rooster/.pyenv/versions/3.5.0/envs/alpha_omega/lib/python3.5/site-packages/wagtail/wagtailcore/sites.py" in get_site_for_hostname
38. 'root_page'
File "/Users/rooster/.pyenv/versions/3.5.0/envs/alpha_omega/lib/python3.5/site-packages/django/db/models/query.py" in __iter__
250. self._fetch_all()
File "/Users/rooster/.pyenv/versions/3.5.0/envs/alpha_omega/lib/python3.5/site-packages/django/db/models/query.py" in _fetch_all
1118. self._result_cache = list(self._iterable_class(self))
File "/Users/rooster/.pyenv/versions/3.5.0/envs/alpha_omega/lib/python3.5/site-packages/django/db/models/query.py" in __iter__
53. results = compiler.execute_sql(chunked_fetch=self.chunked_fetch)
File "/Users/rooster/.pyenv/versions/3.5.0/envs/alpha_omega/lib/python3.5/site-packages/django/db/models/sql/compiler.py" in execute_sql
886. raise original_exception
File "/Users/rooster/.pyenv/versions/3.5.0/envs/alpha_omega/lib/python3.5/site-packages/django/db/models/sql/compiler.py" in execute_sql
876. cursor.execute(sql, params)
File "/Users/rooster/.pyenv/versions/3.5.0/envs/alpha_omega/lib/python3.5/site-packages/django/db/backends/utils.py" in execute
80. return super(CursorDebugWrapper, self).execute(sql, params)
File "/Users/rooster/.pyenv/versions/3.5.0/envs/alpha_omega/lib/python3.5/site-packages/django/db/backends/utils.py" in execute
65. return self.cursor.execute(sql, params)
File "/Users/rooster/.pyenv/versions/3.5.0/envs/alpha_omega/lib/python3.5/site-packages/django/db/utils.py" in __exit__
94. six.reraise(dj_exc_type, dj_exc_value, traceback)
File "/Users/rooster/.pyenv/versions/3.5.0/envs/alpha_omega/lib/python3.5/site-packages/django/utils/six.py" in reraise
685. raise value.with_traceback(tb)
File "/Users/rooster/.pyenv/versions/3.5.0/envs/alpha_omega/lib/python3.5/site-packages/django/db/backends/utils.py" in execute
65. return self.cursor.execute(sql, params)
Exception Type: ProgrammingError at /
Exception Value: column wagtailcore_page.draft_title does not exist
LINE 1: ...ore_page"."numchild", "wagtailcore_page"."title", "wagtailco...
^
the error is due to the fact that you have not migrated the newest version of wagtail. just run python manage.py migrate and when you see it running, this will appear:
Running migrations:
Rendering model states ... DONE
Applying
wagtailcore.0040_page_draft_title
... OK
rerun your project and you're done.
After restoring your database backup, you need to run ./manage.py migrate. draft_title was added in Wagtail 1.11, so presumably your backup is from a site running Wagtail 1.10 or earlier.
(Running --fake is the opposite of what you want... it tells Django not to run any of the outstanding migrations, including the one that adds the draft_title column.)
I try to get my django page running on my server and stumble upon the following error message in my browser:
SuspiciousOperation at /lfp/filter/
The request's session was deleted before the request completed. The
user may have logged out in a concurrent request, for example.
The traceback you can find here:
Environment:
Request Method: GET
Request URL: http://localhost/pass/lfp/filter/
Django Version: 1.11.2
Python Version: 3.6.1
Installed Applications:
['django_tables2',
'pass_list.apps.PassListConfig',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles']
Installed Middleware:
['django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware']
Traceback:
File "/lib/python3.6/site-packages/django/db/backends/utils.py" in execute
65. return self.cursor.execute(sql, params)
File "/lib/python3.6/site-packages/django/db/backends/sqlite3/base.py" in execute
328. return Database.Cursor.execute(self, query, params)
The above exception (attempt to write a readonly database) was the direct cause of the following exception:
File "/lib/python3.6/site-packages/django/contrib/sessions/backends/db.py" in save
87. obj.save(force_insert=must_create, force_update=not must_create, using=using)
File "/lib/python3.6/site-packages/django/db/models/base.py" in save
806. force_update=force_update, update_fields=update_fields)
File "/lib/python3.6/site-packages/django/db/models/base.py" in save_base
836. updated = self._save_table(raw, cls, force_insert, force_update, using, update_fields)
File "/lib/python3.6/site-packages/django/db/models/base.py" in _save_table
903. forced_update)
File "/lib/python3.6/site-packages/django/db/models/base.py" in _do_update
953. return filtered._update(values) > 0
File "/lib/python3.6/site-packages/django/db/models/query.py" in _update
664. return query.get_compiler(self.db).execute_sql(CURSOR)
File "/lib/python3.6/site-packages/django/db/models/sql/compiler.py" in execute_sql
1191. cursor = super(SQLUpdateCompiler, self).execute_sql(result_type)
File "/lib/python3.6/site-packages/django/db/models/sql/compiler.py" in execute_sql
886. raise original_exception
File "/lib/python3.6/site-packages/django/db/models/sql/compiler.py" in execute_sql
876. cursor.execute(sql, params)
File "/lib/python3.6/site-packages/django/db/backends/utils.py" in execute
80. return super(CursorDebugWrapper, self).execute(sql, params)
File "/lib/python3.6/site-packages/django/db/backends/utils.py" in execute
65. return self.cursor.execute(sql, params)
File "/lib/python3.6/site-packages/django/db/utils.py" in __exit__
94. six.reraise(dj_exc_type, dj_exc_value, traceback)
File "/lib/python3.6/site-packages/django/utils/six.py" in reraise
685. raise value.with_traceback(tb)
File "/lib/python3.6/site-packages/django/db/backends/utils.py" in execute
65. return self.cursor.execute(sql, params)
File "/lib/python3.6/site-packages/django/db/backends/sqlite3/base.py" in execute
328. return Database.Cursor.execute(self, query, params)
During handling of the above exception (attempt to write a readonly database), another exception occurred:
File "/lib/python3.6/site-packages/django/contrib/sessions/middleware.py" in process_response
58. request.session.save()
File "/lib/python3.6/site-packages/django/contrib/sessions/backends/db.py" in save
94. raise UpdateError
During handling of the above exception (), another exception occurred:
File "/lib/python3.6/site-packages/django/core/handlers/exception.py" in inner
41. response = get_response(request)
File "/lib/python3.6/site-packages/django/utils/deprecation.py" in __call__
142. response = self.process_response(request, response)
File "/lib/python3.6/site-packages/django/contrib/sessions/middleware.py" in process_response
61. "The request's session was deleted before the "
Exception Type: SuspiciousOperation at /lfp/filter/
Exception Value: The request's session was deleted before the request completed. The user may have logged out in a concurrent request, for example.
How can I solve that issue?
I solved my problem. It was a problem with the access management. The file db.sqlite3 was just readable. Changing the rights solved my problem.
I know there's already a same question, i too tried the solutions given their but it dint work for me hence i am writing my own question.
Hii all, i am deploying django server using apache2 server and when i tried my host Ip address it works fine as it displays it Worked page, it works for IPADRESS/admin also but after filling in the credentials and hit on enter will produce this error
***OperationalError at /admin/login/
unable to open database file***
and my error looks like
Environment:
Request Method: POST
Request URL: http://192.168.1.105/admin/login/?next=/admin/
Django Version: 1.7.4
Python Version: 2.7.6
Installed Applications:
('django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'managementdashboard')
Installed Middleware:
('django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware')
Traceback:
File "/var/www/dashboardapp/env/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
111. response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/var/www/dashboardapp/env/lib/python2.7/site-packages/django/views/decorators/cache.py" in _wrapped_view_func
52. response = view_func(request, *args, **kwargs)
File "/var/www/dashboardapp/env/lib/python2.7/site-packages/django/contrib/admin/sites.py" in login
361. return login(request, **defaults)
File "/var/www/dashboardapp/env/lib/python2.7/site-packages/django/views/decorators/debug.py" in sensitive_post_parameters_wrapper
76. return view(request, *args, **kwargs)
File "/var/www/dashboardapp/env/lib/python2.7/site-packages/django/utils/decorators.py" in _wrapped_view
105. response = view_func(request, *args, **kwargs)
File "/var/www/dashboardapp/env/lib/python2.7/site-packages/django/views/decorators/cache.py" in _wrapped_view_func
52. response = view_func(request, *args, **kwargs)
File "/var/www/dashboardapp/env/lib/python2.7/site-packages/django/contrib/auth/views.py" in login
44. auth_login(request, form.get_user())
File "/var/www/dashboardapp/env/lib/python2.7/site-packages/django/contrib/auth/__init__.py" in login
96. request.session.cycle_key()
File "/var/www/dashboardapp/env/lib/python2.7/site-packages/django/contrib/sessions/backends/base.py" in cycle_key
279. self.create()
File "/var/www/dashboardapp/env/lib/python2.7/site-packages/django/contrib/sessions/backends/db.py" in create
41. self.save(must_create=True)
File "/var/www/dashboardapp/env/lib/python2.7/site-packages/django/contrib/sessions/backends/db.py" in save
64. obj.save(force_insert=must_create, using=using)
File "/var/www/dashboardapp/env/lib/python2.7/site-packages/django/db/models/base.py" in save
589. force_update=force_update, update_fields=update_fields)
File "/var/www/dashboardapp/env/lib/python2.7/site-packages/django/db/models/base.py" in save_base
617. updated = self._save_table(raw, cls, force_insert, force_update, using, update_fields)
File "/var/www/dashboardapp/env/lib/python2.7/site-packages/django/db/models/base.py" in _save_table
698. result = self._do_insert(cls._base_manager, using, fields, update_pk, raw)
File "/var/www/dashboardapp/env/lib/python2.7/site-packages/django/db/models/base.py" in _do_insert
731. using=using, raw=raw)
File "/var/www/dashboardapp/env/lib/python2.7/site-packages/django/db/models/manager.py" in manager_method
92. return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/var/www/dashboardapp/env/lib/python2.7/site-packages/django/db/models/query.py" in _insert
921. return query.get_compiler(using=using).execute_sql(return_id)
File "/var/www/dashboardapp/env/lib/python2.7/site-packages/django/db/models/sql/compiler.py" in execute_sql
920. cursor.execute(sql, params)
File "/var/www/dashboardapp/env/lib/python2.7/site-packages/django/db/backends/utils.py" in execute
81. return super(CursorDebugWrapper, self).execute(sql, params)
File "/var/www/dashboardapp/env/lib/python2.7/site-packages/django/db/backends/utils.py" in execute
65. return self.cursor.execute(sql, params)
File "/var/www/dashboardapp/env/lib/python2.7/site-packages/django/db/utils.py" in __exit__
94. six.reraise(dj_exc_type, dj_exc_value, traceback)
File "/var/www/dashboardapp/env/lib/python2.7/site-packages/django/db/backends/utils.py" in execute
65. return self.cursor.execute(sql, params)
File "/var/www/dashboardapp/env/lib/python2.7/site-packages/django/db/backends/sqlite3/base.py" in execute
485. return Database.Cursor.execute(self, query, params)
Exception Type: OperationalError at /admin/login/
Exception Value: unable to open database file
Need help as son as possible, thank you in advance.
Your Apache user does not have the rights needed to write to your database.
Modify your settings.py so that it shows an absolute path for your database, for example:
DATABASE_NAME = '/var/www/dashboardapp/whatever/path/db.sqlite3'
Then type the following commands at the Linux prompt to set the correct privileges:
chown www-data /var/www/dashboardapp/whatever/path/
chown www-data /var/www/dashboardapp/whatever/path/db.sqlite3
go to your project directory, just share permission with IIS user and that should do the job - if you have deployed on IIS windows server
Using Django 1.4 and django-auth-ldap 1.1, I'm trying to configure my web app to authenticate users against an LDAP service. On supplying the correct login credentials in the login form, I'm getting this error :-
TypeError at /login/
an integer is required
Request Method: POST
Request URL: http://mydomain.com:8000/login/
Django Version: 1.4
Exception Type: TypeError
Exception Value:
an integer is required
Exception Location: /usr/lib/python2.6/dist-packages/ldap/functions.py in _ldap_function_call, line 57
Python Executable: /usr/bin/python
Python Version: 2.6.5
....Python Path information
Why is this error happening ?
Here is the pasted trace info :-
Environment:
Request Method: POST
Request URL: http://localhost:8000/login/
Django Version: 1.4
Python Version: 2.6.5
Installed Applications:
('django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.admin',
'django.contrib.admindocs',
'myapp')
Installed Middleware:
('django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware')
Traceback:
File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/base.py" in get_response
111. response = callback(request, *callback_args, **callback_kwargs)
File "/usr/local/lib/python2.6/dist-packages/django/views/decorators/debug.py" in wrapper
69. return view(request, *args, **kwargs)
File "/usr/local/lib/python2.6/dist-packages/django/utils/decorators.py" in _wrapped_view
91. response = view_func(request, *args, **kwargs)
File "/usr/local/lib/python2.6/dist-packages/django/views/decorators/cache.py" in _wrapped_view_func
89. response = view_func(request, *args, **kwargs)
File "/usr/local/lib/python2.6/dist-packages/django/contrib/auth/views.py" in login
36. if form.is_valid():
File "/usr/local/lib/python2.6/dist-packages/django/forms/forms.py" in is_valid
124. return self.is_bound and not bool(self.errors)
File "/usr/local/lib/python2.6/dist-packages/django/forms/forms.py" in _get_errors
115. self.full_clean()
File "/usr/local/lib/python2.6/dist-packages/django/forms/forms.py" in full_clean
271. self._clean_form()
File "/usr/local/lib/python2.6/dist-packages/django/forms/forms.py" in _clean_form
299. self.cleaned_data = self.clean()
File "/usr/local/lib/python2.6/dist-packages/django/contrib/auth/forms.py" in clean
167. password=password)
File "/usr/local/lib/python2.6/dist-packages/django/contrib/auth/__init__.py" in authenticate
43. for backend in get_backends():
File "/usr/local/lib/python2.6/dist-packages/django/contrib/auth/__init__.py" in get_backends
34. backends.append(load_backend(backend_path))
File "/usr/local/lib/python2.6/dist-packages/django/contrib/auth/__init__.py" in load_backend
28. return cls()
File "/usr/local/lib/python2.6/dist-packages/django_auth_ldap-1.1.1-py2.6.egg/django_auth_ldap/backend.py" in __init__
93. self.ldap = self.ldap_module()
File "/usr/local/lib/python2.6/dist-packages/django_auth_ldap-1.1.1-py2.6.egg/django_auth_ldap/backend.py" in ldap_module
104. return _LDAPConfig.get_ldap(options)
File "/usr/local/lib/python2.6/dist-packages/django_auth_ldap-1.1.1-py2.6.egg/django_auth_ldap/config.py" in get_ldap
74. cls.ldap.set_option(opt, value)
File "/usr/lib/python2.6/dist-packages/ldap/functions.py" in set_option
124. _ldap_function_call(_ldap.set_option,option,invalue)
File "/usr/lib/python2.6/dist-packages/ldap/functions.py" in _ldap_function_call
57. result = func(*args,**kwargs)
Exception Type: TypeError at /login/
Exception Value: an integer is required
Your LDAP server is complaining about one of the key/value pairs in your AUTH_LDAP_GLOBAL_OPTIONS. Make sure you're using the ldap.OPT_* constants as the dictionary keys.
Thanks for looking into this. I'm very new to Django and LDAP Config....so any help is greatly appreciated!
ActivePython 2.6, Django-1.2.7, openldap-2.4.23, python-ldap
So i have the Django installed. I'm trying to configure LDAP to it by following this instruction http://djangosnippets.org/snippets/901/.
After making making changes as described in the above document, and when i run 'python manage.py runserver' I'm gettting this error. Any idea why this is happening? Been looking at this for about a week and no idea how to get this fixed.
Error:
ValueError at /admin/
option error
Request Method: POST
Request URL: http://0.0.0.0:8080/admin/
Django Version: 1.2.7
Exception Type: ValueError
Exception Value:
option error
Exception Location: /apps/essw/python/lib/python2.6/site-packages/python_ldap-2.4.10-py2.6-linux-x86_64.egg/ldap/functions.py in _ldap_function_call, line 63
Python Executable: /apps/essw/python/bin/python
Python Version: 2.6.7
Python Path: ['/apps/essw/mysite', '/apps/essw/python/lib/python2.6/site-packages/python_ldap-2.4.10-py2.6-linux-x86_64.egg', '/apps/essw/python/lib/python2.6/site-packages/elementtree-1.2.7_20070827_preview-py2.6.egg', '/apps/essw/python/lib/python2.6/site-packages/Markdown-2.2.0-py2.6.egg', '/apps/essw/python/lib/python2.6/site-packages/html5lib-0.95-py2.6.egg', '/apps/essw/python/lib/python26.zip', '/apps/essw/python/lib/python2.6', '/apps/essw/python/lib/python2.6/plat-linux2', '/apps/essw/python/lib/python2.6/lib-tk', '/apps/essw/python/lib/python2.6/lib-old', '/apps/essw/python/lib/python2.6/lib-dynload', '/apps/essw/python/lib/python2.6/site-packages', '/apps/essw/python/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg-info']
Server time: Wed, 25 Jul 2012 09:06:41 -0500
#ChrisPratt Thanks for the reply Chris! See if this is helpful
Environment:
Request Method: POST
Request URL: http://x.x.x.x:8080/admin/
Django Version: 1.2.7
Python Version: 2.6.7
Installed Applications:
['django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.admin',
'django.contrib.admindocs']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware')
Traceback:
File "/apps/essw/python/lib/python2.6/site-packages/django/core/handlers/base.py" in get_response
100. response = callback(request, *callback_args, **callback_kwargs)
File "/apps/essw/python/lib/python2.6/site-packages/django/contrib/admin/sites.py" in wrapper
208. return self.admin_view(view, cacheable)(*args, **kwargs)
File "/apps/essw/python/lib/python2.6/site-packages/django/utils/decorators.py" in _wrapped_view
76. response = view_func(request, *args, **kwargs)
File "/apps/essw/python/lib/python2.6/site-packages/django/views/decorators/cache.py" in _wrapped_view_func
78. response = view_func(request, *args, **kwargs)
File "/apps/essw/python/lib/python2.6/site-packages/django/contrib/admin/sites.py" in inner
190. return self.login(request)
File "/apps/essw/python/lib/python2.6/site-packages/django/views/decorators/cache.py" in _wrapped_view_func
78. response = view_func(request, *args, **kwargs)
File "/apps/essw/python/lib/python2.6/site-packages/django/contrib/admin/sites.py" in login
323. user = authenticate(username=username, password=password)
File "/apps/essw/python/lib/python2.6/site-packages/django/contrib/auth/__init__.py" in authenticate
52. user = backend.authenticate(**credentials)
File "/apps/essw/mysite/django_auth_ldap/backend.py" in authenticate
824. ldap.set_option(ldap.OPT_X_TLS_CACERTFILE,settings.AD_CERT_FILE)
File "/apps/essw/python/lib/python2.6/site-packages/python_ldap-2.4.10-py2.6-linux- x86_64.egg/ldap/functions.py" in set_option
132. return _ldap_function_call(None,_ldap.set_option,option,invalue)
File "/apps/essw/python/lib/python2.6/site-packages/python_ldap-2.4.10-py2.6-linux- x86_64.egg/ldap/functions.py" in _ldap_function_call
63. result = func(*args,**kwargs)
Exception Type: ValueError at /admin/
Exception Value: option error