swappsco / django-qa Goto Github PK
View Code? Open in Web Editor NEWThis project forked from arjunkomath/simple-q-a-app-using-python-django
A simple Q&A App
Home Page: http://django-qa.readthedocs.io/en/latest/index.html
License: MIT License
This project forked from arjunkomath/simple-q-a-app-using-python-django
A simple Q&A App
Home Page: http://django-qa.readthedocs.io/en/latest/index.html
License: MIT License
Actually, you can mark a question as resolved. But you can't say which answer resolve the question.
It would be useful if you can mark and show which answer resolve the question.
There is no easy way to change or customize the actual widget theme for the buttons on the markdown text areas where the package django-markdown-app expose them.
The index template is throwing an exception NoReverseMatch for Reverse for 'qa_tag' with arguments '(' Preguntas',)' and keyword arguments '{}' not found. 1 pattern(s) tried: ['tag/(?P<tag>[-\\w]+)/$']
I think that the package is somehow stable, and we should be able to start adding features toward a 1.0.0 release.
The next release of the package will probably include improvements to the view count (0.1.0) and before the major release i would like to have a simple reputation system in place.
Another thing we are missing is documentation.
@swappsco/developers @sebastian-code What else do you think that we should include/improve for that release?
It would be nice to open an IRC channel to ask questions about dev and usage of Django-qa. ;)
We should be supporting the latest release. Please update.
Django Version: | 1.11.5 |
---|
Python Version: | 3.5.4 |
---|
Steps to reproduce:
Error during template rendering In template /home/u/freedomregistry/local/lib/python2.7/site-packages/django/contrib/admin/templates/admin/change_form.html, error at line 21
› {% if add %}{% blocktrans with name=opts.verbose_name %}Add {{ name }}{% endblocktrans %}{% else %}{{ original|truncatewords:"18" }}{% endif %}
Traceback:
File "/app/.heroku/python/lib/python2.7/site-packages/django/core/handlers/exception.py" in inner
42. response = get_response(request)
File "/app/.heroku/python/lib/python2.7/site-packages/django/core/handlers/base.py" in _legacy_get_response
249. response = self._get_response(request)
File "/app/.heroku/python/lib/python2.7/site-packages/django/core/handlers/base.py" in _get_response
217. response = self.process_exception_by_middleware(e, request)
File "/app/.heroku/python/lib/python2.7/site-packages/django/core/handlers/base.py" in _get_response
215. response = response.render()
File "/app/.heroku/python/lib/python2.7/site-packages/django/template/response.py" in render
109. self.content = self.rendered_content
File "/app/.heroku/python/lib/python2.7/site-packages/django/template/response.py" in rendered_content
86. content = template.render(context, self._request)
File "/app/.heroku/python/lib/python2.7/site-packages/django/template/backends/django.py" in render
66. return self.template.render(context)
File "/app/.heroku/python/lib/python2.7/site-packages/opbeat/instrumentation/packages/base.py" in __call__
63. args, kwargs)
File "/app/.heroku/python/lib/python2.7/site-packages/opbeat/instrumentation/packages/base.py" in call_if_sampling
222. return self.call(module, method, wrapped, instance, args, kwargs)
File "/app/.heroku/python/lib/python2.7/site-packages/opbeat/instrumentation/packages/django/template.py" in call
18. return wrapped(*args, **kwargs)
File "/app/.heroku/python/lib/python2.7/site-packages/django/template/base.py" in render
208. return self._render(context)
File "/app/.heroku/python/lib/python2.7/site-packages/newrelic/api/function_trace.py" in dynamic_wrapper
95. return wrapped(*args, **kwargs)
File "/app/.heroku/python/lib/python2.7/site-packages/django/template/base.py" in _render
199. return self.nodelist.render(context)
File "/app/.heroku/python/lib/python2.7/site-packages/django/template/base.py" in render
994. bit = node.render_annotated(context)
File "/app/.heroku/python/lib/python2.7/site-packages/django/template/base.py" in render_annotated
961. return self.render(context)
File "/app/.heroku/python/lib/python2.7/site-packages/django/template/loader_tags.py" in render
174. return compiled_parent._render(context)
File "/app/.heroku/python/lib/python2.7/site-packages/newrelic/api/function_trace.py" in dynamic_wrapper
95. return wrapped(*args, **kwargs)
File "/app/.heroku/python/lib/python2.7/site-packages/django/template/base.py" in _render
199. return self.nodelist.render(context)
File "/app/.heroku/python/lib/python2.7/site-packages/django/template/base.py" in render
994. bit = node.render_annotated(context)
File "/app/.heroku/python/lib/python2.7/site-packages/django/template/base.py" in render_annotated
961. return self.render(context)
File "/app/.heroku/python/lib/python2.7/site-packages/django/template/loader_tags.py" in render
174. return compiled_parent._render(context)
File "/app/.heroku/python/lib/python2.7/site-packages/newrelic/api/function_trace.py" in dynamic_wrapper
95. return wrapped(*args, **kwargs)
File "/app/.heroku/python/lib/python2.7/site-packages/django/template/base.py" in _render
199. return self.nodelist.render(context)
File "/app/.heroku/python/lib/python2.7/site-packages/django/template/base.py" in render
994. bit = node.render_annotated(context)
File "/app/.heroku/python/lib/python2.7/site-packages/django/template/base.py" in render_annotated
961. return self.render(context)
File "/app/.heroku/python/lib/python2.7/site-packages/django/template/defaulttags.py" in render
315. return nodelist.render(context)
File "/app/.heroku/python/lib/python2.7/site-packages/django/template/base.py" in render
994. bit = node.render_annotated(context)
File "/app/.heroku/python/lib/python2.7/site-packages/django/template/base.py" in render_annotated
961. return self.render(context)
File "/app/.heroku/python/lib/python2.7/site-packages/newrelic/hooks/framework_django.py" in wrapper
748. return wrapped(*args, **kwargs)
File "/app/.heroku/python/lib/python2.7/site-packages/django/template/loader_tags.py" in render
70. result = block.nodelist.render(context)
File "/app/.heroku/python/lib/python2.7/site-packages/django/template/base.py" in render
994. bit = node.render_annotated(context)
File "/app/.heroku/python/lib/python2.7/site-packages/django/template/base.py" in render_annotated
961. return self.render(context)
File "/app/.heroku/python/lib/python2.7/site-packages/django/template/defaulttags.py" in render
315. return nodelist.render(context)
File "/app/.heroku/python/lib/python2.7/site-packages/django/template/base.py" in render
994. bit = node.render_annotated(context)
File "/app/.heroku/python/lib/python2.7/site-packages/django/template/base.py" in render_annotated
961. return self.render(context)
File "/app/.heroku/python/lib/python2.7/site-packages/django/template/base.py" in render
1044. output = self.filter_expression.resolve(context)
File "/app/.heroku/python/lib/python2.7/site-packages/django/template/base.py" in resolve
739. new_obj = func(obj, *arg_vals)
File "/app/.heroku/python/lib/python2.7/site-packages/django/template/defaultfilters.py" in _dec
47. args[0] = force_text(args[0])
File "/app/.heroku/python/lib/python2.7/site-packages/django/utils/encoding.py" in force_text
80. s = six.text_type(bytes(s), encoding, errors)
Exception Type: UnicodeEncodeError at /admin/qa/answer/8/change/
Exception Value: 'ascii' codec can't encode character u'\u2019' in position 257: ordinal not in range(128)
The cause is __str__
/__unicode__
methods of models are being not properly implemented. It must be wrapped with python_2_unicode_compatible
as described on
https://docs.djangoproject.com/en/1.11/ref/models/instances/#str
plz provide how to use this app once it is installed.
i found qa files in my libraries of the project but don't know what to import and what functions to call to get my work done. plz provide ASAP.
Have details about how much reputation has an user on every tag he has participated.
All package settings should be inside of a dictionary.
I'm missing some documentation on the features and quickstart with django-qa. Would it be possible to get some heads up docs?
The app has no url routing implemented properly, right now the urls file is inside the example proyect, so the app lacks urls in case is used outside that scope.
Does this project use Django Comments (https://django-contrib-comments.readthedocs.io/en/latest/)?
Through the refactoring process, the ability to close a question and picking the right answer to the question was lost. There is the need to recover that.
Currently is into the app. Move it to the test project
Around commit c6ddb9b the question detail url is broken for new question, but is working perfectly for older questions.
Right now QuestionIndexView and QuestionsByTagView are two different entities but in the practice they are the same view, only the QuestionsByTagView consider only the questions related to a specific tag. For this reason, It would be nice to organize QuestionIndexView in a way that QuestionsByTagView could inherit it and just overwrite its queryset.
Swapps uses fondly CodeShip, but there is also space to consider Travis CI and at least coverage integration with Coveralls I/O, Requirements I/O would be also nice to have.
For some reason we are using some dependencies that we should not:
We may need to review the pytz, but for now removing the other 2 should take priority.
Hello,
I just tryed to install django-qa but i have got the folowing error.
I tried it on a new django install,
pip install django-qa
and i simply add
INSTALLED_APPS = ( ... 'qa', 'taggit', 'hitcount', ... )
TemplateDoesNotExist at /en/admin/qa/question/add/
django_markdown/editor_init.html
Request Method: GET
Request URL: http://192.168.122.150:8000/en/admin/qa/question/add/
Django Version: 1.8.18
Exception Type: TemplateDoesNotExist
Exception Value:
django_markdown/editor_init.html
Exception Location: /root/env/decattitude/lib/python3.5/site-packages/django/template/loader.py in get_template, line 46
Python Executable: /root/env/decattitude/bin/python
Python Version: 3.5.3
Python Path:
['/root/projects/qa_question',
'/root/env/decattitude/lib/python35.zip',
'/root/env/decattitude/lib/python3.5',
'/root/env/decattitude/lib/python3.5/plat-x86_64-linux-gnu',
'/root/env/decattitude/lib/python3.5/lib-dynload',
'/usr/lib/python3.5',
'/usr/lib/python3.5/plat-x86_64-linux-gnu',
'/root/env/decattitude/lib/python3.5/site-packages']
Server time: Tue, 5 Sep 2017 09:32:54 +0200
Template-loader postmortem
Django tried loading these templates, in this order:
Using loader django.template.loaders.filesystem.Loader:
/root/projects/qa_question/qa_question/templates/django_markdown/editor_init.html (File does not exist)
Using loader django.template.loaders.app_directories.Loader:
/root/env/decattitude/lib/python3.5/site-packages/djangocms_admin_style/templates/django_markdown/editor_init.html (File does not exist)
/root/env/decattitude/lib/python3.5/site-packages/django/contrib/auth/templates/django_markdown/editor_init.html (File does not exist)
/root/env/decattitude/lib/python3.5/site-packages/django/contrib/admin/templates/django_markdown/editor_init.html (File does not exist)
/root/env/decattitude/lib/python3.5/site-packages/django/contrib/sitemaps/templates/django_markdown/editor_init.html (File does not exist)
/root/env/decattitude/lib/python3.5/site-packages/cms/templates/django_markdown/editor_init.html (File does not exist)
/root/env/decattitude/lib/python3.5/site-packages/menus/templates/django_markdown/editor_init.html (File does not exist)
/root/env/decattitude/lib/python3.5/site-packages/treebeard/templates/django_markdown/editor_init.html (File does not exist)
/root/env/decattitude/lib/python3.5/site-packages/djangocms_text_ckeditor/templates/django_markdown/editor_init.html (File does not exist)
/root/env/decattitude/lib/python3.5/site-packages/filer/templates/django_markdown/editor_init.html (File does not exist)
/root/env/decattitude/lib/python3.5/site-packages/djangocms_column/templates/django_markdown/editor_init.html (File does not exist)
/root/env/decattitude/lib/python3.5/site-packages/djangocms_link/templates/django_markdown/editor_init.html (File does not exist)
/root/env/decattitude/lib/python3.5/site-packages/cmsplugin_filer_file/templates/django_markdown/editor_init.html (File does not exist)
/root/env/decattitude/lib/python3.5/site-packages/cmsplugin_filer_folder/templates/django_markdown/editor_init.html (File does not exist)
/root/env/decattitude/lib/python3.5/site-packages/cmsplugin_filer_image/templates/django_markdown/editor_init.html (File does not exist)
/root/env/decattitude/lib/python3.5/site-packages/djangocms_style/templates/django_markdown/editor_init.html (File does not exist)
/root/env/decattitude/lib/python3.5/site-packages/djangocms_snippet/templates/django_markdown/editor_init.html (File does not exist)
/root/env/decattitude/lib/python3.5/site-packages/djangocms_googlemap/templates/django_markdown/editor_init.html (File does not exist)
/root/env/decattitude/lib/python3.5/site-packages/djangocms_video/templates/django_markdown/editor_init.html (File does not exist)
/root/projects/qa_question/qa_question/templates/django_markdown/editor_init.html (File does not exist)
/root/env/decattitude/lib/python3.5/site-packages/qa/templates/django_markdown/editor_init.html (File does not exist)
Using loader django.template.loaders.eggs.Loader:
In template /root/env/decattitude/lib/python3.5/site-packages/django/contrib/admin/templates/admin/includes/fieldset.html, error at line 19
django_markdown/editor_init.html
9 {% for field in line %}
10 <div{% if not line.fields|length_is:'1' %} class="field-box{% if field.field.name %} field-{{ field.field.name }}{% endif %}{% if not field.is_readonly and field.errors %} errors{% endif %}{% if field.field.is_hidden %} hidden{% endif %}"{% elif field.is_checkbox %} class="checkbox-row"{% endif %}>
11 {% if not line.fields|length_is:'1' and not field.is_readonly %}{{ field.errors }}{% endif %}
12 {% if field.is_checkbox %}
13 {{ field.field }}{{ field.label_tag }}
14 {% else %}
15 {{ field.label_tag }}
16 {% if field.is_readonly %}
17
{{ field.contents }}
### {{ field.field }}
20 {% endif %}
21 {% endif %}
22 {% if field.field.help_text %}
23
{{ field.field.help_text|safe }}
With the migration to a CBV system on the views, we broke the reputation management system, that should be recovered. A "nice to have" setting would be to be able to implement a default set of scores to give credit on the users, but that should be able to be overrided somewhere, so one can change those.
Test test_question_by_tag_returns_related_tag_questions
fails on line 408 and line 412, the test reports TypeError: 'SQLCompiler' object is not callable
.
If I try to install django-qa
from pip, I get a dependency that can't be satisfied.
The dependency is django-markdown-app
. django-qa
require django-markdown-app
at version 0.9.2 but the only available versions are 0.8.5, 0.8.5.1, 0.9.3.1, 0.9.4 and 0.9.4.1.
I launched pip on:
Command launched:
pip install django-qa
Result:
Collecting django-qa
Using cached django-qa-0.9.1.tar.gz
Collecting django-annoying==0.10.3 (from django-qa)
Using cached django_annoying-0.10.3-py2.py3-none-any.whl
Collecting django-markdown-app==0.9.2 (from django-qa)
Could not find a version that satisfies the requirement django-markdown-app==0.9.2 (from django-qa) (from versions: 0.8.5, 0.8.5.1, 0.9.3.1, 0.9.4, 0.9.4.1)
No matching distribution found for django-markdown-app==0.9.2 (from django-qa)
In all views, the HTML head elements are inside the body.
This is what I get at the top of the HTML:
<div class="topbar"></div>
<div class="container">
<title>Simple QA</title>
<link rel="icon" type="image/png" href="static/qa/icon.ico">
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
<link href='http://fonts.googleapis.com/css?family=Lobster' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Roboto:300' rel='stylesheet' type='text/css'>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" type="text/css">
<link href="/static/css/qa.css" rel="stylesheet"/>
<div class="page-header">
No part.
Profile is too generic, and users may already have that into their project. Simply use a different name (add a prefix or something) to avoid the clash and keep the work required to install the app at the minimum.
Currently if another app in the project uses django-taggit, the tags from django-qa shows up anywhere, and the tags created elsewhere shows up on django-qa.
We must modify the query for the tags so only the tags created for django-qa show up on our side.
Currently it only has a field. Need to have both of them.
The test test_create_question_view_one on the Test Views module is broken, throws this stacktrace:
/home/maestro/Workspace/django-qa/env/lib/python3.4/site-packages/django_markdown/utils.py:47: RemovedInDjango110Warning: render() must be called with a dict, not a Context.
return INIT_TEMPLATE.render(ctx)
F....
======================================================================
FAIL: test_create_question_view_one (qa.tests.test_views.TestViews)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/maestro/Workspace/django-qa/qa/tests/test_views.py", line 48, in test_create_question_view_one
self.assertEqual(response.status_code, 302)
AssertionError: 200 != 302
Right now the package lacks documentation. Part of it because there is no clear path to what is needed as documentation for the project.
I installed Django-qa following the docs/installation.rst
and docs/index.rst
instructions.
But the vote system don't work. It is not visible at all on the views.
@cdvv7788 Django 1.9 implements it's own LoginRequired mixin, and obviously, there is the django-braces one, why to implement your own?
When the answer is recorded, it throws the next error: NOT NULL constraint failed: qa_answer.user_id
The vote view (both for up vote and down vote) is not working properly, because it is calling directly the user name and not an instance throwing this error: ValueError: Cannot query "maestro": Must be "User" instance.
The url doesn't exist when I try to close the question. Can someone help?
Hi guy, I'm following instruction in this page to install django-qa : https://django-qa.readthedocs.io/en/latest/installation.html
And I failed.
When I run python manage.py migrate, I get this :
File "E:\Course\341_project\test_qa\venv\lib\importlib_init_.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 994, in _gcd_import
File "", line 971, in _find_and_load
File "", line 955, in _find_and_load_unlocked
File "", line 665, in _load_unlocked
File "", line 678, in exec_module
File "", line 219, in call_with_frames_removed
File "E:\Course\341_project\test_qa\venv\lib\site-packages\qa\urls.py", line 3, in
from . import views
File "E:\Course\341_project\test_qa\venv\lib\site-packages\qa\views.py", line 377, in
class QuestionDetailView(HitCountDetailView):
File "E:\Course\341_project\test_qa\venv\lib\site-packages\qa\views.py", line 386, in QuestionDetailView
count_hit = settings.QA_SETTINGS['count_hits']
File "E:\Course\341_project\test_qa\venv\lib\site-packages\django\conf_init.py", line 57, in getattr
val = getattr(self._wrapped, name)
AttributeError: 'Settings' object has no attribute 'QA_SETTINGS'
I cannot figure out what's root cause. Could you please try the installation and take a look on this? thanks.
The template comment.html was loading due to a error to reverse the URLConf to the comments on the link inside the form.
On commit b40fdae I introduced an empty link to the post form in the template, and it was fixed, but it shouldn't, or at least I don't know why.
On the 0.9.4.1 release, the setup.py
file say it's version is 0.9.1
.
It should allow me to select if i want to count the hits from any user or just the logged in ones.
How the view has to be calculated and how it has to be accounted for. Actually every time the detail of a question is loaded, a new "view" is added. And plus that, the way the views are being rendered, it sums 3 new views which had no place.
This behaviour is creating wrong statistics on the package.
Pypi requires rst to work. There are 2 options:
None of the templates on the test project are loading.
The CreateQuestion view is throwing an error related to bad reverse routing.
Implement test on the app
Currently it works only with the default user model. Need to make the references point to AUTH_USER_MODEL.
Currently it is just a couple of pictures, should contain a description of the installation process. Also, the pictures are broken in pypi.
Django-Taggit is the reference when tagging on any django app, it should be implemented, but there is the need to validate than the tags are not shared between apps, mainly to improve searching functionalities, but also for isolation and to avoid interdependencies.
The Django template engine allows to create a basic template for the package, so it can meld within the base theme the developer is using for it's own template structure.
As a developer I want to have that chance to integrate all my packages in a clean way into my software when I use a Django package.
Adding this into Readme would help a lot.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.