First time here? Check out the FAQ!

kporangehat's profile - activity

2022-04-12 02:52:27 -0500 received badge Notable Question (source)
2022-04-12 02:52:27 -0500 received badge Famous Question (source)
2022-04-12 02:52:27 -0500 received badge Popular Question (source)
2020-04-18 07:25:00 -0500 received badge Popular Question (source)
2018-05-21 19:31:46 -0500 received badge Notable Question (source)
2018-05-21 19:31:46 -0500 received badge Famous Question (source)
2018-05-21 19:31:46 -0500 received badge Popular Question (source)
2016-08-05 23:59:34 -0500 received badge Notable Question (source)
2016-08-05 23:59:34 -0500 received badge Popular Question (source)
2016-07-29 03:14:44 -0500 received badge Notable Question (source)
2016-06-27 05:54:15 -0500 received badge Notable Question (source)
2016-01-28 06:47:56 -0500 received badge Famous Question (source)
2015-10-05 10:58:40 -0500 marked best answer images and stylesheets not found

Django 1.4.5
Postgres 9.2
Apache/mod_wsgi
askbot-devel (cloned from github)
DEBUG = True

When I test things with runserver, everything looks great. However, using the base example from the docs to try and get apache to serve the site, none of the images or stylesheets are found. The page otherwise loads fine.

The following is shown in the logs:

[21/May/2013:14:55:41 -0400] "GET /m/default/media/style/style.css?v=1 HTTP/1.1" 404 21420
[21/May/2013:14:55:41 -0400] "GET /m/default/media/js/modernizr.custom.js?v=1 HTTP/1.1" 404 21441
[21/May/2013:14:55:41 -0400] "GET /m/default/media/bootstrap/css/bootstrap.css?v=1 HTTP/1.1" 404 21456
[21/May/2013:14:55:41 -0400] "GET /m/default/media/js/jquery-1.7.2.min.js?v=1 HTTP/1.1" 404 21441
[21/May/2013:14:55:41 -0400] "GET /m/default/media/bootstrap/js/bootstrap.js?v=1 HTTP/1.1" 404 21450
[21/May/2013:14:55:41 -0400] "GET /m/default/media/js/jquery.history.js?v=1 HTTP/1.1" 404 21435
[21/May/2013:14:55:41 -0400] "GET /m/default/media/js/utils.js?v=1 HTTP/1.1" 404 21408
[21/May/2013:14:55:41 -0400] "GET /m/default/media/js/live_search.js?v=1 HTTP/1.1" 404 21426
[21/May/2013:14:55:41 -0400] "GET /m/default/media/js/editor.js?v=1 HTTP/1.1" 404 21411
[21/May/2013:14:55:41 -0400] "GET /m/default/media/images/cc-by-sa.png?v=1 HTTP/1.1" 404 21432
[21/May/2013:14:55:41 -0400] "GET /m/default/media/js/tag_selector.js?v=1 HTTP/1.1" 404 21429
[21/May/2013:14:55:42 -0400] "GET /m/default/media/images/favicon.gif?v=1 HTTP/1.1" 404 21429

I saw the similar Question 8453 which has an answer for adding an additional 2 lines to alias the /m/ urls, so I tried that (pointing to my virtualenv and repo fork respectively) and it didn't work because /askbot/skins/ has no static media in it.

$ ls /home/user/askbot-devel/askbot/skins/
__init__.py  __init__.pyc  loaders.py  loaders.pyc  README  utils.py  utils.pyc

I finally hardcoded default in the alias and edited those two apache conf lines to read:

 Alias /m/admin/ /home/user/.virtualenvs/askbot/lib/python2.6/site-packages/django/contrib/admin/media/
 Alias /m/default/ /home/user/downloads/askbot-devel/askbot/

That doesn't feel right to me hardcoding the default in there even though everything now works. What is that alias supposed to be pointing to exactly?

2015-10-05 10:58:40 -0500 marked best answer How to configure askbot with redis

I've got the github askbot-devel repo installed and running on Postgres 9.2. Now it appears that none of the settings I save on the settings page actually get saved. It's not intermittent, they never appear and there are no errors on the page or in the logs. I saw multiple references to this possibly being related to not having a cacheing system setup.

If I want to use redis, how do I configure askbot to work with it? I only see examples for memcached. Is memcached preferred?

thx

2015-05-22 13:47:19 -0500 received badge Popular Question (source)
2014-10-05 18:25:57 -0500 received badge Popular Question (source)
2014-03-28 15:19:53 -0500 received badge Famous Question (source)
2013-09-29 12:04:09 -0500 received badge Famous Question (source)
2013-09-28 19:38:54 -0500 received badge Famous Question (source)
2013-09-26 05:50:37 -0500 received badge Famous Question (source)
2013-09-04 04:14:16 -0500 received badge Famous Question (source)
2013-06-14 14:31:46 -0500 commented answer auth-related outbound email not working (NoneType object has no attribute 'get_text')

This looks like it was a bug in beautifulsoup4 v4.2.0. I was able to narrow it down to the ampersands used in the title and headline blocks in templates/authopenid/email_validation.html

...
{% block title %}{% trans %}Greetings from the Q&A forum{% endtrans %},{%endblock%}
{% block headline%}{% trans %}Greetings from the Q&A forum{% endtrans %},{%endblock%}
...

Removing those solved the issue. I also noticed that they released v4.2.1 recently which also resolves the issue. Looks like it may have been this bug: https://bugs.launchpad.net/beautifulsoup/+bug/1182183

All is well now. Thanks everyone for your help and input!

(the 'amp' entities in the code block above got converted. But basically in the template there are literal ampersands)

2013-06-14 13:55:47 -0500 received badge Nice Question (source)
2013-06-14 13:15:55 -0500 marked best answer auth-related outbound email not working (NoneType object has no attribute 'get_text')

Running askbot-devel from github and django 1.4.5.

I've configured SMTP info in settings.py and tested my smtp server manually, with the feedback link in askbot and with answer notifications and they seem to work fine.

However, when I sign up a new account or request an account recovery password, I don't get an email and I just see the following in the logs which isn't very helpful or much to go on:

  [Fri May 24 11:16:18 2013] [error] 'NoneType' object has no attribute 'get_text'

That's it. No stack trace and nothing before or after it.

The only get_text I found using grep was in mail/__init__.py clean_html_email():

phrases = map(
    lambda s: s.strip(),
    filter(filter_func, body_element.get_text().split('\n'))
)

Commenting that out didn't work, having DEBUG=True didn't give me any more to go on either. No error occurs in the browser, only in the log, and only that one line.

Update:

I've narrowed it down to deps.django_authopenid.views.send_email_key(). When I run this in the shell I get the same error.

askbot.deps.django_authopenid.views.send_email_key('myemail@example.com', '12345')

/home/ec2-user/.virtualenvs/askbot/lib/python2.6/site-packages/coffin/common.py:73: UserWarning: Cannot translate loader: askbot.skins.loaders.Loader
  warnings.warn('Cannot translate loader: %s' % loader)

'NoneType' object has no attribute 'get_text'

I also tested on the current askbot.org site to try and send a password reset and never got any email so it seems to be broken? Does anyone else have this working?

2013-06-14 13:15:53 -0500 commented answer auth-related outbound email not working (NoneType object has no attribute 'get_text')

I confirmed that downgrading beautifulsoup4 to version 4.1.3 has resolved this issue. Thanks @ngkabra. I'm going to play around a bit to see if I can figure out where the root cause actually lie and will update if I find anything.

2013-06-13 16:56:35 -0500 received badge Citizen Patrol
2013-06-13 10:36:06 -0500 commented answer auth-related outbound email not working (NoneType object has no attribute 'get_text')

I already have that field filled in with a FQDN http://askbot.mydomain.com. Still get the error. I haven't yet tried downgrading beautifulsoup yet as suggested by @ngkabra but will do that today and report back.

2013-06-12 14:19:52 -0500 commented answer seeding vote count for questions

No worries. As for the Vote.VOTE_UP and Vote.VOTE_DOWN, this won't work for seeding a Vote count of more than one when we do the import since we're still limited by a unique constraint on (user_id, voted_post_id). For us it's not a huge issue. In the importer, I'll make a note about this if Votes need to be recalculated.

I don't see any management command for recalculating votes currently, is there one? Not sure what exactly would go wrong though, would it just count that as a single vote up or down? Or would it barf?

2013-06-12 14:01:25 -0500 commented answer seeding vote count for questions

Okay so it looks like I also need to set the Thread.points value as well to get this to work completely. Also, I don't see the points value computed the way you describe above. If I up-vote a post, the database shows the point value as +1 as well.

2013-06-12 12:56:37 -0500 commented answer seeding vote count for questions

Thanks for the clarification. However, clearing the cache doesn't seem to have any effect on the previous behavior. Here's the complete example of what I'm doing to try and seed a vote count of 10 on a particular Post:

post.vote_up_count = 10
post.points = 100
post.save()
Vote(user=PHANTOM_VOTER_USER, voted_post=post, vote=100).save()
cache.clear()

I was going to look into the query that is generated for the question summary front page to investigate further, but I'm not sure where it's being generated.

2013-06-12 12:12:42 -0500 commented answer seeding vote count for questions

Couple of issues: 1) When I run post.points = n, post.save(), the question list doesn't show the votes. However if I click into the Question, the votes are displayed and then the next time I go to the question list, I see the votes listed. Even setting the post.vote_up_count = n as well doesn't display the vote count in the question list. 2) Once I have clicked into the question and navigate back to the question list, the sorting by vote count doesn't seem to work.

I can probably figure this all out, but can you explain the relationship between Vote, and Post.points/vote_up_count/vote_down_count?

2013-06-11 16:19:35 -0500 marked best answer seeding vote count for questions

In the process of rewriting the importer for Zendesk, I'm wondering if there's a generic way to seed the vote count for a particular question. I found the increase_view_count() method for increasing the view count but couldn't find a similar method for increasing the vote count as it seems they have to be specifically linked to the users who submitted the vote.

The Zendesk XML export used to import data doesn't have any specific information regarding who voted for a forum topic, it only has the overall vote count.

Is there a way to do this easily?