Re: project root or its parent in pythonpath?
Hi, how about creating a proper package and installing it as an egg? That would be a proper way I think. See this tutorial: http://peak.telecommunity.com/DevCenter/setuptools It is only a matter of creating the setup.py with the list of the stuff you need to package, then you run(from the project dir): python setup.py build python setup.py install .. or even easy_install ./ Then, if you use PyDev or any othe IDE you have to remember to refresh the list of the locations/eggs if your list is strict(you don't need to if you rely on dirs only). Hope it helps. Cheers, Waldek On Jan 5, 11:19 pm, "d.w. harks" wrote: > On Thursday, January 05, 2012 2:21:30 PM, Demetrio Girardi wrote: > > > I have two apps which are inter-dependent and import stuff from one > > another; if I decide to go for the project.app route, is there a way > > to import > > things without a reference to the project name? otherwise the imports > > would > > have to be rewritten when the apps are installed in another projcet. > > If you have two apps that import from one another, then I'd suggest > merging them into a single app -- it indicates that the features of the > two are coupled and not useful without each other anyhow. > > That said, I would vote that it's better to add to your PYTHONPATH in > the IDE settings than it is to have the apps import stuff via an 'import > project.app'. > > -- > David W. Harks -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: project root or its parent in pythonpath?
On Thursday, January 05, 2012 2:21:30 PM, Demetrio Girardi wrote: I have two apps which are inter-dependent and import stuff from one another; if I decide to go for the project.app route, is there a way to import things without a reference to the project name? otherwise the imports would have to be rewritten when the apps are installed in another projcet. If you have two apps that import from one another, then I'd suggest merging them into a single app -- it indicates that the features of the two are coupled and not useful without each other anyhow. That said, I would vote that it's better to add to your PYTHONPATH in the IDE settings than it is to have the apps import stuff via an 'import project.app'. -- David W. Harks -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
project root or its parent in pythonpath?
Upon reading the django tutorial, I was under the impression that you should have the project root folder in your pythonpath, so that each app is available for import in modules, e.g. you can do import myapp However, my IDE seems to prefer putting its root in the pythonpath, so you'd have to import project.myapp and also it seems that the documentation for WSGI deployment expect the same (with project.settings) What is recommended? I have two apps which are inter-dependent and import stuff from one another; if I decide to go for the project.app route, is there a way to import things without a reference to the project name? otherwise the imports would have to be rewritten when the apps are installed in another projcet. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.