Re: [mezzanine-users] Drum auto tags issue.
Thank you Ryne. I follow you instructions to install drum in editable mode with `pip install -e /home/vagrant/drum` When I try to create db with `python manage.py createdb --noinput`, it said: $ python manage.py createdb --noinput /usr/local/lib/python2.7/dist-packages/Mezzanine-4.1.0-py2.7.egg/mezzanine/utils/conf.py:47: UserWarning: You haven't defined the ALLOWED_HOSTS settings, which Django requires. Will fall back to the domains configured as sites. warn("You haven't defined the ALLOWED_HOSTS settings, which " Traceback (most recent call last): File "manage.py", line 14, in execute_from_command_line(sys.argv) File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 353, in execute_from_command_line utility.execute() File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 345, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 348, in run_from_argv self.execute(*args, **cmd_options) File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 398, in execute self.check() File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 426, in check include_deployment_checks=include_deployment_checks, File "/usr/local/lib/python2.7/dist-packages/django/core/checks/registry.py", line 75, in run_checks new_errors = check(app_configs=app_configs) File "/usr/local/lib/python2.7/dist-packages/django/core/checks/urls.py", line 13, in check_url_config return check_resolver(resolver) File "/usr/local/lib/python2.7/dist-packages/django/core/checks/urls.py", line 23, in check_resolver for pattern in resolver.url_patterns: File "/usr/local/lib/python2.7/dist-packages/django/utils/functional.py", line 33, in __get__ res = instance.__dict__[self.name] = self.func(instance) File "/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py", line 417, in url_patterns patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module) File "/usr/local/lib/python2.7/dist-packages/django/utils/functional.py", line 33, in __get__ res = instance.__dict__[self.name] = self.func(instance) File "/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py", line 410, in urlconf_module return import_module(self.urlconf_name) File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module __import__(name) File "/home/vagrant/ywlm/ywlm/urls.py", line 11, in ("^", include("drum.links.urls")), File "/usr/local/lib/python2.7/dist-packages/django/conf/urls/__init__.py", line 52, in include urlconf_module = import_module(urlconf_module) File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module __import__(name) File "/home/vagrant/drum/drum/links/urls.py", line 6, in from drum.links.views import LinkList, LinkCreate, LinkDetail, CommentList, TagList File "/home/vagrant/drum/drum/links/views.py", line 26, in USER_PROFILE_RELATED_NAME = get_profile_model().user.field.related_query_name() File "/usr/local/lib/python2.7/dist-packages/Mezzanine-4.1.0-py2.7.egg/mezzanine/accounts/__init__.py", line 30, in get_profile_model raise ProfileNotConfigured On Friday, July 15, 2016 at 9:47:50 PM UTC+8, Ryne Everett wrote: > > Is there any best practise to setup a development environment? Or just run >> `python setup.py install` each time after I change the source code. > > > Use `python setup.py develop` ( > http://setuptools.readthedocs.io/en/latest/setuptools.html?#development-mode) > or `pip install -e ` ( > https://pip.pypa.io/en/stable/reference/pip_install/#editable-installs). > > On Fri, Jul 15, 2016 at 2:26 AM, Lyric Wei <5h3...@gmail.com > > wrote: > >> You are great! I have forked drum and plan to do some modifications. >> >> Is there any best practise to setup a development environment? Or just >> run `python setup.py install` each time after I change the source code. >> >> >> On Fri, Jul 15, 2016 at 1:20 PM Stephen McDonald > > wrote: >> >>> On Fri, Jul 15, 2016 at 2:33 PM, Lyric Wei <5h3...@gmail.com >>> > wrote: >>> >>>> I think the fix you mentioned is correct. If I recall it's related to a >>>>> change between Django 1.8 and 1.9, and we made the same fix in Mezzanine >>>>> already, but Drum was not updated presumably. I can submit the fix if you >>>>> really don't want to, bu
Re: [mezzanine-users] Drum auto tags issue.
You are great! I have forked drum and plan to do some modifications. Is there any best practise to setup a development environment? Or just run `python setup.py install` each time after I change the source code. On Fri, Jul 15, 2016 at 1:20 PM Stephen McDonald wrote: > On Fri, Jul 15, 2016 at 2:33 PM, Lyric Wei <5h3l...@gmail.com> wrote: > >> I think the fix you mentioned is correct. If I recall it's related to a >>> change between Django 1.8 and 1.9, and we made the same fix in Mezzanine >>> already, but Drum was not updated presumably. I can submit the fix if you >>> really don't want to, but I encourage you to. >>> >>> >> Oh, I am glad to do that.. I don't find source code of Mezzanine in Drum >> project, but I got this: >> https://github.com/stephenmcd/drum/blob/master/setup.py#L54 . Since you >> have made the fix in latest Mezzanine, I can simply change this line, from >> "mezzanine >= 4.0.1" to "mezzanine >= 4.1.0", am i right? >> > > That needs to happen, but it's separate from the fix - what I meant was > that Drum literally needs the same change that was applied to Mezzanine. > > I've bumped the version here: > https://github.com/stephenmcd/drum/commit/177a202e012ac4c65a5aa2aa289b11008a1c62b7 > And made the fix here: > https://github.com/stephenmcd/drum/commit/7b327615a93ee4fa04d595b53d20f9d9f34db925 > > >> >> That's excellent info, thanks for going into detail there. >>> >>> Do you think it's possible to programmatically extract tags in those >>> languages, using different logic? If so we can make the extract function >>> configurable by the developer. >>> >> >> Yes. Search engines like Google need this kind of technology to create >> indexes for each words to support different languages. And there are >> several existed open source projects to extract tags in those languages. >> >> A famous project named JieBa(https://github.com/fxsjy/jieba): a chinese >> text segmentation project in Python, which use dictionary and statistical >> result to extract words, also works for Japanese if we provide suitable >> dictionary. >> > > I've made the tag extraction configurable now, see here: > https://github.com/stephenmcd/drum/commit/147984d813c54996e0b97f32959fdd3992bf509d > > >> >> >> On Friday, July 15, 2016 at 7:38:45 AM UTC+8, Stephen McDonald wrote: >> >>> >>> >>> On Thu, Jul 14, 2016 at 5:31 PM, Lyric Wei <5h3...@gmail.com> wrote: >>> >>>> > If you have a bug fix, please go ahead and submit it in a pull >>>> request via Github. >>>> >>>> I am trying to fix it, not yet. I am not familiar with django. But I >>>> though it's a bug in mezzanine.core.models. >>>> >>> >>> I think the fix you mentioned is correct. If I recall it's related to a >>> change between Django 1.8 and 1.9, and we made the same fix in Mezzanine >>> already, but Drum was not updated presumably. I can submit the fix if you >>> really don't want to, but I encourage you to. >>> >>> >>>> >>>> > What do you mean? >>>> >>>> I am requesting a new feature, the tags should support non-character >>>> based languages, like Japanese, Arabic, Chinese, etc. >>>> >>>> the current keywords extract approach doesn't support those languages. >>>> >>>> Maybe we can allow user to add tag when they add new links, manually >>>> adding tags, but simple. >>>> >>>> or >>>> >>>> Drum support different keywords extract approaches, to extract keywords >>>> from non-character based languages. >>>> >>>> Btw, words in those non-character based languages are not split by >>>> *space* and *symbols*.That's why I say "different keywords extract >>>> approaches". for example, >>>> >>>> In English, we say "This morning, the weather is good", can be split as >>>> "This", "morning", "the", "weather", "is", "good" by space and symbols. >>>> >>>> In Japanese, we say 今朝は天気が良いです, can be split as "今朝", "は", "天気", "が", >>>> "良い", "です", according to the grammar, not the space and symbols. >>>> >>>> In Chinese, we say 今天早上天气不错, can be split as "今天", "早上&
Re: [mezzanine-users] Drum auto tags issue.
> > I think the fix you mentioned is correct. If I recall it's related to a > change between Django 1.8 and 1.9, and we made the same fix in Mezzanine > already, but Drum was not updated presumably. I can submit the fix if you > really don't want to, but I encourage you to. > > Oh, I am glad to do that.. I don't find source code of Mezzanine in Drum project, but I got this: https://github.com/stephenmcd/drum/blob/master/setup.py#L54 . Since you have made the fix in latest Mezzanine, I can simply change this line, from "mezzanine >= 4.0.1" to "mezzanine >= 4.1.0", am i right? That's excellent info, thanks for going into detail there. > > Do you think it's possible to programmatically extract tags in those > languages, using different logic? If so we can make the extract function > configurable by the developer. > Yes. Search engines like Google need this kind of technology to create indexes for each words to support different languages. And there are several existed open source projects to extract tags in those languages. A famous project named JieBa(https://github.com/fxsjy/jieba): a chinese text segmentation project in Python, which use dictionary and statistical result to extract words, also works for Japanese if we provide suitable dictionary. On Friday, July 15, 2016 at 7:38:45 AM UTC+8, Stephen McDonald wrote: > > > > On Thu, Jul 14, 2016 at 5:31 PM, Lyric Wei <5h3...@gmail.com > > wrote: > >> > If you have a bug fix, please go ahead and submit it in a pull request >> via Github. >> >> I am trying to fix it, not yet. I am not familiar with django. But I >> though it's a bug in mezzanine.core.models. >> > > I think the fix you mentioned is correct. If I recall it's related to a > change between Django 1.8 and 1.9, and we made the same fix in Mezzanine > already, but Drum was not updated presumably. I can submit the fix if you > really don't want to, but I encourage you to. > > >> >> > What do you mean? >> >> I am requesting a new feature, the tags should support non-character >> based languages, like Japanese, Arabic, Chinese, etc. >> >> the current keywords extract approach doesn't support those languages. >> >> Maybe we can allow user to add tag when they add new links, manually >> adding tags, but simple. >> >> or >> >> Drum support different keywords extract approaches, to extract keywords >> from non-character based languages. >> >> Btw, words in those non-character based languages are not split by >> *space* and *symbols*.That's why I say "different keywords extract >> approaches". for example, >> >> In English, we say "This morning, the weather is good", can be split as >> "This", "morning", "the", "weather", "is", "good" by space and symbols. >> >> In Japanese, we say 今朝は天気が良いです, can be split as "今朝", "は", "天気", "が", >> "良い", "です", according to the grammar, not the space and symbols. >> >> In Chinese, we say 今天早上天气不错, can be split as "今天", "早上", "天气", "不错", >> according to the grammar either, not the space and symbols. >> > > That's excellent info, thanks for going into detail there. > > Do you think it's possible to programmatically extract tags in those > languages, using different logic? If so we can make the extract function > configurable by the developer. > > >> >> >> >> >> >> >> On Thursday, July 14, 2016 at 3:11:21 PM UTC+8, Stephen McDonald wrote: >> >>> >>> >>> On Thu, Jul 14, 2016 at 4:54 PM, Lyric Wei <5h3...@gmail.com> wrote: >>> >>>> Thank you for quick response. Now django show me the follow error >>>> message in /usr/local/lib/python2.7/dist-packages/drum/links/models.py >>>> >>>> > self.keywords.add(AssignedKeyword(keyword=keyword)) >>>> >>>> > instance isn't saved. Use bulk=False or save the object first. >>>> >>>> I check out the code and found how to resolve it. I have to pass >>>> bulk=False to save method to bypass. >>>> >>> >>> If you have a bug fix, please go ahead and submit it in a pull request >>> via Github. >>> >>> >>>> >>>> Oh yes, the more important question. Is it possible to add an existed >>>> tag manually when u
Re: [mezzanine-users] Drum auto tags issue.
> If you have a bug fix, please go ahead and submit it in a pull request via Github. I am trying to fix it, not yet. I am not familiar with django. But I though it's a bug in mezzanine.core.models. > What do you mean? I am requesting a new feature, the tags should support non-character based languages, like Japanese, Arabic, Chinese, etc. the current keywords extract approach doesn't support those languages. Maybe we can allow user to add tag when they add new links, manually adding tags, but simple. or Drum support different keywords extract approaches, to extract keywords from non-character based languages. Btw, words in those non-character based languages are not split by *space* and *symbols*.That's why I say "different keywords extract approaches". for example, In English, we say "This morning, the weather is good", can be split as "This", "morning", "the", "weather", "is", "good" by space and symbols. In Japanese, we say 今朝は天気が良いです, can be split as "今朝", "は", "天気", "が", "良い", "です", according to the grammar, not the space and symbols. In Chinese, we say 今天早上天气不错, can be split as "今天", "早上", "天气", "不错", according to the grammar either, not the space and symbols. On Thursday, July 14, 2016 at 3:11:21 PM UTC+8, Stephen McDonald wrote: > > > > On Thu, Jul 14, 2016 at 4:54 PM, Lyric Wei <5h3...@gmail.com > > wrote: > >> Thank you for quick response. Now django show me the follow error message >> in /usr/local/lib/python2.7/dist-packages/drum/links/models.py >> >> > self.keywords.add(AssignedKeyword(keyword=keyword)) >> >> > instance isn't saved. Use bulk=False or save the object first. >> >> I check out the code and found how to resolve it. I have to pass >> bulk=False to save method to bypass. >> > > If you have a bug fix, please go ahead and submit it in a pull request via > Github. > > >> >> Oh yes, the more important question. Is it possible to add an existed tag >> manually when user adding a link? >> >> Because I am using drum for international site, a lot of languages, like >> Japanese, Korean, Arabic, Chinese, are not supported by the keyword extract >> method drum is using, which i found it in `save` method. >> > > What do you mean? > > >> >> I though there are two approaches to solve the problem, to support >> different language: >> >> 1. allow visitors who submit the link to add tags either. >> 2. allow drum to support different word extract method, which i suppose >> the user can specified in settings.py. >> >> I thought the first is easy, but 2nd is more powerful. >> >> On Thursday, July 14, 2016 at 9:53:22 AM UTC+8, Stephen McDonald wrote: >>> >>> In Mezzanine they're called "keywords", so you should see that. >>> >>> I've just updated the readme to mention that. >>> >>> On Wed, Jul 13, 2016 at 10:31 PM, Lyric Wei <5h3...@gmail.com> wrote: >>> >>>> Hi there, >>>> >>>> I am using drum(https://github.com/stephenmcd/drum) as a news social >>>> website. drum is a Reddit / Hacker News clone for Mezzanine. >>>> >>>> Its document mentioned that >>>> >>>> > This means that for auto-tagging to work, the tags must already exist >>>> in the database. You can either add them manually via the admin... >>>> >>>> But I can't find the way to add existed tags in the admin panel. Could >>>> you help me? >>>> >>>> Thank you. >>>> >>>> -- >>>> You received this message because you are subscribed to the Google >>>> Groups "Mezzanine Users" group. >>>> To unsubscribe from this group and stop receiving emails from it, send >>>> an email to mezzanine-use...@googlegroups.com. >>>> For more options, visit https://groups.google.com/d/optout. >>>> >>> >>> >>> >>> -- >>> Stephen McDonald >>> http://jupo.org >>> >> -- >> You received this message because you are subscribed to the Google Groups >> "Mezzanine Users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to mezzanine-use...@googlegroups.com . >> For more options, visit https://groups.google.com/d/optout. >> > > > > -- > Stephen McDonald > http://jupo.org > -- You received this message because you are subscribed to the Google Groups "Mezzanine Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to mezzanine-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [mezzanine-users] Drum auto tags issue.
Thank you for quick response. Now django show me the follow error message in /usr/local/lib/python2.7/dist-packages/drum/links/models.py > self.keywords.add(AssignedKeyword(keyword=keyword)) > instance isn't saved. Use bulk=False or save the object first. I check out the code and found how to resolve it. I have to pass bulk=False to save method to bypass. Oh yes, the more important question. Is it possible to add an existed tag manually when user adding a link? Because I am using drum for international site, a lot of languages, like Japanese, Korean, Arabic, Chinese, are not supported by the keyword extract method drum is using, which i found it in `save` method. I though there are two approaches to solve the problem, to support different language: 1. allow visitors who submit the link to add tags either. 2. allow drum to support different word extract method, which i suppose the user can specified in settings.py. I thought the first is easy, but 2nd is more powerful. On Thursday, July 14, 2016 at 9:53:22 AM UTC+8, Stephen McDonald wrote: > > In Mezzanine they're called "keywords", so you should see that. > > I've just updated the readme to mention that. > > On Wed, Jul 13, 2016 at 10:31 PM, Lyric Wei <5h3...@gmail.com > > wrote: > >> Hi there, >> >> I am using drum(https://github.com/stephenmcd/drum) as a news social >> website. drum is a Reddit / Hacker News clone for Mezzanine. >> >> Its document mentioned that >> >> > This means that for auto-tagging to work, the tags must already exist >> in the database. You can either add them manually via the admin... >> >> But I can't find the way to add existed tags in the admin panel. Could >> you help me? >> >> Thank you. >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Mezzanine Users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to mezzanine-use...@googlegroups.com . >> For more options, visit https://groups.google.com/d/optout. >> > > > > -- > Stephen McDonald > http://jupo.org > -- You received this message because you are subscribed to the Google Groups "Mezzanine Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to mezzanine-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[mezzanine-users] Drum auto tags issue.
Hi there, I am using drum(https://github.com/stephenmcd/drum) as a news social website. drum is a Reddit / Hacker News clone for Mezzanine. Its document mentioned that > This means that for auto-tagging to work, the tags must already exist in the database. You can either add them manually via the admin... But I can't find the way to add existed tags in the admin panel. Could you help me? Thank you. -- You received this message because you are subscribed to the Google Groups "Mezzanine Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to mezzanine-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.