Import Error Module

47 views
Skip to first unread message

Niall

unread,
Nov 11, 2014, 9:48:30 AM11/11/14
to django...@googlegroups.com
Hello, I was hoping that anyone could please advise me on a very simple issue which I am having regarding running the dev server (see attachments). I am receiving the following import error when attempting to run.

ImportError: No module named django.core.management

I m guessing it may be an __INIT__ solution required.

I realise that this question may have been asked a number of time but I have not been able to find a solution which will alolow me to run.

Appreciating any help.

Thanks

Niall

ERROR_.tiff
manage.py

Erik Cederstrand

unread,
Nov 11, 2014, 10:07:19 AM11/11/14
to Django Users
> Den 11/11/2014 kl. 15.48 skrev Niall <conwa...@gmail.com>:
>
> Hello, I was hoping that anyone could please advise me on a very simple issue which I am having regarding running the dev server (see attachments). I am receiving the following import error when attempting to run.
>
> ImportError: No module named django.core.management

Do you have django installed? Try running:

python -c "import django;"

If not, run "pip install django"

Erik

Niall

unread,
Nov 11, 2014, 7:39:52 PM11/11/14
to django...@googlegroups.com
Hi Erik, yes it is installed but it comes up with the following error when I try to run the server again.

I know that it is something simple like changing the PYTHONPATH so if you could advise on why it is happening and how I should proceed that would be great. 


Nialls-MBP-2:fest-api-master niallconway$ python manage.py

Traceback (most recent call last):

  File "manage.py", line 9, in <module>

    execute_from_command_line(sys.argv)

  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/__init__.py", line 385, in execute_from_command_line

    utility.execute()

  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/__init__.py", line 345, in execute

    settings.INSTALLED_APPS

  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/conf/__init__.py", line 46, in __getattr__

    self._setup(name)

  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/conf/__init__.py", line 42, in _setup

    self._wrapped = Settings(settings_module)

  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/conf/__init__.py", line 98, in __init__

    % (self.SETTINGS_MODULE, e)

ImportError: Could not import settings 'configs.settings' (Is it on sys.path? Is there an import error in the settings file?): No module named settings

Erik Cederstrand

unread,
Nov 12, 2014, 4:44:32 AM11/12/14
to Django Users
> Den 12/11/2014 kl. 01.39 skrev Niall <conwa...@gmail.com>:
>
> Hi Erik, yes it is installed but it comes up with the following error when I try to run the server again.
>
> I know that it is something simple like changing the PYTHONPATH so if you could advise on why it is happening and how I should proceed that would be great.

manage.py can't find your settings.py file.

Your project layout is hopefully something like:

-manage.py
-my_project
|
- settings.py


In this case, manage.py should contain the line:

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'my_project.settings')


Erik
Reply all
Reply to author
Forward
0 new messages