xbeewificloudkit
xbeewificloudkit copied to clipboard
heroku run python manage.py syncdb
$ heroku run python manage.py syncdb
After executing the above command I am getting the following error.Please have a look
Traceback (most recent call last):
File "/app/xbeewifiapp/settings.py", line 344, in
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "manage.py", line 18, in
As of a few months ago, Heroku switched the default Python runtime for newly created apps from Python 2.7 (which is what this application is compatible with) to Python 3.6. As such, you will need to force Heroku to use Python 2.7 with your instance. See documentation here.
You can accomplish this with the following commands (should work under Linux as well as Windows, in case you are using Windows):
$ echo python-2.7.14 > runtime.txt
$ git add runtime.txt
$ git commit -m "Add runtime.txt file to force Heroku to use Python 2.7"
$ git push heroku master
This application is not actively maintained any more, so we missed this change.
Hi, Because of Python 3.6 in Heroku I have removed wsgiref==0.1.2 and also updated static versions etc.I hope this change wont affect my deployment
Because of Python 3.6 in Heroku I have removed wsgiref==0.1.2
I would recommend you change the requirements.txt file back to the master branch version, and simply try adding the runtime.txt file first. We have not tested the application with newer versions of the Python library dependencies, and cannot be sure that everything will work if you do that.
Hi, I am getting a sample page like this https://enigmatic-gorge-49618.herokuapp.com/ I did not see any widget in my page....So xbeeWificloudkit is just a sample to create a webpage???
Something seems to have gone wrong with the application deployment. You should get a webpage that looks like https://xbeewifi.herokuapp.com
Run the following commands, then see if the app is working correctly:
$ git checkout origin/master -- requirements.txt package.json bower.json
$ git commit requirements.txt package.json bower.json -m "Revert library dependencies to upstream"
$ git push heroku master
(If the second command comes back with a message that ends with "no changes added to commit", then apparently that's not the issue.)
When I used the command git checkout origin/master -- requirements.txt package.json bower.json fatal: invalid reference: origin/master then I used git show-branch -a
- [master] master runtimefile ! [heroku/master] master runtimefile -- *+ [master] master runtimefile
Then I used git checkout heroku/master -- requirements.txt package.json bower.json After that executed second command I am getting evert library dependencies to upstream" On branch master nothing to commit, working directory clean
Can you run the following command and tell me the output?
git remote -a
The intent of that git checkout command is to revert the state of those 3 files to match the state of the current master branch of this GitHub repository. I assume you cloned this repository (using something like git clone https://github.com/digidotcom/xbeewificloudkit, in which case this repo should be one of the remotes in your local copy).
Alternately, you could try this command: git checkout cc37a84c40 -- requirements.txt package.json bower.json
If instead of cloning this repository, you downloaded the files and started from there, you can run these commands:
$ git remote add origin https://github.com/digidotcom/xbeewificloudkit
$ git fetch origin
then run the git checkout command.
out put of git remote -a heroku https://git.heroku.com/enigmatic-gorge-49618.git (fetch) heroku https://git.heroku.com/enigmatic-gorge-49618.git (push)
out put of git remote -a
Thanks. Can you run the last set of commands I added to my previous command (git remote add and git fetch), then try the checkout command with origin/master again? It should work then.
Sorry for the delay there is some internet issue from my side mean while git remote add " what I have to give here "
git remote add " what I have to give here "
Run these commands:
$ git remote add origin https://github.com/digidotcom/xbeewificloudkit
$ git fetch origin
then you should be able to run these commands:
$ git checkout origin/master -- requirements.txt package.json bower.json
$ git commit -m "Revert library dependencies to upstream" -- requirements.txt package.json bower.json
$ git push heroku master
Still I am getting the same https://enigmatic-gorge-49618.herokuapp.com/
git remote -v heroku https://git.heroku.com/enigmatic-gorge-49618.git (fetch) heroku https://git.heroku.com/enigmatic-gorge-49618.git (push) origin https://github.com/digidotcom/xbeewificloudkit (fetch) origin https://github.com/digidotcom/xbeewificloudkit (push)
It seems like you may need to purge the build cache (see https://help.heroku.com/18PI5RSY/how-do-i-clear-the-build-cache)... so run the following commands, then attach the deploy_log.txt file to a reply here:
$ heroku plugins:install heroku-repo
$ heroku repo:purge_cache -a enigmatic-gorge-49618
$ heroku repo:reset -a enigmatic-gorge-49618
$ git push heroku master > deploy_log.txt 2>&1
deploy_log.txt Thanks for your replay here I am attaching the log file.
Based on that log file, it does appear that the static asset build (done by JavaScript during the deploy) is succeeding. However, there is this message:
remote: -----> Python app detected
remote: ! The latest version of Python 2 is python-2.7.14 (you are using python-2.7.12, which is unsupported).
remote: ! We recommend upgrading by specifying the latest version (python-2.7.14).
remote: Learn More: https://devcenter.heroku.com/articles/python-runtimes
Can you look in the runtime.txt file and make sure it says python-2.7.14? Based on that error message it might say python-2.7.12. If you do need to change it, run these commands:
$ echo python-2.7.14 > runtime.txt
$ git commit -m "Change Python to 2.7.14" -- runtime.txt
$ git push heroku master
Actually, hold on. Have you run heroku run python manage.py syncdb now that you got the successful deploy using Python 2.7?
Yes I run that
heroku run python manage.py syncdb Running python manage.py syncdb on ⬢ enigmatic-gorge-49618... up, run.2723 (Free) Creating tables ... Installing custom SQL ... Installing indexes ... Installed 0 object(s) from 0 fixture(s)
I have python version 2.7.12 so I run like this echo python-2.7.12 > runtime.txt I hope I need python-2.7.14
Python app detected remote: -----> Found python-2.7.12, removing remote: -----> Installing python-2.7.14 remote: -----> Installing pip remote: -----> Installing requirements with pip Then also I am getting the same page ..
The version of Python that you have installed locally has no effect on what you should put in runtime.txt. That file controls the version of Python that Heroku uses. Based on that error message in the log, it appears that Heroku officially supports 2.7.14, so that's what you should specify.
It looks like the issue might actually be in caching the static assets:
remote: -----> Caching build
remote: Clearing previous node cache
remote: Saving 2 cacheDirectories (default):
remote: - node_modules
remote: - bower_components (nothing to cache)
The static assets get built into a directory named static, and it appears that Heroku is not caching that directory (based on my interpretation of this information). Try editing package.json as follows:
"peerDependencies": {
"karma": "~0.10"
- }
+ },
+ "cacheDirectories": ["node_modules", "static"]
}
(add the "cacheDirectories" entry). Then:
$ git commit -m "Specify cacheDirectories" -- package.json
$ git push heroku master
This should help ensure that the front-end static files get cached in Heroku.
Caching build remote: Clearing previous node cache remote: Saving 2 cacheDirectories (package.json): remote: - node_modules remote: - static (nothing to cache) remote: remote: -----> Build succeeded! remote: ! This version of npm (2.13.5) does not support package-lock.json. Please
Getting same web page like previous result
remote: -----> Caching build remote: Clearing previous node cache remote: Saving 2 cacheDirectories (package.json): remote: - node_modules remote: - static (nothing to cache) remote: remote: -----> Build succeeded! remote: ! This version of npm (2.13.5) does not support package-lock.json. Please update your npm version in package.json. remote: https://devcenter.heroku.com/articles/nodejs-support#specifying-an-npm-version remote: remote: -----> Python app detected remote: -----> Installing requirements with pip remote: remote: -----> Discovering process types remote: Procfile declares types -> web remote: remote: -----> Compressing... remote: Done: 92.8M remote: -----> Launching... remote: Released v14 remote: https://enigmatic-gorge-49618.herokuapp.com/ deployed to Heroku remote: remote: Verifying deploy... done. To https://git.heroku.com/enigmatic-gorge-49618.git fe8e666..a6dff50 master -> master Now I not that my npm version . Is this is the real problem
Now I not that my npm version . Is this is the real problem
If you mean "this is not the same version of NPM that I have installed on my PC", then no. Heroku builds and runs the application inside what is more or less a virtual machine in the cloud. What versions of Python and Node and NPM you have installed on your personal machine does not matter.
Getting same web page like previous result
Sorry, I was wrong about which directory contains the static assets. Turns out it's inside prod/static. So on the cacheDirectories line of package.json, change "static" to "prod". Then:
$ git commit -m "Cache the correct directory for front-end assets" -- package.json
$ git push heroku master
When I updated package.json and then I try to push it in to heroku sudo git push heroku master Everything up-to-date same webpage I am getting
After editing package.json, did you commit the change? (First command in my previous comment)
yes.I am following the same
Based on this:
sudo git push heroku master Everything up-to-date
It does not appear that the deployment to Heroku did anything. What if you run the git push heroku master command without sudo? (You shouldn't need to use sudo for these Git operations)
git push heroku master error: update_ref failed for ref 'refs/remotes/heroku/master': cannot lock ref 'refs/remotes/heroku/master': Unable to create '/home/arun/Downloads/xbeewificloudkit-master/.git/refs/remotes/heroku/master.lock': Permission denied Everything up-to-date But when I run sudo git push heroku master Everything up-to-date
Okay, that error is probably because you had used sudo previously.
Can you send me the output of this command?
git log --decorate -n 3