So I was trying to host a simple python script on Heroku.com, but encountered this error. After a little googling, I found this on the Heroku's website: git, Heroku: pre-receive hook declined, Make sure you are pushing a repo that contains a proper supported app ( Rails, Django etc.) and you are not just pushing some random repo to test it out.
Problem is I have no idea how these work, and few tutorials I looked up were for more detailed use of those frameworks. What I need to know is how can i use them with a simple 1 file python script. Thanks in advance.
Okay I got it. It was about some unused modules in requirements.txt, I'm an idiot for not reading the output properly 🤦♂️
Related
I'm currently trying to upload my django app to pythonanywhere and i keep running into errors with my wsgi application, it says "sys" is not defined. I have correctly followed all the steps in the manual that pythonanywhere provides, yet it is still not working. I want to know if anyone has successfully uploaded a django app with pythonanywhere and how he/she got it done; or if there are better alternatives i can explore. Thanks. I would be waiting for an answer.
Pythonanywhere advice to set up a virtual environment, in which you install all dependancies. Have you done so?
I've been trying for a couple of days to get my first Django app up on Heroku, mainly following Heroku's instructions (https://devcenter.heroku.com/articles/getting-started-with-django —
(The background: for those interested, I'm a Django newbie who's created his first app and I thought I'd put it online to show it off as part of my portfolio. Not so easy! My shared-hosting web host said: nothing doing. So I looked through various things and came on Heroku, which is a bit pricey for me to use as a web host, but at least I could practice deployment.)
But I'm having a great deal of trouble. I deinstalled my regular pythons and installed homebrew and all that, finally got Pycharm to play nicely with my Homebrew python, but can't get gunicorn to work within Pycharm, can't get foreman to work as it can't find gunicorn (although gunicorn is installed into Pycharm's virtual env), etc.
I know both that I don't have a lot of idea what I'm doing (I'm still trying to grok Django) and that it would be difficult for anyone to troubleshoot my situation. I'm curious to know if anyone can suggest a step-by-step — taking the Heroku link as a starting point up until where it says to run foreman — that I could follow to proceed. A link would be super-helpful. I'm a good programmer, but really haven't tackled all these setup intricacies before, or deal with WSGI issues or anything like that).
Thanks, I know it's a bit vague, but I'm a bit blinded by the light at the moment.
This may not be quite the answer you're looking for, but if you come over and give us a try at PythonAnyhwere.com, we specialise in Python hosting, we provide lots of instructions on how to get going with django, and are very happy to help you if you run into any problems....
I'm going to be hopefully deploying the first of many (fingers crossed!) projects through Heroku here soon. My concerns about a git and pip driven environment are that it becomes difficult to clone our internal reusable private Github repo apps through pip. For example, we have apps for blogs, comments, feedback, search, and so on that can be reused in other projects. What I have seen so far are that you can use either HTTP auth by embedding a username/password in the URL or jump through hoops generating an SSH key.
I appreciate you guys taking the time to read this. There are a million other things I'm sure you could be doing right now instead so thanks :)
I would recommend setting up a private PyPI server. I've been researching it recently, and the one that seemed best to me was devpi.
Alternatively, a paid-for service such as Gemfury may be more appropriate for you. I personally rejected it because it does not support releasing python packages the normal (sdist upload) way, but perhaps that was unfair.
How can i create a safe environment to create new and play with my web applications?
My ingredients so far: python,flask,github,heroku --- I have effectively created a app using flask and heroku (it just says hello world)
I have some knowledge of python. Have read through but hardly understand the flaskr tutorial for Flask. I do however envision that i'm going to be very frustrated if i can't have some kind of version history of my stumblings.
Without being sure i feel like the recipe might include: Github and virtualenv and some coping pasting of directories...
whats a recommended way to do this?
Just setup a GitHub repository and start hacking away with Flask.
Some pointers:
Use SQLAlchemy for database operations. It's secure and easy to use.
Either dive right into your project or make some simple test ones with Flask. It's a really beautiful framework to work with and is easy to learn, so just try to accomplish some simple tasks and get used to how it works.
I suggest you to use virtualenv and virtualenvwrapper, this way you can work on isolated pythons without filling your system's python with many eggs and switch between them easily.
I have a python/django application that im running on my dreamhost account. Excuse me for the novice question, but I'm a Java programmer by day and relatively new to python.
Ideally what I'd like to do is set something up where I can take the code I have locally, upload it to my server and then touch the restart.txt file. I realize I could probably accomplish this with a bat/ftp script, but I has hoping for something a bit more advanced/robust. I have a local mercurial repository where I'm doing version control, is it at all feasible to get mercurial running on dreamhost, and then set up so that when I push changes from my local repo to the server repo, those get deployed to the proper location?
Are there other solutions I should be looking at? I guess all I'm looking for is someone to point me in the right direction.
All the cool guys are using fabric nowadays. It's exactly what you looking for.