Sunday, September 27, 2015

Re: Django Tutorial(Database Setup Question)

Hi Tom,

Following your latest instructions , I have posted my input and output results here. Still getting an error message though it is a different one this time ( a traceback error )

CaiGengYangs-MacBook-Pro:~ CaiGengYang$ cd mysite folder

CaiGengYangs-MacBook-Pro:mysite CaiGengYang$ ls mysite

CaiGengYangs-MacBook-Pro:mysite CaiGengYang$ python migrate

Traceback (most recent call last):

  File "", line 10, in <module>


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


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


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


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

    self._wrapped = Settings(settings_module)

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

    mod = importlib.import_module(self.SETTINGS_MODULE)

  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/", line 37, in import_module


  File "/Users/CaiGengYang/mysite/mysite/", line 45



SyntaxError: invalid syntax

CaiGengYangs-MacBook-Pro:mysite CaiGengYang$ 

On Sunday, September 27, 2015 at 7:51:51 PM UTC+8, Thomas wrote:

> On Sep 27, 2015, at 04:39, Cai Gengyang <> wrote:
> Hi Tom,
> So I click on Finder ---> Go ---> Home ---> 'Weiqi' folder ---> mysite folder ---> file. (using a Mac OS X Yosemite Version 10.10.2)
> This puts me in the same directory as the file.
> Then I key in the command  : $ python migrate

The command must be typed from a terminal window, and afaik Finder has no influence on the current working directory in that window.

Use the Terminal app to open a command line window, then use "cd" or "pushd" to go to "mysite folder" within that terminal window.

If that is done correctly, then you should be able to type "ls" and see in the resulting listing. Then try typing the python command above.

btw, I would strongly recommend using virtualenv for developing on your Mac (and on any other system). There are many references to that in this mailing list; do a google search to find a procedure for doing this.


- Tom

You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To post to this group, send email to
Visit this group at
To view this discussion on the web visit
For more options, visit

No comments:

Post a Comment