Openshift Bcrypt error - flask

I have a python app deployed on openshift. For some weird reason, I keep getting internal server error. I checked my logs to see that it said cannot find module named flask-Bcrypt. However, when I ssh into the app and do a pip freeze, I see flask-bcrypt installed.

Related

The FastCGI process exited unexpectedly - (Django iis hosting)

I am following this tutorial to hosting my django application on windows IIS Manager.
After following all steps from the tutorial I have got the following HTTP Error 500.0 - Internal Server Error
Is there any way to solve the issue?? I didn't find any solution for this...
I am using,
Python==3.10.0
Django==3.2.8
wfastcgi==3.0.0
IIS 10.0.17763.1
I had this same issue (Error code 0x00000067) and have been beating my head against a wall for 24 hours. I am new to Windows servers, but have been deploying Django Apps on Linux servers for over a decade.
In my case, I had deviated from the Johnnyboycurtis tutorial you referenced in a few ways:
I tried to install every python package in a virtual environment
I did not install Python at C:\, but rather hidden under my user's AppData\local\Programs\Python dir (the default)
I am assuming that your app works when running the Django Development server (py manage.py runserver -> http://localhost:8000 ) your app looks as expected (when DEBUG = True in settings.py)
Fixing my code install meant taking the following steps:
Navigating to C:\Users\MyUserName\AppData\local\Programs\Python, and following Johnnyboycurtis' instructions (but on Python310 instead of Python37) I added permissions for my AppPool to run Python.
I had to install wfastcgi OUTSIDE of my virtual environment:
deactivate (if you have a python virtual environment activated)
py -m pip install wfastcgi
Note that I did NOT have to change any other settings that were assuming my virtual environment:
web.config: 'scriptProcessor' still points to a python.exe and wfastcgi.py inside my virtual environment
IIS FastCGI Settings 'Full Path' and 'Arguments' both refer to files in my virtual environment

Error with H20 - Python init(): Server Error

This is a totally newbie question to see if I am missing something key (like there is more to install?).
After installing H20 (python 2.7) on a 9 node Hadoop / Spark cluster
using pip install of the whl file (h2o-3.10.4.8-py2.py3-none-any.whl) (which says it installed correctly).....
I can import h2o successfully.
But, when I run h2o.init() then I get:
"Checking whether there is an H20 instance running at http://localhost:54321. connected."
But then an error is thrown:
H2oServerError: HTTP 500 Server Error: u'Error: 500'
Should I be able to run H20 by simply pip installing that whl or is there more? The documentation seems outdated and there are lots of different versions found online. Anyone have any experience with this?
It's most likely that you got this problem solved, but maybe someone else may benefit. Use the install in Python Tab on the following website : http://h2o-release.s3.amazonaws.com/h2o/rel-tutte/2/index.html.

Django manage.py commands with Google App Engine and Vagrant

I have a Google App Engine app and I'm running Windows with Vagrant. I have an Ubuntu installation which I access via vagrant ssh. On that machine I installed the Google App Engine SDK for Python and I can successfully deploy my app with:
appcfg.py update myapp --oauth2 --noauth_local_webserver
The --noauth_local_parameter allows me to copy the oauth URL and paste in the browser on my Windows machine, because on the Linux machine I have no GUI. Everything is working fine.
But now I want to use the Django manage.py syncdb command, to create the tables in Google Cloud SQL. The problem is, when I execute that command, the text-based w3n browser starts for the authorization, and then I get the error message that the browser does not support javascript.
I'd like to run the manage.py commands with the --noauth_local_webserver flag, but that is not supported by the manage.py commands. How can I solve this? I have already installed an Ubuntu virtual machine with GUI and given the app the permission and manage.py works fine on that machine, but when I try to execute the command on the Vagrant (non GUI) machine, it stills want to open the browser for permission.
Hm, I manually copied the oauth .dat file to the vagrant server, and manage.py syncdb is now working, but the website still can't connect in the browser; it says:
No valid OAuth 2.0 credentials. Before using the Google SQL Service backend on dev_appserver, you must first run "manage.py syncdb" and proceed through the given instructions to fetch an OAuth 2.0 token.
It seems to be the same errors as here. In my case it seemed that the necessary GOOGLE_SQL_OAUTH2_REFRESH_TOKEN environment variable was not set. I copied this refresh token from the .dat file and set it in the app.yaml:
env_variables:
GOOGLE_SQL_OAUTH2_REFRESH_TOKEN: "..."
Now everything is working fine.

Django Analytical Google Analytics Display Advertising working on development, staging but not production

Running Django 1.6 and Analytical 0.16.0
I have the following in my settings.py
GOOGLE_ANALYTICS_PROPERTY_ID = env_var('GOOGLE_ANALYTICS_PROPERTY_ID')
GOOGLE_ANALYTICS_DISPLAY_ADVERTISING = True
and the google analytics code shows up as expected when I run the site locally and on the staging server (ie. running the doubleclick dc.js analytics script), however when running on production it still shows the default Google Analytics ga.js script.
It isn't affected by DEBUG being on or off and as I can tell the settings and env are the same on production and staging servers (both runnning on Heroku). Can anyone offer an explanation of why this might be the case?
edit: SOLVED. Turns out I was still running Analytical 0.15.0 on the production server. I had wrongly assumed that heroku automatically installed the latest version if the version wasn't specified in the pip requirements.
Check that Heroku is running the same versions of each program:
heroku pip freeze
It turns out it was still running an old version of django-analytical as the version number wasn't specified in the pip requirements file. Heroku won't upgrade an existing program unless explicitly specified. Changing the requirements.txt to the following solved it.
django-analytical==0.16.0

webfaction hosted django app, shopify module will not import

I've recently created a site with a django app hosted by webfaction. In general, things are running as expected, but I am also trying to use the ShopifyAPI, and get "Import error, no module named shopify" traced to one of my views.py. Everything worked when developing on localhost.
I SSHed into the host server and tried to install the ShopifyAPI with easy_install. It seemed to have reported being successfully installed, but I'm not sure if this actually does anything real on an external server?
Does anybody have suggestions? Any limitations on ShopifyAPI that I may not have considered?
Thanks!
The easy_install command will install the module for Python2.4. You are likely using Python2.6 or Python2.7. If you are using Python2.6, enter:
easy_install-2.6 ShopifyAPI instead of easy_install ShopifyAPI.
If you are using Python2.7, enter:
easy_install-2.7 ShopifyAPI insead of easy_install ShopifyAPI.
You can read more about using easy_install on Webfaction here
After installing the API, restart your Apache instance and it should see the module as expected.