I just ran my website made with Django1.3 for the first time on Heroku. I had to change every mentioning of myproject into app(such as import myproject.core.views into import app.core.views in urls.py ) in order to make my website run without an importError.
I figure either:
- I change the Heroku directory (
$ heroku run pwdouputs/app)/appinto/myproject. How do I do this? - Use a general prefix. How would I would I do this the best way?
- I should push my project from a directory lower?
Update
This is the file structure of my local and heroku directory:
gist.github.com/3361637
Here is an example of the changes I had to make in urls.py:
gist.github.com/3361686
The changes for the other files were exactly the same, just changing the name of my project
Update2
To mipadi:
Next to your proposed structure I changed my .git folder from this:
.
|-- myproject_django
|-- core
# etc.
|-- manage.py
|-- .git
# etc
|-- requirements.txt
to this:
.
|-- myproject_django
|-- core
# etc.
|-- manage.py
# etc
|-- requirements.txt
|-- .git
and pushed the changes to heroku. But now the folders/files are mixed with the previous structure. I tried to delete these files using heroku run rm file_name but this doesn’t work. Any ideas?
According to Heroku’s instructions (and every Django/Heroku project I’ve set up), the Django project should be at the top level, so, in your case, this:
Then, you can just import by app name: