| Hello, I tried to setup a Python service with django - however, when I try to run: dotcloud run coreknowledgeplatform.www python current/manage.py syncdb I get the following error: Traceback (most recent call last): I don't know why python is trying to import the rsync folder? Hope someone knows how to solve this.
Thanks in advance. |
| You need to add an extra directory; i.e. your manage.py file should not be straight at the root of your app, but inside a subdirectory. You will when be doing stuff like "dotcloud run myapp.www python current/myapp/manage.py syncdb" and that will work! |
| I'm actually finding that you should not put your application in a subfolder but you should have all your dotCloud configuration files inside the root of your application. Otherwise when you run the app locally the namespace does not include the application name but when you run it on dotCloud it does. This makes it impossible to develop and then publish your code without touching it. I'm sure this is not the best way to do it but I'm totally new to Python and Django so am just getting things to work the easiest way I can figure out. When I learn a little more Python/Django I'll figure out how to do it the proper way but there seems to be a lot of debate in the Django community itself on how to do development vs. production. This from a language that claims as one of its strengths that there is only one way to do things right. I have also broken the config files up into three sections: one with global settings, one with local development settings, and one with the server settings. I set an environment variable in the postinstall shell script like this: Then in my settings file I test for it like this: This way if my app is loaded via the wsgi script, i.e. it's in dotCloud, it automatically loads the production settings but if I'm running the server on my development machine then it loads my local development settings. You could also just use a development section that overwrites the standard production settings but I like to have the settings specific to production singled out. |
Asked: Jul 08 '11
Seen: 220 times
Last updated: Jan 03 '12
Powered by Askbot version 0.7.23
Copyright DotCloud, 2011. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.