Django Haystack Rebuild Index - django-haystack

I was reading the 'Getting Started' guide of Haystack and tried to implement Whoosh backend for my website with Haystack. I was successful in setting up the whole project and I can also see the search box on my search.html template. I am unable to build the index though.
When I type ./manage.py rebuild_index, I get the error:
Unknown command: rebuild_index
I know this is a trivial issue. I am unable to understand how the manage.py file can ever understand commands that were not originally a part of it.

Do you have haystack in your INSTALLED_APPS?
manage.py learns new commands by importing the settings.py file and loading modules from your INSTALLED_APPS variable.

Related

Azure Function 'unable to find module' after following installation instructions

I'm trying trying to use a node module inside my Azure Functions project. I've tried following these instructions several times but still can't use the module I'm trying to bring in.
After bringing in my package.json and running npm install, I can see the node_modules folder (actual modules are located in node_modules/.staging). Upon restarting the function and trying to run it, I get Error: Cannot find module '_____'.
I'm following the instructions correctly. Any suggestions on how to get the modules to work?
You did everything correctly, after npm install, please wait for some time. Modules being in ./staging folder means the installation is still in progress.
You will see added packages prompt in console after the installation is finished.
Update--Avoid long time waiting for module install.
As #brettsam mentioned in comment, with azure-functions-pack tool(also a module), we can place all the modules in a single file, no need to install online and wait. You can search for your function name to find your function scripts if you want to edit after publication.

No certificate is generated in .hfc-key-store

I'm using an AWS Ubuntu 16.04 LTS following Hyperledger Fabric readthedocs tutorial. I followed steps in "Writing Your First Applications". When I ran "node enrollAdmin.js", a eCert and key material is expected to be generated in a hfc-key-store directory, but nothing is generated in this folder, which means the folder is still empty after running the command. I looked into the code in this js file, in lines 54-55, only two arguments are provided, but from the API from this link:https://jimthematrix.github.io/FabricCAClient.html#enroll__anchor, the fabric_ca_client.enroll function should receive three arguments, which means the third argument 'csr' is not given in the js file. Strangely, no error information is shown after running the command, and the only information i got from the terminal is "store path: $mypath/hfc-key-store".
Any one knows what the problem occurs?
Thanks
After I switch node version from 6.12.0 to 6.9.5, this issue is resolved. Looks like the node version has to be 6.9.x

Please specify node.js interpreter correctly WebStorm error

I'm trying to simply create a React Native project via Webstorm but I get this error upon trying to do so which's resulting in myself not being able to start a project.
Whenever I do choose a Node interpreter it gives me an error that says Unspecified react-native cli package at the same spot that says Please specify node.js interpreter correctly.
I've been starting React Native projects like this since the beginning but this time I get this error out of no where, I don't know where it came from. How can I fix this?
Opens up your terminal, and use the which command to find our your NodeJS interpreter
$ which node
/Users/felixfong/.nvm/versions/node/v8.0.0/bin/node
And copy that result, and update your Node interpreter field inside yoru WebStorm
Hopes this help

Intellij Idea run configuration with ember.js on ubuntu

I am having a problem with the run configuration of ember on intellij idea on ubuntu 14.
I have installed ember using npm and I have followed a tutorial on my teacher's site on how to correctly configure intellij to use both maven and ember. I had no problem configuring the first part (maven), however at the second part, which was basically the same, I couldn't find the file he was refering to. Here is the picture:
tutorial
And here is the error:
[error]
Error: No ember-cli-build.js found. Please see the transition guide: https://github.com/ember-cli/ember-cli/blob/master/TRANSITION.md#user-content-brocfile-transition.
at CoreObject.module.exports.Task.extend.setupBroccoliBuilder (/home/user/.nvm/versions/node/v5.0.0/lib/node_modules/ember-cli/lib/models/builder.js:56:13)
at CoreObject.module.exports.Task.extend.init (/home/user/.nvm/versions/node/v5.0.0/lib/node_modules/ember-cli/lib/models/builder.js:89:10)
at CoreObject.superWrapper [as init] (/home/user/.nvm/versions/node/v5.0.0/lib/node_modules/ember-cli/node_modules/core-object/lib/assign-properties.js:32:18)
at CoreObject.Class (/home/user/.nvm/versions/node/v5.0.0/lib/node_modules/ember-cli/node_modules/core-object/core-object.js:32:33)
at CoreObject.module.exports.Task.extend.run (/home/user/.nvm/versions/node/v5.0.0/lib/node_modules/ember-cli/lib/tasks/build.js:15:19)
at /home/user/.nvm/versions/node/v5.0.0/lib/node_modules/ember-cli/lib/commands/build.js:32:24
at lib$rsvp$$internal$$tryCatch (/home/user/.nvm/versions/node/v5.0.0/lib/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:1036:16)
at lib$rsvp$$internal$$invokeCallback (/home/user/.nvm/versions/node/v5.0.0/lib/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:1048:17)
at /home/user/.nvm/versions/node/v5.0.0/lib/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:331:11
at lib$rsvp$asap$$flush (/home/user/.nvm/versions/node/v5.0.0/lib/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:1198:9)
Could you please help me find the file he was referring to in the tutorial (since "usr/bin" doesn't have any "ember" files)?
New error about permissions:
error
Do you have a brocfile.js in your project? If so, rename it to ember-cli-build... Apparently you installed a newer version of ember... You might want to re-run ember init
Have a look at https://github.com/ember-cli/ember-cli/blob/master/TRANSITION.md#user-content-brocfile-transition as well for more information.
Depending on how you installed ember/ember-cli it would lie under (if you don't use nvm):
~/.npm/
or
in your project structure:
<project_dir>/node_modules and <project_dir>/bower_components
Maybe you didn't initialize ember project. Run ember init in webapp directory

Heroku Library Dependencies via Buildpack, Phantomjs + Webfonts (but generalizable to buildpacks)

After forking this Heroku buildpack (for phantomjs, but I imagine this issue applies for other custom buildpacks) :
https://github.com/stomita/heroku-buildpack-phantomjs
and updating the compile script to pull from a custom phantomjs tar.bz2 file whose bin/phantomjs binary is replaced with this one:
http://arunoda.me/blog/phantomjs-webfonts-build.html
The Heroku build process works correctly, extracts the correct modified binary, but upon getting it to rasterize a web page, comes up with error message (via heroku logs, sans timestamps for succinctness):
app[web.1]: phantomjs: /usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.15' not found (required by phantomjs)
app[web.1]: phantomjs: /lib/libc.so.6: version `GLIBC_2.15' not found (required by phantomjs)
app[web.1]: phantomjs: /lib/libc.so.6: version `GLIBC_2.14' not found (required by phantomjs)
I've tried simply including these files within the tar.bz2 file in various configurations (in different /lib or /usr/lib locations) but this hasn't worked. I realize there's a possibility of having to add some additional path information to the compile script in the buildpack, but perhaps because I'm not quite an Ops person I don't quite get it. Add in the research on buildpacks and people referring to the base /app directory and the compile script having a vendor one, I'm even more confused.
I think this is possible to solve: in fact, it appears that Deepsy has solved the problem here by stating "then I copied libstdc++.so.6 from /usr/lib/x86_64-linux-gnu/libstdc++.so.6 and added it to my custom buildpack and now its working flawlessly :)"
The problem for me, like the bulk of this post is pointing to, is that I don't know what that one line entails, and would greatly appreciate any help. I've spent way too many hours on this, and am genuinely stuck.
Thanks in advance.
Update 1:
I found Deepsy's code in his github repo here and tried to do the same curl approach, also updating the LD_LIBRARY_PATH variable and chmod 777ing the folder's contents (which includes both the binaries and library files). This didn't work (the same error messages come up). Also, my binary requires libc.so.6, which his didn't, but I got that file from my OS.
Interesting too: when trying to add and mv the libc.so.6 library file into the LD_LIBRARY_PATH, my Heroku app crashes. I suspect this might be that adding that library to the LD_LIBRARY_PATH might confuse other binaries within Heroku and use my version, which for whatever reason isn't working for the Heroku instance.
Update 2:
I also tried building the phantomjs binary from scratch and was successful. Turns out I get the exact same sized binary from the second link from the top, and the same calls for the necesarry libraries (thus same errors).
Current thesis:
It might be that the phantomjs binary is seeing the correct lib files given Update 1, but the provided Heroku ones aren't up to date enough for the binary to run correctly. Or it could still be missing the library files.
Either way, I guess I'd need to somehow get phantomjs to use the library files I've provided, and I'm not sure how I'd get to do that.

Resources