getting error "Project matching query does not exist."

262 views
Skip to first unread message

ni...@linkites.com

unread,
Apr 11, 2017, 11:08:30 AM4/11/17
to Django users
Hi,

I have setup existing django project at localsystem and its migrate successfully.
after migrate i have run following "python manage.py runserver" to run django project.

After that i am getting error message "Project matching query does not exist." on terminal and as well as browser.

Please let me know of what is problem.



Please help me to solve this issue.

Thanks,

Auto Generated Inline Image 1

ludovic coues

unread,
Apr 11, 2017, 11:26:01 AM4/11/17
to django...@googlegroups.com
You got lucky, you might have pasted just enough of the traceback to receive some help.

Check the data you have in your database, look like there is no object Project with an id=1. 



--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/218dfc6d-90e7-4b75-9d1a-ee603a8e044d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Cordialement, Ludovic Coues
+33 6 14 87 43 42

ni...@linkites.com

unread,
Apr 11, 2017, 12:01:53 PM4/11/17
to Django users
Hi,

I am not getting your point can you please let me know of in which file i can change to solve this issue.



On Tuesday, April 11, 2017 at 4:56:01 PM UTC+5:30, ludovic coues wrote:
You got lucky, you might have pasted just enough of the traceback to receive some help.

Check the data you have in your database, look like there is no object Project with an id=1. 
2017-04-11 11:57 GMT+02:00 <ni...@linkites.com>:
Hi,

I have setup existing django project at localsystem and its migrate successfully.
after migrate i have run following "python manage.py runserver" to run django project.

After that i am getting error message "Project matching query does not exist." on terminal and as well as browser.

Please let me know of what is problem.



Please help me to solve this issue.

Thanks,


--
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.

Andréas Kühne

unread,
Apr 11, 2017, 1:18:25 PM4/11/17
to django...@googlegroups.com
Hi,

I think his point is that no file change will resolve this. :-)

In the file "brickly/framework/middleware.py" you are searching for a Project with the database ID 1 - and it doesn't exist. The middleware apparantly needs a Project to function. 

So you can either add a project to your database, or you can remove that line in the middleware file - either would solve THIS issue - however removing the line, will probably add other problems instead.

Regards,

Andréas

To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.

To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.

ni...@linkites.com

unread,
Apr 11, 2017, 1:52:27 PM4/11/17
to Django users
Hi,

Previous error solve and thanks for that.

now i am getting new error of ValidationError Please see below screen shot.
Please let me know of what is the problem now.

Camilo Torres

unread,
Apr 12, 2017, 12:01:19 AM4/12/17
to Django users
Hi
1) How did you solved the first issue? You should be supposed to solve it by adding a row to a database table (the one related to your Project model) with id=1.
2) You have not pasted enough information for your ValidationError issue, please don't paste screen shots (at least, not only a screen shot). Please paste the entire stack trace you get in the terminal running the server. You may also consider pasting relevant code you think is related to the error, though someone can ask for the code or configuration after looking at the entire stack trace.

ni...@linkites.com

unread,
Apr 12, 2017, 6:19:20 AM4/12/17
to Django users
Hi,

here are following issues are getting.

I have filled tables "project_project" and "user_user". please let me know another tables name for  add row to solve ValidationsError Issue

--------------------------------------------------------------------------------------------------------
Environment:

Request Method: GET
Request URL: http://127.0.0.1:8000/

Django Version: 1.9.8
Python Version: 3.5.2
Installed Applications:
('django.contrib.admin',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'django.contrib.sites',
 'compressor',
 'bootstrap3',
 'captcha',
 'mptt',
 'corsheaders',
 'dbbackup',
 'django_extensions',
 'mathfilters',
 'rest_framework',
 'rest_framework.authtoken',
 'social.apps.django_app.default',
 'brickly.framework',
 'brickly.system.project',
 'brickly.account.user',
 'brickly.account.email',
 'brickly.account.social',
 'brickly.account.address',
 'brickly.account.contact',
 'brickly.account.group',
 'brickly.account.history',
 'brickly.cms.content',
 'brickly.commerce.driver',
 'brickly.commerce.delivery',
 'brickly.system.verification',
 'brickly.system.location',
 'brickly.system.db',
 'brickly.system.upload',
 'brickly.hr.goodhire',
 'raven.contrib.django.raven_compat',
 'baf',
 'haystack')
Installed Middleware:
('raven.contrib.django.middleware.SentryMiddleware',
 'threadlocals.middleware.ThreadLocalMiddleware',
 'brickly.framework.middleware.BricklyMiddleware',
 'corsheaders.middleware.CorsMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
 'brickly.account.user.middleware.LocaleMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware',
 'brickly.account.user.middleware.TimezoneMiddleware',
 'django.middleware.security.SecurityMiddleware',
 'social.apps.django_app.middleware.SocialAuthExceptionMiddleware')



Traceback:

File "/usr/lib/python3.5/json/decoder.py" in raw_decode
  355.             obj, end = self.scan_once(s, idx)

During handling of the above exception (0), another exception occurred:

File "/usr/local/lib/python3.5/dist-packages/social/apps/django_app/default/fields.py" in to_python
  42.                 return json.loads(value)

File "/usr/lib/python3.5/json/__init__.py" in loads
  319.         return _default_decoder.decode(s)

File "/usr/lib/python3.5/json/decoder.py" in decode
  339.         obj, end = self.raw_decode(s, idx=_w(s, 0).end())

File "/usr/lib/python3.5/json/decoder.py" in raw_decode
  357.             raise JSONDecodeError("Expecting value", s, err.value) from None

During handling of the above exception (Expecting value: line 1 column 1 (char 0)), another exception occurred:

File "/usr/local/lib/python3.5/dist-packages/django/core/handlers/base.py" in get_response
  123.                 response = middleware_method(request)

File "/home/user/django-project/brickly/framework/middleware.py" in process_request
  18.             request.project = Project.objects.get(id=1)

File "/usr/local/lib/python3.5/dist-packages/django/db/models/manager.py" in manager_method
  122.                 return getattr(self.get_queryset(), name)(*args, **kwargs)

File "/usr/local/lib/python3.5/dist-packages/django/db/models/query.py" in get
  381.         num = len(clone)

File "/usr/local/lib/python3.5/dist-packages/django/db/models/query.py" in __len__
  240.         self._fetch_all()

File "/usr/local/lib/python3.5/dist-packages/django/db/models/query.py" in _fetch_all
  1074.             self._result_cache = list(self.iterator())

File "/usr/local/lib/python3.5/dist-packages/django/db/models/query.py" in __iter__
  68.         for row in compiler.results_iter(results):

File "/usr/local/lib/python3.5/dist-packages/django/db/models/sql/compiler.py" in results_iter
  808.                     row = self.apply_converters(row, converters)

File "/usr/local/lib/python3.5/dist-packages/django/db/models/sql/compiler.py" in apply_converters
  792.                 value = converter(value, expression, self.connection, self.query.context)

File "/usr/local/lib/python3.5/dist-packages/social/apps/django_app/default/fields.py" in from_db_value
  24.         return self.to_python(value)

File "/usr/local/lib/python3.5/dist-packages/social/apps/django_app/default/fields.py" in to_python
  44.                 raise ValidationError(str(err))

Exception Type: ValidationError at /
Exception Value: ['Expecting value: line 1 column 1 (char 0)']

--------------------------------------------------------------------------------------------------------

ludovic coues

unread,
Apr 12, 2017, 9:06:01 AM4/12/17
to django...@googlegroups.com
At this point, I usually start putting a lot of print statement, both in my code and in library. That's one of the advantages of working in a virtualenv.

My gut feeling is that on of the fields of Project is causing the validation error. If I could read the code of the Project model, maybe I could make a better guess. Maybe not.

You should try to find what value of what object/attribute is causing the error. I use print for that job. A good debugger could do the trick too. 

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.

For more options, visit https://groups.google.com/d/optout.

ni...@linkites.com

unread,
Apr 12, 2017, 10:46:28 AM4/12/17
to Django users
Hi,

I have solved validationError on django and now project redirecting on url "http://127.0.0.1:8000/brickly/home" and its not found. so please let me know how to create it on django.


here are page not found error coming. please let me know of what is the problem.


Page not found (404)

Request Method: GET
Request URL: http://127.0.0.1:8000/brickly/home



On Tuesday, April 11, 2017 at 4:38:30 PM UTC+5:30, ni...@linkites.com wrote:

ni...@linkites.com

unread,
Apr 12, 2017, 10:56:20 AM4/12/17
to Django users

I have solved validationError on django and now project redirecting on url "http://127.0.0.1:8000/brickly/home" and its not found. so please let me know how to create it on django.


here are page not found error coming. please let me know of what is the problem.





On Tuesday, April 11, 2017 at 4:38:30 PM UTC+5:30, ni...@linkites.com wrote:
Hi,

I have setup existing django project at localsystem and its migrate successfully.
after migrate i have run following "python manage.py runserver" to run django project.

After that i am getting error message "Project matching query does not exist." on terminal and as well as browser.

Please let me know of what is problem.



ludovic coues

unread,
Apr 12, 2017, 11:02:09 AM4/12/17
to django...@googlegroups.com
I would search the function doing the redirection and look at what information it use to make that redirection.

Either it is redirecting to a wrong url or something have gone wrong when installing the brickly application.

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.

For more options, visit https://groups.google.com/d/optout.

Camilo Torres

unread,
Apr 16, 2017, 12:16:22 AM4/16/17
to Django users
Hi,
I agree with Ludovic in "your application may be badly installed". But it is very hard to tell what is going wrong without actually knowing what your app should show (what view function) for URL path /brickly/home
I cannot tell you what view is that without knowing about your code nor your business rules for that page.
You have to ask the original developers what view should show there, and try to writhe the url conf for that.


On Wednesday, April 12, 2017 at 7:02:09 AM UTC-4, ludovic coues wrote:
I would search the function doing the redirection and look at what information it use to make that redirection.

Either it is redirecting to a wrong url or something have gone wrong when installing the brickly application.
2017-04-12 12:46 GMT+02:00 <ni...@linkites.com>:
Hi,

I have solved validationError on django and now project redirecting on url "http://127.0.0.1:8000/brickly/home" and its not found. so please let me know how to create it on django.


here are page not found error coming. please let me know of what is the problem.


Page not found (404)

Request Method: GET
Request URL: http://127.0.0.1:8000/brickly/home



On Tuesday, April 11, 2017 at 4:38:30 PM UTC+5:30, ni...@linkites.com wrote:
Hi,

I have setup existing django project at localsystem and its migrate successfully.
after migrate i have run following "python manage.py runserver" to run django project.

After that i am getting error message "Project matching query does not exist." on terminal and as well as browser.

Please let me know of what is problem.



Please help me to solve this issue.

Thanks,

--
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 https://groups.google.com/group/django-users.
Reply all
Reply to author
Forward
0 new messages