using watchman only on specific project - ember.js

I am running 2 ember applications on my computer.
On one of them I want watchman to run (to solve EMFILE: too many open files, watch),
on the other project I do not want it to run - since it causes an error (TypeError: Invalid Version: 2022.06.27.00)
Is there a way to configure watchman to run/ not run on specific projects?

Related

how to run Django locally as a windows executable app

I'm considering building app with Django for only one user that would run application locally on windows. I read about containerizing Django apps, but it's new for me.
My goal is to run Django server on one click like a standard windows app and connect to it on localhost and interact with web browser. It is even possible?
It is possible, but this may not be the best solution. If you want to release a Django app that can be installed on your client computer, you usually need to ensure all the dependencies are shipped with the app.
Containerising your application means it will depends on Docker runtime (or any container system you use). You will have to setup Docker with your app, or ensure your client has Docker on his machine to run it. If the destination machine runs Windows or macOS, you will need to setup docker-desktop which may be more complicated than standard Docker runtime (linux only).
But if you decide to ship your app without containerising it, it will only depends on a Python interpreter and some dependencies (Django, dateutil, etc.). In such case, using python tools like virtualenv, you may prepare a ready-to-run application by creating the venv and installing dependencies at "build time". Then, with a proper setup (MSI for Windows or DMG for macOS), you may be able to distribute the final application so the client can install and run it without any additional step (you do all the hard job yourself).
Django app can be convert into .exe but it wont work as local server while click .exe because runserver command and some of django service wont support on this way as per my experiment.

Seach index not working when pushing new version of app

I am using django-haystack and whoosh search engine in my django app. Everything is working alright, except when I git push new version to my OpenShift server, search stops working. It simply does not return any results. If I run ./manage.py update_index it starts working.
I have whoosh_index/ in my .gitignore file. I checked by git ls-files and whoosh_index folder is not there. So my localhost files should not be overwriting any whoosh_index files.
Currently I use post_deploy script:
echo "Executing 'python ${OPENSHIFT_REPO_DIR}wsgi/app/manage.py update_index'"
python "$OPENSHIFT_REPO_DIR"wsgi/app/manage.py update_index
But is there another way so that I do not have to update_index everytime I push new version of my app? What am I missing?
From Modifying Applications
All OpenShift applications are built around a Git source control workflow - you code locally, then push your changes to the server. The
server then runs a number of hooks to build and configure your
application, and finally restarts your application. Optionally,
applications can elect to be built using Jenkins, or run using hot
deployment which speeds up the deployment of code to OpenShift.
There are 5 phases for the changes done:
Pre-Receive
Pre-Build
Build
Deploy
Post-Deploy
You can add the index update operation to the build phase by adding it to the file:
.openshift/action_hooks/build
You can disable the whole operation of modifying of open shift by require the hot deploy mode:
$ touch .openshift/markers/hot_deploy
With hot deployment the changes to application code are applied
without restarting the application cartridge, resulting in increased
deployment speed and minimized application downtime.

Django on production server (No module named urls)

I'm setting Django on production server and have this strange error(on picture below)
As you can see pythonpath seems to be ok(first row is my project folder), I definitely have module urls.py inside my project/project folder, I have init file there and my ROOT_URLCONF = 'project.urls'(I also tried without project name, but it didn't help either).
So, that is strange why it can't find it :(
I have to say that I tried to create a new project on server and then it seems to be ok, but with this project that is copied from local server it is behaving like this.
Printscreen of error:
The only problem I can think of is the process of package creation. What process have you followed to deploy your Django application?
If you have compiled the Django application on your local machine or CI server and then deployed the compiled package then you will run into Import module issues because pyc files will contain hard coded paths of your local machine or CI servers. To fix it before compiling the python files you should create the same hierarchy on your local/CI server and then compile and deploy.
Hope this helps.
[Edit]
I agree hardcoded paths in pyc files is PITA and we have been doing this in our production environment once we discovered it.
However I do not agree with you to re generate pyc files on the server because as your application will grow and you move towards a large application it will become very slow.
You don't have to keep your development environment directory to follow production directory structure. Instead you can have any directory path on development machine and create a separate bash script which will create a package for you by creating a directory structure that you follow on production. Bash script will have the logic of
Creating a directory structure similar to production
Checking out the code from source control
Compile the code using python -m compileall .
Create a tarball
You can untar this tarball on production server and your application should run fine.
For more information about package creation in python and best practices, check out this video
It doesn't look like your project is in your path, actually. The traceback is only showing Django packages.

redmine : due date remainder not migrating

I am currently developing a project management system using Bitnami Redmine. I am using Redmine 1.4.7.
I found a plugin on https://github.com/f0y/due_date_reminder/tree/redmine-1.4 which I want use on my project. I copied the plugin to C:\BitNami\redmine-1.4.7-2\apps\redmine\htdocs\vendor\plugins. I followed the instructions provided but when I try to install the plugin it does not get migrated.
I'm running this command in C:\BitNami\redmine-1.4.7-2\apps\redmine\htdocs:
bundle exec rake db:migrate_plugins rails_env=production
and receive the following error:
Expected C:/BitNami/redmine-1.4.7-2/apps/redmine/htdocs/app/models/user.rb to define User
Tasks: TOP => db:migrate_plugins => environment
See full trace by running task with --trace
I don't get what is the problem with the user.rb file. Please help.

Jetty won't work: Is there a way to purge it?

I'm a Jetty newb, but it's making life hell. First there was an Eclipse problem I described in another question. Rather than waste time on it, I decided to just run Jetty from the console. I started off importing a sample Tapestry project and was able to run it fine... the project is on the Tapestry page and is called tutorial1
I began work on my own project then and began introducing new functionality to it. At some point it stopped working. I tried backtracking my project to get it to a working state but every time I requested the home page it would just hang. At this point I still thought it was my fault, though I did think a more graceful error message would have been nice than the it attempting to load for a minute followed by a server timeout error.
I then shutdown jetty and attempted to load up the imported sample project using mvn jetty:run in my tutorial1 project directory. it doesn't work either! When I try going to localhost:8080/tutorial1 or the URL of my project the jetty console does show any output, almost as if it's not receiving the request.
I rebooted my entire machine but that doesn't help. I am not familiar with jetty architecture and am unsure if there is a way I can purge all my files from the jetty web application directory.
Any ideas?
Cliffs Notes:
Downloaded Tapestry Archetype project with maven.
Executed jetty from the command line using mvn jetty:run
Started new project
Executed jetty from the command line using mvn jetty:run
Modified new project
Error occurred, attempted fix and restarted Jetty (Ctrl + C, followed by mvn jetty:run)
Jetty restarted, but did not seem to handle requests for any pages
Tried starting jetty from Archetype project, experienced the same problem
If your project didn't deploy correctly, jetty won't serve any pages (they will either return 404 or some error in the 500s).
Look at the log folder and check if it is getting correctly deployed.