django cms frontend editer display error - django

Am trying to access the django cmcs frontend editor and after input the login details, i get the following error.
AttributeError at /en/
'NoneType' object has no attribute 'has_change_permission'
Request Method: GET
Request URL: http://*.*.*.*:8000/en/
Django Version: 1.6.5
Exception Type: AttributeError
Exception Value:
'NoneType' object has no attribute 'has_change_permission'
Exception Location: /home/bg/workspace/my-site/env/local/lib/python2.7/site-packages/cms/templatetags/cms_tags.py in get_processors, line 352
Python Executable: /home/bg/workspace/my-site/env/bin/python
Python Version: 2.7.3
Python Path:
['/home/bg/workspace/my-site',
'/home/bg/workspace/my-site/env/local/lib/python2.7/site-packages/distribute-0.6.24-py2.7.egg',
'/home/bg/workspace/my-site/env/lib/python2.7',
'/home/bg/workspace/my-site/env/lib/python2.7/plat-linux2',
'/home/bg/workspace/my-site/env/lib/python2.7/lib-tk',
'/home/bg/workspace/my-site/env/lib/python2.7/lib-old',
'/home/bg/workspace/my-site/env/lib/python2.7/lib-dynload',
'/usr/lib/python2.7',
'/usr/lib/python2.7/plat-linux2',
'/usr/lib/python2.7/lib-tk',
'/home/bg/workspace/my-site/env/local/lib/python2.7/site-packages']
How can i fix it?

I faced a similar issue with django-cms 3.0.4 / Python 3.4, it may be related to the djangocms-column plugin (version 1.4).
This problem appeared when editing a page; either with djangocms-installer default pages, as well as when creating a new page at trying to add the multi-columns plugin into it.
For a bit more details, the error is encountered when interpreting {% render_plugin plugin %}, in multi_column.html (line #4):
In template /dvlpt/venv/my_project/lib/python3.4/site-packages/djangocms_column/templates/cms/plugins/multi_column.html, error at line 4
'NoneType' object has no attribute 'has_change_permission'
More exactly, the AttributeError exception is raised by line #352 of cms/templatetags/cms_tags.py, in get_processors():
if toolbar and toolbar.edit_mode and placeholder.has_change_permission(request) and getattr(placeholder, 'is_editable', True):
...
I've posted a comment at djangocms-colum github : https://github.com/divio/djangocms-column/issues/14
Sorry, I cannot bring a more useful help yet, as I'm very new to django-cms at this time...
Cheers

Related

i have two projects in django i can not open admin site for my second project,but i can open for my first project,can any one help me

AttributeError at /admin/
'WSGIRequest' object has no attribute 'user'
Request Method: GET
Request URL: http://127.0.0.1:8000/admin/
Django Version: 2.0.2
Exception Type: AttributeError
Exception Value:
'WSGIRequest' object has no attribute 'user'
Exception Location: C:\Users\vaaz\Desktop\venv\lib\site-packages\django\contrib\admin\sites.py in has_permission, line 186
Python Executable: C:\Users\vaaz\Desktop\venv\Scripts\python.exe
Python Version: 3.4.3
Python Path:
['C:\Users\vaaz\website1',
'C:\Windows\system32\python34.zip',
'C:\Users\vaaz\Desktop\venv\DLLs',
'C:\Users\vaaz\Desktop\venv\lib',
'C:\Users\vaaz\Desktop\venv\Scripts',
'C:\Python34\Lib',
'C:\Python34\DLLs',
'C:\Users\vaaz\Desktop\venv',
'C:\Users\vaaz\Desktop\venv\lib\site-packages']
Server time: Mon, 12 Mar 2018 10:21:49 +0000
This looks similar to this post
with your limited error description I can only suggest a few things that were mentioned in the above post:
Older Django versions use MIDDLEWARE_CLASSES = (...) in the settings.py rather than MIDDLEWARE = (...) try changing that variable.
If you are using virtualenv be sure to activate it before trying to runserver
If you created your app in a different version of Django and then installed it on another version it might give you errors.

I'm getting a DoesNotExist error with django rest auth password reset

I've installed and configured django-rest-auth, everything seems to be working properly except the /rest-auth/password/reset/ endpoint.
When I do a POST to it, passing the email via JSON, a 500 - DoesNotExist error is returned:
DoesNotExist at /rest-auth/password/reset/
Site matching query does not exist.
Request Method: POST
Request URL: http://.../rest-auth/password/reset/
Django Version: 1.9.5
Exception Type: DoesNotExist
Exception Value: Site matching query does not exist.
Exception Location: /home/.../.local/lib/python2.7/site-packages/django/db/models/query.py in get, line 387
Python Executable: /usr/bin/python
Python Version: 2.7.10
What could be causing this?
django-allauth (used internally by DRA) looks for the domain name by searching for Site object.
Please follow these steps to set up sites framework:
https://docs.djangoproject.com/en/1.9/ref/contrib/sites/#enabling-the-sites-framework

'WSGIRequest' object has no attribute 'id' - Django Oscar Paypal?

Trying to integrate Django-Oscar-Paypal with my project. I'm using Paypal express version. On checkout the flow is going to Paypal's site. But when the Paypal redirects back to my site I'm getting the following error.
AttributeError at /checkout/paypal/preview/16/
'WSGIRequest' object has no attribute 'id'
Request Method: GET
Request URL: http://localhost:8000/checkout/paypal/preview/16/?token=EC-9JB96808VX198132S&PayerID=TYNFGLXS46S2E
Django Version: 1.8.3
Exception Type: AttributeError
Exception Value:
'WSGIRequest' object has no attribute 'id'
Exception Location: /Users/nikhilsingh/djangoOscarEnv/lib/python2.7/site-packages/oscar/apps/offer/applicator.py in get_basket_offers, line 93
Python Executable: /Users/nikhilsingh/djangoOscarEnv/bin/python
Python Version: 2.7.6
Python Path:
['/Users/nikhilsingh/teabox_new/teashop',
'/Users/nikhilsingh/djangoOscarEnv/lib/python27.zip',
'/Users/nikhilsingh/djangoOscarEnv/lib/python2.7',
'/Users/nikhilsingh/djangoOscarEnv/lib/python2.7/plat-darwin',
'/Users/nikhilsingh/djangoOscarEnv/lib/python2.7/plat-mac',
'/Users/nikhilsingh/djangoOscarEnv/lib/python2.7/plat-mac/lib-scriptpackages',
'/Users/nikhilsingh/djangoOscarEnv/Extras/lib/python',
'/Users/nikhilsingh/djangoOscarEnv/lib/python2.7/lib-tk',
'/Users/nikhilsingh/djangoOscarEnv/lib/python2.7/lib-old',
'/Users/nikhilsingh/djangoOscarEnv/lib/python2.7/lib-dynload',
'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7',
'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin',
'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk',
'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac',
'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages',
'/Users/nikhilsingh/djangoOscarEnv/lib/python2.7/site-packages']
Server time: Mon, 5 Oct 2015 07:10:10 +0000
It seems like the basket gets empty on redirection hence no id is found. What can I do to resolve this issue ?

Django ViewDoesNotExist error after installing photologue

I'm using Django 1.5.1. Everything was OK. But as soon as I installed django-photologue through pip I face this error when I visit admin url:
> **ViewDoesNotExist at /admin/**
Could not import django.views.generic.list_detail.object_list. Parent module django.views.generic.list_detail does not exist.
Request Method: GET
Request URL: http://localhost:8000/admin/
Django Version: 1.5.1
Exception Type: ViewDoesNotExist
Exception Value:
Could not import django.views.generic.list_detail.object_list. Parent module django.views.generic.list_detail does not exist.
Exception Location: /usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py in get_callable, line 104
Python Executable: /usr/bin/python
Python Version: 2.7.3
Also when I run syncdb, photologue sync with database without any error and I can import it in shell.
Any idea about how can I solve this error?
to replace the file in the directory urls.py photologue :
"django.views.generic.date_based" and "django.views.generic.list_detail" on "django.views.generic"
"object_list" on "list.ListView"
"object_detail" on "detail.DetailView"
"archive_year" on "dates.YearArchiveView"
"archive_month" on "dates.MonthArchiveView"
"archive_day" on "dates.DayArchiveView"
like this :)
or read :
django-photologue was most likely built for an older version of Django. Looks like the newer version of Django isn't friendly with generic views and prefers class based views instead.
Downloading a fresh copy of Django 1.5.1 shows the following:
http://f.cl.ly/items/0k1J261S2J2f3k3C110I/Image%202013.04.20%203%3A44%3A39%20AM.png
Whereas Django 1.4.2 shows:
http://f.cl.ly/items/152J2U050X0z1j1n0v0D/Image%202013.04.20%203%3A46%3A49%20AM.png
Simply put, the newer version of Django removed the list_detail file.

Django Multi-table Inheritance, Django-model-utils errors

I am working on a hobby project for my garage shop. I was directed to django-model-utils for what I need. (I have serial CNC machines, serial machines have two flow control methods)
I have a parent class of SerialMachine (defines address, baud rate, generic RS-232 definition)
Then I have HardwareFlowControlMachine model which inherits from SerialMachine (defines CTS/DTR/etc)
So when I put machine name into a form (say machine 001) I have a function that get's machine settings.
def getMachineSettings(machine):
from src.apps.cnc.models import SerialMachine
machineSettings = SerialMachine.objects.get(machineName=machine).select_subclasses()
return machineSettings
I get this exception:
DatabaseError: no such column: cnc_hardwareflowcontrolmachine.serialmachine_ptr_id
Now for testing I only have one machine in SoftwareFlowControlMachine (none in Hardware)
I thought maybe HardwareFlowControlMachine needed at least one object for whatever reason. So when I go to /admin/ and try to add a machine to either SoftwareFlowControlMachine or HardwareFlowControlMachine I get this exception:
HardwareFlowControlMachine:
DatabaseError at /admin/cnc/hardwareflowcontrolmachine/
no such column: cnc_hardwareflowcontrolmachine.serialmachine_ptr_id
Request Method: GET
Request URL: http://127.0.0.1:8000/admin/cnc/hardwareflowcontrolmachine/
Django Version: 1.4
Exception Type: DatabaseError
Exception Value:
no such column: cnc_hardwareflowcontrolmachine.serialmachine_ptr_id
Exception Location: C:\Python27\lib\site-packages\django\db\backends\sqlite3\base.py in execute, line 337
Python Executable: C:\Python27\python.exe
Python Version: 2.7.2
SoftwareFlowControlMachine:
DatabaseError at /admin/cnc/softwareflowcontrolmachine/
no such column: cnc_softwareflowcontrolmachine.serialmachine_ptr_id
Request Method: GET
Request URL: http://127.0.0.1:8000/admin/cnc/softwareflowcontrolmachine/
Django Version: 1.4
Exception Type: DatabaseError
Exception Value:
no such column: cnc_softwareflowcontrolmachine.serialmachine_ptr_id
Exception Location: C:\Python27\lib\site-packages\django\db\backends\sqlite3\base.py in execute, line 337
Python Executable: C:\Python27\python.exe
Python Version: 2.7.2
Let me know if I need to provide more info. I am really not sure what I am missing
I got it working. I'm still unclear on why it happened though. A mistake I made is instead of
machineSettings = SerialMachine.objects.get(machineName=machine).select_subclasses()
I needed this
machineSettings = SerialMachine.objects.get_subclass(machineName=machine)
I also just deleted my database and remade it.
Hope this helps others too