Whenever I open a project, it shows this notification:
And when I click trust project it doesn't do anything. This started happening ever since I changed the project folder location, is there any way to fix this?
The IDE is saying the project is opened in Safe mode this is a feature of PyCharm's project security. It's meant to prevent a user from inadvertently running executable code from unknown sources that might not be safe.
This started happening ever since I changed the project folder location
To remove the notification configure the new directory as a trusted location by going to Settings > Build, Execution, Deployment > Trusted locations and adding the directory to the list.
Depending if your project runs startup tasks you may have to go to Settings > Tools > Startup tasks to manually configure the tasks.
Related
Whenever I make a new project, Pycharm shows this message:
Clicking "Trust Project" does nothing
Adding the folder to trusted locations in settings does nothing.
How do i fix this? Its really annoying because it says that with every project.
Set Trusted location
You can configure what sources PyCharm should consider safe and load such projects automatically during the opening process.
You can add your home directory to the trusted locations to disable PyCharm's warnings about untrusted projects.
Configure trusted locations
In the Settings/Preferences dialog (Ctrl+Alt+S), go to Build, Execution, Deployment | Trusted Locations.
On the Trusted Locations settings page, configure the local directories where the projects you consider trusted reside. Click OK to save the changes.
The next time you open a project from one of those locations, PyCharm will automatically load the project.
I have a small Flask application that runs fine locally, however when I go to run the application on my server, it runs but I am not able to get the output to save to a public_html folder.
This is the area I believe I am having the issue, when I run the application remotely:
df.to_html('/home/mydomain/public_html/data/candles.html', index = False)
If I run the application locally, this location works fine:
df.to_html('candles.html', index = False)
I have ensured that the remote folder 'data' has full access - 0777.
What am I doing wrong?
If you don't have an exception occurring, then very likely the file was saved, but not where you think it should have. If you did not provide a full path, the destination will be relative to the application directory. The solution is to be explicit and provide a full path, unless you are using some Flask functions that already have a default setting.
You should never grant 0777 permissions on public_html, that is a potential vulnerability. For example, someone could upload a shell to that directory if they can leverage a security flaw on your website.
There is not enough context, but the user running the process (Apache, Nginx or whatever) should not have write permissions here. If you must grant write permissions, create a dedicated directory (preferably outside the webroot unless they have to be exposed to the user), then add some directives to stipulate that files present in the directory cannot be executed. So that even if a webshell is uploaded it cannot run.
I'm currently on the steep part of the learning curve with a Linux server and running into a very frustrating issue.
Initially, I was running python scripts from the root user, then I learned that this was bad and created a new user and am working on migrating everything over to this new user. For some reason, when I set up the new user in exactly the same way that I set up the root I can no longer run the active file. From the root user, I can either click 'run active file' or the small play button in the top right corner but that disappears when I log in as the new user.
I receive the error message '''only files on disk can be run in the terminal'''
Any ideas on where I'm going wrong? Like I said still learning this stuff so if any more detail is needed please let me know.
Thanks!!
Well this was dumb, the Python extension was installed when running the root but had to separately install the extension for the additional user. Fixed the issue.
I am developing desktop database application. Using rdlc report and reportviewer. Everything was fine in developing process, reportviewer was showing all data smoothly. I deploy app with Inno Setup. But when I install the app, the reportviewer is not showing data. While data is correctly inserted in the tables.
For applications that work incorrectly or fail completely, when installed by Inno Setup to Program Files folder, the first thing to test, is to try to deploy the application manually to the same folder.
If the application fails even after a manual deployment, the most usual problem is that the application requires a user to have write permissions to application folder. As on modern versions of Windows a user typically does not have write permissions to the Program Files folder, the application does not work. So the problem usually has nothing to do with Inno Setup, but it's a problem of the application itself.
To solve the problem:
The best solution is to redesign the application so that it does not require write permissions to its folder. Windows applications should not require write permissions to their folder. That's against Windows guidelines. The application should write data to a user profile folder (C:\Users\username\AppData) or to a common data folder (C:\ProgramData).
A dirty workaround is have the installer grant a user(s) write permissions to the installation folder. Do that only, if you cannot get the application fixed (e.g. it's 3rd party application).
See Inno Setup - How to set permissions of installation folder.
Even more gross workaround is to configure the application to be executed with elevated (Administrator) privileges.
See Inno Setup desktop shortcut (link) which has "Run as administrator" advanced property set
or How to set 'Run as administrator' on a file using Inno Setup.
Another solution is enabling legacy compatibility mode that makes Windows redirect all application write attempts to a virtual store. See also Application installed with Inno Setup writes files to unknown location instead of its installation folder.
There are numerous other possible reasons, why the application might be failing when installed, including:
You omitted some dependency:
DLL library
.NET assembly
.NET Framework
Java Runtime Environment
other runtime
COM/ActiveX object, etc.
The application requires some configuration:
a file
a registry key [including COM/ActiveX object registration]
an environment variable, etc.
The application is not designed to be executed from a folder that has a space in its name (Program Files).
The application gets confused by Windows File virtualization (though it's unlikely). See Application installed with Inno Setup writes files to unknown location instead of its installation folder.
I'm trying to generate PDF file from Latex template. I've done it in development environment (running python manage.py straight from eclipse)... but I can't make it work into the server, which is running using cherokee and uwsgi.
We have realized that open(filename) creates a file owning to root (also root group). This isn't taking place in development environment... but the most strange thing about this issue is that somewhere else in our code we are creating a text file (latex uses is a text file too), but it's created with the user cherokee is supposed to use, not root!
What happened? How can we fix it?
We are running this code on ubuntu linux and a virtual environment both in development and production.
We started following some instructions to do it using python's temporary file and folder creation functions, but we thought that it could be something related with them, and created them "manually" in order to try to solve this issue... but it didn't work.
As I've said in my comments this issue was related to supervisord. I've solved it assigning the right path and user into "environment" variable of supervisord's config file.