django-ckeditor_uploader5.0.3 don't work in my server - django

I have installed django-1.9.8 and django-ckeditor-5.0.3 recently,and I have read the document in https://github.com/django-ckeditor/django-ckeditor. In my computer,I use uwsgi and nginx to run my django-project.Fortunately,I use richtextuploaderfield and successfully upload files.But when I rsync my projects to my server,and my server also have installed django-1.9.8 and django-ckeditor-5.0.3.I run "./manage.py collectstatic".Howerver when I entered django-admin in my server,I click the "upload to server" button in ckeditor,the status bar shows "uploading",then it shows as images below.I don't know why it is.Please help me.Thank you all the same!
ckeditor-error

Standard:
Check group and allow write permission
check static path for web
check media path
Settings.py template string 'django.template.context_processors.static'

Related

wso2 Enabling Notifications for User Operations-template path error

i'm trying to enable notifactions for user operations on wso2-is 5.11 started via docker desktop on a windows11 machine.
somone can explain me what is wrong in that?
P.S. sorry for my english
The problem is in runtime'cause the logs of docker displays the following error:
ERROR {org.wso2.carbon.identity.notification.mgt.NotificationMgtConfigBuilder} - Error while reading email template from location C:\Users\rocco\Documents\WSO2\docker-wso2\conf\is-as-km\repository\template.xml java.io.FileNotFoundException: C:\Users\rocco\Documents\WSO2\docker-wso2\conf\is-as-km\repository\template.xml (No such file or directory)
msg-mgt.properties file:
module.name.1=email
email.subscription.1=userOperation
email.subscription.userOperation.template=
C:\Users\rocco\Documents\WSO2\docker-wso2\conf\is-as-
km\repository\template.xml
#email.subscription.userOperation.salutation=Admin
email.subscription.userOperation.subject=User operation
change information
email.subscription.userOperation.endpoint.1=wso2iamtest
email.subscription.userOperation.endpoint.privateMail.address
=wso2iamtest#outlook.it
#email.subscription.userOperation.endpoint.privateMail
.salutation=Admin private mail
#email.subscription.userOperation.endpoint.privateMail
.subject=
User operation change information to private mail
#
As per the error log, you have configured the wrong path for the email template location.
Even though you use a Windows machine, wso2is is running as a docker instance.
WSO2 IS docker images are based on ubutu/ alpine/ centos OS base images (see the available variants here https://hub.docker.com/r/wso2/wso2is).
So, you also should have used one of them.
When configuring the path for email.subscription.userOperation.template=, we have to give the absolute path inside the WSO2 IS server where the particular template file is located.
In order to find the exact path correctly,
Log in to the docker container giving docker exec -it <container id> bash command
Once you logged in, you can see wso2is-5.11.0 folder natigate to the correct location where your template is placed, and give pwd command. You can get the path to the file. Then append the file name and put the value for email.subscription.userOperation.template= property.
As per the example, I created a file named template.txt.
Added the following content to it.
Hi {username}
This is a test mail to your private mail. The operation occurred was: {operation}.
Moved the created template into the docker container.
Here you can see the path I have added the template file.
According to my case, the msg-mgt.properties file should have the config as follows.
email.subscription.userOperation.template=/home/wso2carbon/wso2is-5.11.0/repository/template.txt

Nginx: Client request body is buffered to a temporary file

I've deployed a ML Model on AWS. It's an image classifier. When I provide the following images to the ML Model via a form in Flask, it works in certain cases but doesn't work in other cases.
The link of the image which work is listed below: https://drive.google.com/file/d/1hbrEa2gNLdqGPJxp5jVxWcXl1wunp5Mc/view?usp=sharing
The link of the image which gives an error is listed below: https://drive.google.com/file/d/1znWTRnTMPft_r_jwpJ0JQuMnnazsUXs-/view?usp=sharing
Both of the above images look alike. The first image which is around 150kb of size works when I select the file and upload it for analysis. The image which is around 10kb however doesn't when I select and upload it for analysis from a PC. When I try to do the same with my mobile phone browser, both show an error.
The error shown in the logs is - [warn]: a client request body is buffered to a temporary file.
I figured out the answer by following this link: Increasing client_max_body_size in Nginx conf on AWS Elastic Beanstalk
The nginx configuration settings should be performed in a folder named .platform.
The folder structure is (.platform/nginx/conf.d/proxy.conf)
Inside the proxy.conf mention:
client_body_buffer_size 50M;(the size according to your requirement).
Inside the .platform folder make another file named 00_myconf.config with the following contents:
container_commands:
01_reload_nginx:
command: "service nginx reload"
AWS documentation regarding configuring nginx: https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/platforms-linux-extend.html
(Read the reverse proxy configuration)

How to create folder on Elastic Beanstalk server to install LetsEncrypt SSL certificate with AcmePHP

I have a site running on an Elastic Beanstalk single instance server and want to add automated SSL certificate generation from LetsEncrypt using the AcmePHP library.
The library tries to store the certificates in ~/.acmephp, which the server responds to with an error
Failed to create "/home/webapp/.acmephp": mkdir(): Permission denied.
The acmephp library doesn't have an option to change the path built in, and rather than fork and recompile the script, I'd like to be able to store the files in the default directory.
Does anyone know how I can give the app permission to create this directory, outside of the web root, or how I can make the server create it automatically and have it be available to the app?
It looks like since it's being ran by the webapp user, when acmePHP is trying to store the certificate under that user's home directory it fails because that directory doesn't exist (afaik the webapp user only runs httpd and it definitely doesn't have a home directory).
A very dirty workaround could be manually creating that file and folder in the . ebextensions folder in your project.The file would be .ebextensions/create_home.config and it would contain something like this:
files:
"/tmp/create-home.sh" :
mode: "000755"
content: |
#!/usr/bin/env bash
mkdir -p /home/webapp
chown webapp:webapp -R /home/webapp
commands:
01_create:
command: "/tmp/create-home.sh"
That script is ran by the root user, and afterwards it changes ownership of the /home/webapp folder to the webapp user and group respectively. Hope it helps

ImportError: No module named appengine.api -windows 10,local env, python 2.7

I want to use google appengine.api in local machine. i have installed google cloud SDK and started it ,the authentication is successful . I have executed $dev_appserver.py app.yaml at the project path which has started a google app engine server at localhost:8000 .
when i want to execute the program it gives an error message " ImportError: No module named appengine.api "
I appreciate your help .
My first thought is it is an error in the code you are deploying. Are you able to get the Hello World to work?:
https://cloud.google.com/appengine/docs/standard/python/quickstart#download_the_hello_world_app
I tried executing the project in local in pycharm, so i got the above error(google.appengine.api error). Basically it has to be executed on a server.The server can be started using your terminal.
1) Go to the project path(root folder of all files in the project where the app.yaml file is located,eg: appengine)
2) start the server using $ dev_appserver.py app.yaml. It starts server at localhost port 8000 as the default one.
3) In the server start depends on the handler and its path specified (like '/' or '/testjob') try localhost:8000/ or localhost:8000/testjob
4) All the logs written in the program will be shown in the terminal. For logs try using 'logging' module , make sure to mention the logging level else basic level logs are not shown

How do I upload a webpage to Bluemix using the cf CLI?

I'm trying to upload an index.html page to Bluemix using the cf CLI. I'm not sure if I'm approaching this with the right mentality. I'm thinking of uploading this HTML file as we usually do with normal hosting services, through FTP. With Bluemix I assume I should be using the push command in cf and treat this index.html as an app. Is this right?
If this is right, I'm not getting how to use this command. Can you give me an example of full command to push/upload this page?
The cf push command would be the one to use to 'upload' your application to the Bluemix server. However, it does more than just upload. In Bluemix there is a concept of a runtime or buildpack, the idea being this will be the runtime to run your application. So if you uploaded a Java application you would pair it with the Java Liberty Buildpack/runtime. If you uploaded a PHP application then you would pair it with the PHP buildpack.
If you pushed just a HTML file with no buildpack then you would likely get an error indicating the buildpack could not be determined. Bluemix tries to guess the type of buildpack you want based on the type of files uploaded, and then pull the buildpack from an internal cache. The cf push command allows you to explicitly state the buildpack to use -b so there is no guess work and no need to rely on only the buildpack that Bluemix currently knows about.
In your case, for a static HTML file you would need some type of http server like nginx as the 'runtime'. Notice that Bluemix currently does not have a built-in buildpack for this, so you'd have to get it from somewhere else. There are a few buildpacks available already, but the best one to use would be this one: https://github.com/cloudfoundry-community/staticfile-buildpack . To use it simply supply that url with the -b option on the cf push command from the root directory of your application i.e.
cf push yourappname -b https://github.com/cloudfoundry-community/staticfile-buildpack
Be sure you are issuing this command from your app directory.
The yourappname will be part of the URL for your website/app
For an actual example, we will upload your index.html which exist in folder C:\Users\XYZ\Documents\projects\ProjectHelloWorld and we will call this app HelloWorld. Here is what we would do:
C:\> cd C:\Users\XYZ\Documents\projects\ProjectHelloWorld
C:\Users\XYZ\Documents\projects\ProjectHelloWorld> cf push HelloWorld -b https://git
hub.com/cloudfoundry-community/staticfile-buildpack
Bluemix will then upload everything in that local directory to the server and also grab the buildpack from the URL location and stage your application code with the buildpack, Bluemix will then attempt to start the application. This is an example Bluemix output when the push command succeed:
Creating app HelloWorld in org xyz#gmail.com / space test as xyz#gmail.com...
OK
Creating route HelloWorld.mybluemix.net...
OK
Binding HelloWorld.mybluemix.net to HelloWorld...
OK
Uploading HelloWorld...
Uploading app files from: C:\Users\XYZ\Documents\projects\ProjectHelloWorld
Uploading 1M, 21 files
Done uploading
OK
Starting app HelloWorld in org xyz#gmail.com / space test as xyz#gmail.com...
-----> Downloaded app package (960K)
Cloning into '/tmp/buildpacks/staticfile-buildpack'...
grep: Staticfile: No such file or directory
-----> Using root folder
-----> Copying project files into public/
-----> Setting up nginx
grep: Staticfile: No such file or directory
-----> Uploading droplet (3.4M)
1 of 1 instances running
App started
OK
Showing health and status for app HelloWorld in org xyz#gmail.com / space
test as xyz#gmail.com...
OK
requested state: started
instances: 1/1
usage: 1G x 1 instances
urls: HelloWorld.mybluemix.net
last uploaded: Tue Nov 25 14:50:44 +0000 2014
For more details:
See the github page for the buildpack on how to structure your application (public folder etc)
See Bluemix Docs website. It has a lot of demos and examples.
See Takehiko Amano's Bluemix demo. Is a good and easy to understand demo.
you can either deploy your app directly using "cf push ..." or via creating a manifest.yml file.if you create manifest.yml file inside you app code path,only cf push is sufficient.
below is the reference link for this:
http://clouds-with-carl.blogspot.in/2014/02/deploy-minimal-nodejs-application-to.html
Hope it clears your doubt!!
Yeah as whitfiea mentioned its pretty simple. You need to use the cf push command. For example if you had a static website with an index.html file.
For example the following.
[02:30 PM] jsloyer#jeffs-mbp [friendme]>ls
index.html
To push that app to Bluemix run the following.
cf push yourappname -b https://github.com/cloudfoundry-community/staticfile-buildpack.git
https://www.ng.bluemix.net/docs/#starters/index.html
In this browse Creating Web Apps->Building a web app-> Uploading an app
It says;-
You can use a sample Java™ web application to get started. This sample application displays the list of environment variables that are available. You can download the sample Java web application from the community sample site. The sample application contains a single JSP and the WEB-INF/web.xml file.
Extract the downloaded file, and a new directory that contains the application is created. From the newly created application directory, issue the cf push command. In the following example, you can use a unique name testEnv for the application and 512M for memory allocation. The name must be unique in the whole Bluemix environment.
$ cf push testEnv -m 512m
->So as per your requirement, you can add your html file along with the JSP file before uploading the application.
Hopefully this help...