Developing a Django app and decided to ditch the Linode for Heroku. Just too much crap to deal with. So I can run my app fine using python manage.py runserver both locally and when ssh'd into the Linode, but when pushed to the heroku git repo (goes through, runs fine), I get TemplateDoesNotExist at / home.html. On my computer the folder is located at Heroku/Django_App/OmniCloud_App/Templates/ (Django_App is the folder with settings.py, etc.).
Heroku is checking at /app/OmniCloud_App/Templates/ How can I see the file structure of Heroku and specify that in settings.py so I can run the app locally for development as well as pushed to Heroku?
Once you've pushed to heroku you may connect to an isolated instance of your heroku app through bash. You can access this with:
heroku run bash --app appname
(Keep in mind this does use hours off of your heroku credit though).
Related
Is it possible to do that connection???
I have a project which I want to run on heroku at the same time on Digitalocean.
I tried it but heroku returns an error if I remove the Procfile, which Digitalocean does not require.
DO works if I remove the Procfile but heroku errors, and vieversa.
I have created a new Heroku site and I am developing it on my Linux box, using Django. The standard "getting started" site Heroku created for me is called "gettingstarted". How can I change that / configure Heroku to forget about it?
I was reading through the Django tutorial, which explains how to create a new site (django-admin startproject my_site). I did this successfully for a demo project. Then I tried to do it under the Heroku directory, because I wanted a better name for my site than "gettingstarted". I noticed that every time I start the Heroku server under my project, it says ...using settings 'gettingstarted.settings'. I found that this is configured in manage.py and I change it.
This is the directory layout I have
/some/path/heroku_random_name/gettingstarted/settings.py
/some/path/heroku_random_name/my_site/settings.py
/some/path/heroku_random_name/my_app
This is what I have in
/some/path/heroku_random_name/manage.py
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'my_site.settings')
so I would expect that the site that matters is my_site.
I got it to the point where I can run the site successfully on my local machine, and I can tell that it using the settings from my_site. But when I deploy the project to Heroku, it does not recognize my_app until I register it in gettingstarted/settings.py. In other words, when running in Heroku, it is still using gettingstarted as the site to run.
I am new to all this, so I left gettingstarted in the project, because I am afraid to break things. But how can I configure Heroku to execute settings from my_site and not from gettingstarted?
Found it: it's configured in Procfile.
It's confusing because it's configured in one place for running locally and in a different place for running hosted at Heroku.
I want to deploy my django app on heroku , which I have built on Windows machine.
Can I deploy the same application using heroku toolbelt for windows.
Or I have to setup all the things on a unix machine.
And one more thing the application uses Python 3 and Django 1.8
Will that be any problem.
There aren't any special process listed in the docs for windows usersYou should actually deploy from a unix environment, you have to create your Procfile, requirements.txt and make some changes to your settings.py file, it's easy and straight forward.
A step by step guide can be found here https://devcenter.heroku.com/articles/getting-started-with-django
Some problems you may encouter:
Internal Server Error heroku/django
Django migrations fail in heroku
Also make sure you add your migrations and cache folders to your .gitignore file.
I've followed the instructions from Heroku's "Getting Started with Django", and successfully deployed my application on the Heroku server.
However, there wasn't any tutorial on how to test my application locally before committing and pushing any change on my codes. For example, after I make some minor changes on my css file or Django views, I want to test it on my local computer first, instead of having to do "git push heroku master" every time..
How do I do this with Heroku?
Thanks
To test your app locally you don't need to use Heroku. Simply go to the folder where your manage.py is and do:
python manage.py runserver
It will fire up a development web server with your app you can access using the following URL in your browser: http://localhost:8000.
This web server reloads automatically when you make changes to the Python code. See the Django tutorial: https://docs.djangoproject.com/en/1.7/intro/tutorial01/#the-development-server
Additionally, you might need to set some variables in your environment (export VARNAME=value) to make it work with 12-factor-style settings.
I currently have a django project deployed on Heroku, but I would like to deploy another dummy Heroku app for testing purposes. The idea is that I can make changes to the dummy Heroku account on a git branch, see how it works live, and then merge and push to my actual Heroku project. Is this possible?
I haven't tried this but I don't see why it wouldn't be possible.
Just add another remote on git to the repository to your production heroku git address.
git remote add htest your_test_app_heroku.git
git remote add heroku your_actual_app_heroku.git