Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to generate project with bin/django startproject projectname #94

Closed
kellanjacobs opened this issue Mar 1, 2016 · 2 comments
Closed

Comments

@kellanjacobs
Copy link

After running bin/buildout I try to run
bin/django startproject project name and get an error about unable to import the module projectname.developement.
I have tried different versions of commenting out parts of my buildout. I was also able to repeat the error using the buildout in the example of the readme.

Here is my error message.
K-9:propanel dnowak$ bin/django startproject propanel
Traceback (most recent call last):
File "bin/django", line 17, in
sys.exit(djangorecipe.binscripts.manage('project.development'))
File "/Users/dnowak/develop/propanel/eggs/djangorecipe-2.1.2-py2.7.egg/djangorecipe/binscripts.py", line 9, in manage
management.execute_from_command_line(sys.argv)
File "/Users/dnowak/develop/propanel/eggs/Django-1.9.2-py2.7.egg/django/core/management/init.py", line 353, in execute_from_command_line
utility.execute()
File "/Users/dnowak/develop/propanel/eggs/Django-1.9.2-py2.7.egg/django/core/management/init.py", line 302, in execute
settings.INSTALLED_APPS
File "/Users/dnowak/develop/propanel/eggs/Django-1.9.2-py2.7.egg/django/conf/init.py", line 55, in getattr
self._setup(name)
File "/Users/dnowak/develop/propanel/eggs/Django-1.9.2-py2.7.egg/django/conf/init.py", line 43, in _setup
self._wrapped = Settings(settings_module)
File "/Users/dnowak/develop/propanel/eggs/Django-1.9.2-py2.7.egg/django/conf/init.py", line 99, in init
mod = importlib.import_module(self.SETTINGS_MODULE)
File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/init.py", line 37, in import_module
import(name)
ImportError: No module named project.development

And here is my current buildout.cfg file.

[buildout]
extends =
versions.cfg

socket-timeout = 3
show-picked-versions = true
parts =
django

eggs =
django

develop = .

versions = versions

extensions =
buildout.threatlevel

eggs-directory = eggs

activate this if you want to use a cache dir, you will have to create the dir

download-cache = ${buildout:directory}/downloads

[django]
recipe = djangorecipe

settings = development

eggs = ${buildout:eggs}

project = propanel

test = propanel

interpreter = py

@reinout
Copy link
Collaborator

reinout commented Mar 2, 2016

Yes, this is a problem. The bin/django we generate assumes/requires that you already have a settings file. This is obviously not the case if you're trying to generate the project in the first place.

The good news: your setup looks fine.

The bad news: bin/django really does need a settings file in the current setup.

Can you try something? Add this to your [django] part:

dotted-settings-path = django.conf.global_settings

If my guess is right, this allows you to run bin/django to generate your project. Afterwards you'll have to remove the line again.

@rvanlaar
Copy link
Owner

I've tested it, that is the case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants