OperationalError at : "site" Exception Value: No such Table django_site - python

I thought i had uploaded my project correctly to a remote server/host at asmallorange, but I keep running into problems.
This is what i did:
Followed all the instructions on this page:
https://help.asmallorange.com/index.php?/Knowledgebase/Article/View/305/0/install-django-using-virtualenv
checked my website (angusrchen.com) and got a default "welcome to django!" page. Okay, so i know that django is installed correctly.
then i used filezilla to upload my project files to the directory path where I had created the project on the remote server.
I ran
$ python manage.py syncdb
no errors, then
$ python manage.py collectstatic
no errors.
Two problems:
Base.html is loading when i go to my webpage, but none of the javascript seems to be working.
and now i'm getting this error when i try to navigate to any of the django pages (like /admin or /blog)
error is below:
OperationalError at /blog/
no such table: django_site
Request Method: GET
Request URL: http://angusrchen.com/blog/
Django Version: 1.6.5
Exception Type: OperationalError
Exception Value: no such table: django_site
Exception Location: /home/angusrch/.env/env/lib/python2.7/site-packages/django/db/backends/sqlite3/base.py in execute, line 451
Python Executable: /home/angusrch/.env/env/bin/python
Python Version: 2.7.6
Python Path: ['/home/angusrch/.env/env/lib/python2.7/site-packages',
'/home/angusrch/public_html',
'/home/angusrch/.env/env/lib/python27.zip',
'/home/angusrch/.env/env/lib/python2.7',
'/home/angusrch/.env/env/lib/python2.7/plat-linux2',
'/home/angusrch/.env/env/lib/python2.7/lib-tk',
'/home/angusrch/.env/env/lib/python2.7/lib-old',
'/home/angusrch/.env/env/lib/python2.7/lib-dynload',
'/usr/lib/python2.7',
'/usr/lib/python2.7/plat-linux2',
'/usr/lib/python2.7/lib-tk']
Server time: Sat, 2 Aug 2014 11:18:06 -0500
Environment:
Request Method: GET
Request URL: http://angusrchen.com/blog/
Django Version: 1.6.5
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',
'django.contrib.comments',
'django.contrib.sites',
'tagging',
'mptt',
'blog',
'zinnia')
Installed Middleware:
('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 "/home/angusrch/.env/env/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
112. response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/home/angusrch/.env/env/lib/python2.7/site-packages/django/views/generic/base.py" in view
69. return self.dispatch(request, *args, **kwargs)
File "/home/angusrch/.env/env/lib/python2.7/site-packages/django/views/generic/base.py" in dispatch
87. return handler(request, *args, **kwargs)
File "/home/angusrch/.env/env/lib/python2.7/site-packages/django/views/generic/dates.py" in get
333. self.date_list, self.object_list, extra_context = self.get_dated_items()
File "/home/angusrch/.env/env/lib/python2.7/site-packages/django/views/generic/dates.py" in get_dated_items
414. qs = self.get_dated_queryset(ordering='-%s' % self.get_date_field())
File "/home/angusrch/.env/env/lib/python2.7/site-packages/django/views/generic/dates.py" in get_dated_queryset
350. qs = self.get_queryset().filter(**lookup)
File "/home/angusrch/.env/env/lib/python2.7/site-packages/zinnia/views/mixins/prefetch_related.py" in get_queryset
25. return super(PrefetchRelatedMixin, self
File "/home/angusrch/.env/env/lib/python2.7/site-packages/zinnia/views/mixins/callable_queryset.py" in get_queryset
20. return self.queryset()
File "/home/angusrch/.env/env/lib/python2.7/site-packages/django/db/models/manager.py" in all
133. return self.get_queryset()
File "/home/angusrch/.env/env/lib/python2.7/site-packages/zinnia/managers.py" in get_queryset
46. super(EntryPublishedManager, self).get_queryset())
File "/home/angusrch/.env/env/lib/python2.7/site-packages/zinnia/managers.py" in entries_published
33. status=PUBLISHED, sites=Site.objects.get_current())
File "/home/angusrch/.env/env/lib/python2.7/site-packages/django/contrib/sites/models.py" in get_current
47. current_site = self.get(pk=sid)
File "/home/angusrch/.env/env/lib/python2.7/site-packages/django/db/models/manager.py" in get
151. return self.get_queryset().get(*args, **kwargs)
File "/home/angusrch/.env/env/lib/python2.7/site-packages/django/db/models/query.py" in get
304. num = len(clone)
File "/home/angusrch/.env/env/lib/python2.7/site-packages/django/db/models/query.py" in __len__
77. self._fetch_all()
File "/home/angusrch/.env/env/lib/python2.7/site-packages/django/db/models/query.py" in _fetch_all
857. self._result_cache = list(self.iterator())
File "/home/angusrch/.env/env/lib/python2.7/site-packages/django/db/models/query.py" in iterator
220. for row in compiler.results_iter():
File "/home/angusrch/.env/env/lib/python2.7/site-packages/django/db/models/sql/compiler.py" in results_iter
713. for rows in self.execute_sql(MULTI):
File "/home/angusrch/.env/env/lib/python2.7/site-packages/django/db/models/sql/compiler.py" in execute_sql
786. cursor.execute(sql, params)
File "/home/angusrch/.env/env/lib/python2.7/site-packages/django/db/backends/util.py" in execute
69. return super(CursorDebugWrapper, self).execute(sql, params)
File "/home/angusrch/.env/env/lib/python2.7/site-packages/django/db/backends/util.py" in execute
53. return self.cursor.execute(sql, params)
File "/home/angusrch/.env/env/lib/python2.7/site-packages/django/db/utils.py" in __exit__
99. six.reraise(dj_exc_type, dj_exc_value, traceback)
File "/home/angusrch/.env/env/lib/python2.7/site-packages/django/db/backends/util.py" in execute
53. return self.cursor.execute(sql, params)
File "/home/angusrch/.env/env/lib/python2.7/site-packages/django/db/backends/sqlite3/base.py" in execute
451. return Database.Cursor.execute(self, query, params)
Exception Type: OperationalError at /blog/
Exception Value: no such table: django_site

Your error simply state that your database does not contain the table django_site.
Try inspecting the database (see if the table is indeed present), check you're accessing the good one in your settings (if you have multiple databases on your server).
Also make sure everything works in development environment, if so you can either copy the database from your development environment to your server, or delete the one on the server and run syncdb again.
PS : I think you would get another error if you couldn't access the database, but check your file permissions, maybe it can cause this as well.

Related

ORA-01861: literal does not match format string when executing get model object in django

I have a model object in django like so...
from django.db import models
class Person(models.Model):
employee_title = models.CharField(max_length=150)
pk_person_id = models.IntegerField(primary_key=True)
department_name = models.CharField(max_length=240)
cost_center = models.CharField(max_length=150)
user_name = models.CharField(max_length=100)
def __str__(self):
return self.user_name
class Meta:
managed = False
db_table = 'company_hr_idm_data_v'
and in my view I am doing a simple get on the Person object like so...
testobj = Person.objects.using('oracle').get(pk=4)
The code errors out with a DatabaseError that says
ORA-01861: literal does not match format string
Here is the stack trace I code when I have my debug mode set to true in my settings.py
Environment:
Request Method: GET
Request URL: http://127.0.0.1:8000/roles/testing
Django Version: 1.7.2
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',
'roles')
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 "/Users/adjeibad/.virtualenvs/wwtmlserver/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
111. response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/Users/adjeibad/.virtualenvs/wwtmlserver/entitlements/roles/views/Organization.py" in test
9. testobj = Person.objects.using('oracle').get(pk=4)
File "/Users/adjeibad/.virtualenvs/wwtmlserver/lib/python2.7/site- packages/django/db/models/query.py" in get
351. num = len(clone)
File "/Users/adjeibad/.virtualenvs/wwtmlserver/lib/python2.7/site-packages/django/db/models/query.py" in __len__
122. self._fetch_all()
File "/Users/adjeibad/.virtualenvs/wwtmlserver/lib/python2.7/site-packages/django/db/models/query.py" in _fetch_all
966. self._result_cache = list(self.iterator())
File "/Users/adjeibad/.virtualenvs/wwtmlserver/lib/python2.7/site-packages/django/db/models/query.py" in iterator
265. for row in compiler.results_iter():
File "/Users/adjeibad/.virtualenvs/wwtmlserver/lib/python2.7/site-packages/django/db/models/sql/compiler.py" in results_iter
700. for rows in self.execute_sql(MULTI):
File "/Users/adjeibad/.virtualenvs/wwtmlserver/lib/python2.7/site-packages/django/db/models/sql/compiler.py" in execute_sql
786. cursor.execute(sql, params)
File "/Users/adjeibad/.virtualenvs/wwtmlserver/lib/python2.7/site-packages/django/db/backends/utils.py" in execute
81. return super(CursorDebugWrapper, self).execute(sql, params)
File "/Users/adjeibad/.virtualenvs/wwtmlserver/lib/python2.7/site-packages/django/db/backends/utils.py" in execute
65. return self.cursor.execute(sql, params)
File "/Users/adjeibad/.virtualenvs/wwtmlserver/lib/python2.7/site-packages/django/db/utils.py" in __exit__
94. six.reraise(dj_exc_type, dj_exc_value, traceback)
File "/Users/adjeibad/.virtualenvs/wwtmlserver/lib/python2.7/site-packages/django/db/backends/utils.py" in execute
65. return self.cursor.execute(sql, params)
File "/Users/adjeibad/.virtualenvs/wwtmlserver/lib/python2.7/site- packages/django/db/backends/oracle/base.py" in execute
916. return self.cursor.execute(query, self._param_generator(params))
Exception Type: DatabaseError at /roles/testing
Exception Value: ORA-01861: literal does not match format string
Oh! also here is the query that is generated...
SELECT * FROM (SELECT ROWNUM AS "_RN", "_SUB".* FROM (SELECT "COMPANY_HR_IDM_DATA_V"."EMPLOYEE_TITLE", "COMPANY_HR_IDM_DATA_V"."PK_PERSON_ID", "COMPANY_HR_IDM_DATA_V"."DEPARTMENT_NAME", "COMPANY_HR_IDM_DATA_V"."COST_CENTER", "COMPANY_HR_IDM_DATA_V"."USER_NAME" FROM "COMPANY_HR_IDM_DATA_V" WHERE "COMPANY_HR_IDM_DATA_V"."PK_PERSON_ID" = :arg0) "_SUB" WHERE ROWNUM <= 21) WHERE "_RN" > 0
I tried to put as much information as I could, can anyone please steer me in the right direction?
Can you try executing the Query directly by giving the input?. There might be a datatype difference between the input and the actual column type.

relation "account_emailaddress" does not exist - django error

I am following this tutorial to integrate social media login to my django project -
http://www.sarahhagstrom.com/2013/09/the-missing-django-allauth-tutorial/
However after completing all the steps, when I try to login using facebook, I get this error
relation "account_emailaddress" does not exist
I don't understand what has gone wrong as all the DB modifications ran properly without errors.
Thanks in advance for your valuable answers.
Stacktrace
Environment:
Request Method: POST
Request URL: example.com/accounts/facebook/login/token/
Django Version: 1.6.6
Python Version: 2.7.4
Installed Applications:
('django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.humanize',
'django.contrib.admin',
'django.contrib.comments',
'south',
'registration',
'endless_pagination',
'links',
'south',
'debug_toolbar',
'allauth',
'allauth.account',
'allauth.socialaccount',
'allauth.socialaccount.providers.facebook')
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',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'debug_toolbar.middleware.DebugToolbarMiddleware')
Traceback:
File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py" in get_response
112. response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/usr/local/lib/python2.7/dist-packages/allauth/socialaccount/providers/facebook/views.py" in login_by_token
76. ret = complete_social_login(request, login)
File "/usr/local/lib/python2.7/dist-packages/allauth/socialaccount/helpers.py" in complete_social_login
119. return _complete_social_login(request, sociallogin)
File "/usr/local/lib/python2.7/dist-packages/allauth/socialaccount/helpers.py" in _complete_social_login
130. ret = _process_signup(request, sociallogin)
File "/usr/local/lib/python2.7/dist-packages/allauth/socialaccount/helpers.py" in _process_signup
26. sociallogin)
File "/usr/local/lib/python2.7/dist-packages/allauth/socialaccount/adapter.py" in is_auto_signup_allowed
121. if email_address_exists(email):
File "/usr/local/lib/python2.7/dist-packages/allauth/utils.py" in email_address_exists
85. ret = emailaddresses.filter(email__iexact=email).exists()
File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py" in exists
515. return self.query.has_results(using=self.db)
File "/usr/local/lib/python2.7/dist-packages/django/db/models/sql/query.py" in has_results
409. return bool(compiler.execute_sql(SINGLE))
File "/usr/local/lib/python2.7/dist-packages/django/db/models/sql/compiler.py" in execute_sql
786. cursor.execute(sql, params)
File "/usr/local/lib/python2.7/dist-packages/django/db/backends/util.py" in execute
69. return super(CursorDebugWrapper, self).execute(sql, params)
File "/usr/local/lib/python2.7/dist-packages/django/db/backends/util.py" in execute
53. return self.cursor.execute(sql, params)
File "/usr/local/lib/python2.7/dist-packages/django/db/utils.py" in __exit__
99. six.reraise(dj_exc_type, dj_exc_value, traceback)
File "/usr/local/lib/python2.7/dist-packages/django/db/backends/util.py" in execute
53. return self.cursor.execute(sql, params)
Exception Type: ProgrammingError at /accounts/facebook/login/token/
Exception Value: relation "account_emailaddress" does not exist
LINE 1: SELECT (1) AS "a" FROM "account_emailaddress" WHERE UPPER("a...
` ^
I figured out what the problem was. the allauth uses account app which doesn't support migrations as yet. Initially I had run
python manage.py migrate allauth.socialaccount
python manage.py migrate allauth.socialaccount.providers.facebook
Along with this we need to run the syncdb to complete the puzzle.
I think you added library providers after performing the first migration, this leaves pending migrations
run
python manage.py makemigrations allauth
and
python manage.py migrate allauth

Django admin/ ViewDoesNotExist

I checked the other questions on here like this one, but couldn't get an accurate answer that would solve my problem. When i run the dev server with python manage.py runserver I get the following `
Environment:
Request Method: GET
Request URL: http://127.0.0.1:8000/admin/
Django Version: 1.6.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',
'firstapp')
Installed Middleware:
('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 "/Library/Python/2.7/site-packages/Django-1.6.4-py2.7.egg/django/core/handlers/base.py" in get_response
114. response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/Library/Python/2.7/site-packages/Django-1.6.4-py2.7.egg/django/contrib/admin/sites.py" in wrapper
215. return self.admin_view(view, cacheable)(*args, **kwargs)
File "/Library/Python/2.7/site-packages/Django-1.6.4-py2.7.egg/django/utils/decorators.py" in _wrapped_view
99. response = view_func(request, *args, **kwargs)
File "/Library/Python/2.7/site-packages/Django-1.6.4-py2.7.egg/django/views/decorators/cache.py" in _wrapped_view_func
52. response = view_func(request, *args, **kwargs)
File "/Library/Python/2.7/site-packages/Django-1.6.4-py2.7.egg/django/contrib/admin/sites.py" in inner
194. current_app=self.name):
File "/Library/Python/2.7/site-packages/Django-1.6.4-py2.7.egg/django/core/urlresolvers.py" in reverse
503. app_list = resolver.app_dict[ns]
File "/Library/Python/2.7/site-packages/Django-1.6.4-py2.7.egg/django/core/urlresolvers.py" in app_dict
329. self._populate()
File "/Library/Python/2.7/site-packages/Django-1.6.4-py2.7.egg/django/core/urlresolvers.py" in _populate
303. lookups.appendlist(pattern.callback, (bits, p_pattern, pattern.default_args))
File "/Library/Python/2.7/site-packages/Django-1.6.4-py2.7.egg/django/core/urlresolvers.py" in callback
230. self._callback = get_callable(self._callback_str)
File "/Library/Python/2.7/site-packages/Django-1.6.4-py2.7.egg/django/utils/functional.py" in wrapper
32. result = func(*args)
File "/Library/Python/2.7/site-packages/Django-1.6.4-py2.7.egg/django/core/urlresolvers.py" in get_callable
118. (lookup_view, mod_name))
Exception Type: ViewDoesNotExist at /admin/
Exception Value: Could not import Chinatown.views. View does not exist in module Chinatown.
`
But when i check my other project with which i follow the official django tut I dont have the mentioned views file in the project directory but I am able to see the admin page. Any suggestions why is the error being raised?
i think it will be more useful if just copy / paste error log . use:
./manage.py runserver --traceback
you need to add function in chinatown/views.py say "food"
and a url pattern in project's urls.py:
from django.conf.urls import url
urlpatterns = [
url(r'^food/$', 'chinatown.views.food'),
]
https://docs.djangoproject.com/en/dev/topics/http/urls/

ImproperlyConfigured at / 'ClientEventLogAdmin.exclude' refers to field 'created' that is missing from the form

I am installing a django application module.I am getting this error.
I started another MicroInstance and reinstalled everything but still I am getting this error.
.
Environment:
Request Method: GET
Request URL: http://54.235.127.252/mds/
Django Version: 1.3.1
Python Version: 2.7.3
Installed Applications:
['sana.mrs',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.admin']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'sana.mrs.util.LoggingMiddleware')
Traceback:
File "/usr/lib/python2.7/dist-packages/django/core/handlers/base.py" in get_response
101. request.path_info)
File "/usr/lib/python2.7/dist-packages/django/core/urlresolvers.py" in resolve
250. for pattern in self.url_patterns:
File "/usr/lib/python2.7/dist-packages/django/core/urlresolvers.py" in _get_url_patterns
279. patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
File "/usr/lib/python2.7/dist-packages/django/core/urlresolvers.py" in _get_urlconf_module
274. self._urlconf_module = import_module(self.urlconf_name)
File "/usr/lib/python2.7/dist-packages/django/utils/importlib.py" in import_module
35. __import__(name)
File "/opt/sana/urls.py" in <module>
12. admin.autodiscover()
File "/usr/lib/python2.7/dist-packages/django/contrib/admin/__init__.py" in autodiscover
26. import_module('%s.admin' % app)
File "/usr/lib/python2.7/dist-packages/django/utils/importlib.py" in import_module
35. __import__(name)
File "/opt/sana/mrs/admin.py" in <module>
26. admin.site.register(ClientEventLog, ClientEventLogAdmin)
File "/usr/lib/python2.7/dist-packages/django/contrib/admin/sites.py" in register
97. validate(admin_class, model)
File "/usr/lib/python2.7/dist-packages/django/contrib/admin/validation.py" in validate
24. validate_base(cls, model)
File "/usr/lib/python2.7/dist-packages/django/contrib/admin/validation.py" in validate_base
279. check_formfield(cls, model, opts, 'exclude', field)
File "/usr/lib/python2.7/dist-packages/django/contrib/admin/validation.py" in check_formfield
369. "is missing from the form." % (cls.__name__, label, field))
Exception Type: ImproperlyConfigured at /
Exception Value: 'ClientEventLogAdmin.exclude' refers to field 'created' that is missing from the form.
Note:I just need to install this application.I am intermediate in python.and beginner in Django.But professional in PHP,mysql and front end with jQuery
From what I see, the problem is likely to be related to the moca framework.
If your /opt/sana/mrs/admin.py file looks like this then the culprit is likely to be located at line 12 : the created field is refered in the exclude list, but not previously defined.
As I'm not sure about your needs here are some solutions you can try :
Re-install or update your moca frameword ;
Add a piece of code before the execute definition (not sure what's type it should be though) :
from django.db import models # You may also place it in the top of the file
created = models.DateField(blank=True, null=True)
Remove the created item from the exclude list (not sure about the impact though)
Hope it helps,

Django error 'too many values to unpack' in objects.get(id)

I have url like this http://gagandeepdesk/2690/ which I am filtering with urls.py file and sending 2690 as one of the parameters to the function.
my urls.py filter looks like this,
url(r'^(\d+)/', 'scango.scanner.views.download'),
And that function looks like this,
def download(request, MediaId):
media = Media.objects.get(id=int(MediaId))
#print media
return HttpResponse(FileIterWrapper(open(media.path)))
I am getting error 'too many values to unpack' on line
media = Media.objects.get(id=int(MediaId))
I also tried running this function standalone without request object and it is running perfectly fine. So, I am confused what I have done wrong here.
Environment:
Request Method: GET
Request URL: http://gagandeepdesk/2690/
Django Version: 1.3
Python Version: 2.7.1
Installed Applications:
['haystack',
'scanner',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.admin']
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 "C:\Python27\lib\site-packages\django\core\handlers\base.py" in get_response
111. response = callback(request, *callback_args, **callback_kwargs)
File "C:\Users\gagasing\Desktop\ideas\scango\..\scango\scanner\views.py" in download
21. media = Media.objects.get(id=int(MediaId))
File "C:\Python27\lib\site-packages\django\db\models\manager.py" in get
132. return self.get_query_set().get(*args, **kwargs)
File "C:\Python27\lib\site-packages\django\db\models\query.py" in get
343. clone = self.filter(*args, **kwargs)
File "C:\Python27\lib\site-packages\django\db\models\query.py" in filter
552. return self._filter_or_exclude(False, *args, **kwargs)
File "C:\Python27\lib\site-packages\django\db\models\query.py" in _filter_or_exclude
570. clone.query.add_q(Q(*args, **kwargs))
File "C:\Python27\lib\site-packages\django\db\models\sql\query.py" in add_q
1170. can_reuse=used_aliases, force_having=force_having)
File "C:\Python27\lib\site-packages\django\db\models\sql\query.py" in add_filter
1013. arg, value = filter_expr
Exception Type: ValueError at /2690/
Exception Value: too many values to unpack
(r'^(?P<MediaId>\d+)/$', 'scango.scanner.views.download')
Maybe try this instead?
This is an example of named groups.
In Python regular expressions, the syntax for named regular expression
groups is (?Ppattern), where name is the name of the group and
pattern is some pattern to match.

Categories

Resources