Comments (4)
Hi Xavi: I'm not sure what's the problem, but you shouldn't use sqlite. BTW, I recommend you to try with this deployment script: https://github.com/agoravoting/agora-ciudadana-box
from agora-ciudadana.
Thanks Edulix. I'll try with the agora box.
from agora-ciudadana.
After having several problems with the deployment script, I have changed the database to PostgreSQL. The site works much faster than SQL Lite, but the error still appears.
I think is a security issue, regarding at the line authentication.py
line 161:
if request.META.get('HTTP_AUTHORIZATION') ...
else:
username = request.GET.get('username') or request.POST.get('username')
api_key = request.GET.get('api_key') or request.POST.get('api_key')
...
Neither the headers or GET/POST data contain API Key. In debug mode I have set the request.META
dictionary to {'HTTP_AUTHORIZATION' : 'apikey xavi:xxxxxxxxxxxxxxxx'}
with the proper API Key and it works fine.
The request is generated in agora_view.html
line 93:
var ajax_data = {
'tallied_elections': {% rest request '/agora/' agora.id '/tallied_elections/?limit=3' %},
'agora': {% rest request '/agora/' agora.id '/' %},
'user_permissions': {% custom_rest request "POST" '{"action":"get_permissions"}' '/agora/' agora.id '/action/' %}
};
The custom rest request in POST to obtain user permissions must be authenticated in order to succeed.
In any case, the error should not produce this error page. Instead, receiving a 401 Ajax response should only display a blank content.
Searching about the AttributeError 'str' object has no attribute 'get', it seems that the response returned to Django is a string instead of HttpResponse, but debugging the code becomes too complex to find out the exact place.
Could you look ajax_data
to see where the headers are managed and maybe add the Authorization
header?
from agora-ciudadana.
Last commit solved the issue, thanks @danigm !
from agora-ciudadana.
Related Issues (20)
- AgoraSettingsView - Settings of an agora
- CreateAgoraForm
- Create/Edit VotingForm HOT 1
- ContactForm
- SearchView
- cancel email notifications view
- Allow to show temporary results on a election. HOT 2
- whoosh requirement needs a version HOT 2
- 'extra' field in User and Profile does't validate HOT 1
- The install instructions lead to no site error HOT 7
- SpellChecker was removed from Whoosh HOT 3
- Develop from a common vagrant development environment HOT 5
- Set github repo to use active branch as default HOT 3
- API auth token HOT 2
- DNIe backend
- The βVisualβ tab shows who you delegated in HOT 1
- Manage translations via Transifex
- No me funciona el proyecto HOT 3
- screenshots please HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from agora-ciudadana.