<div dir="ltr"><p style="margin:1em 0px;padding:0px;border:0px;font-size:11px;font-family:Menlo">I believe I am already in the same directory that contains manage.py , but I still get an error (a syntax error). Checked the lines in settings.py and can't find anything wrong with them either. Posted my entire code below :</p><p style="margin:1em 0px;padding:0px;border:0px;font-size:11px;font-family:Menlo"><br></p><p style="margin:1em 0px;padding:0px;border:0px;font-size:11px;font-family:Menlo">CaiGengYangs-MacBook-Pro:~ CaiGengYang$ cd mysite folder</p><p style="margin:1em 0px;padding:0px;border:0px;font-size:11px;font-family:Menlo">CaiGengYangs-MacBook-Pro:mysite CaiGengYang$ ls</p><p style="margin:1em 0px;padding:0px;border:0px;font-size:11px;font-family:Menlo">manage.py<span style="margin:0px;padding:0px;border:0px;white-space:pre"> </span>mysite</p><p style="margin:1em 0px;padding:0px;border:0px;font-size:11px;font-family:Menlo">CaiGengYangs-MacBook-Pro:mysite CaiGengYang$ python manage.py migrate</p><p style="margin:1em 0px;padding:0px;border:0px;font-size:11px;font-family:Menlo">Traceback (most recent call last):</p><p style="margin:1em 0px;padding:0px;border:0px;font-size:11px;font-family:Menlo">  File "manage.py", line 10, in <module></p><p style="margin:1em 0px;padding:0px;border:0px;font-size:11px;font-family:Menlo">    execute_from_command_line(sys.argv)</p><p style="margin:1em 0px;padding:0px;border:0px;font-size:11px;font-family:Menlo">  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/__init__.py", line 338, in execute_from_command_line</p><p style="margin:1em 0px;padding:0px;border:0px;font-size:11px;font-family:Menlo">    utility.execute()</p><p style="margin:1em 0px;padding:0px;border:0px;font-size:11px;font-family:Menlo">  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/__init__.py", line 303, in execute</p><p style="margin:1em 0px;padding:0px;border:0px;font-size:11px;font-family:Menlo">    settings.INSTALLED_APPS</p><p style="margin:1em 0px;padding:0px;border:0px;font-size:11px;font-family:Menlo">  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/conf/__init__.py", line 48, in __getattr__</p><p style="margin:1em 0px;padding:0px;border:0px;font-size:11px;font-family:Menlo">    self._setup(name)</p><p style="margin:1em 0px;padding:0px;border:0px;font-size:11px;font-family:Menlo">  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/conf/__init__.py", line 44, in _setup</p><p style="margin:1em 0px;padding:0px;border:0px;font-size:11px;font-family:Menlo">    self._wrapped = Settings(settings_module)</p><p style="margin:1em 0px;padding:0px;border:0px;font-size:11px;font-family:Menlo">  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/conf/__init__.py", line 92, in __init__</p><p style="margin:1em 0px;padding:0px;border:0px;font-size:11px;font-family:Menlo">    mod = importlib.import_module(self.SETTINGS_MODULE)</p><p style="margin:1em 0px;padding:0px;border:0px;font-size:11px;font-family:Menlo">  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.py", line 37, in import_module</p><p style="margin:1em 0px;padding:0px;border:0px;font-size:11px;font-family:Menlo">    __import__(name)</p><p style="margin:1em 0px;padding:0px;border:0px;font-size:11px;font-family:Menlo">  File "/Users/CaiGengYang/mysite/mysite/settings.py", line 45</p><p style="margin:1em 0px;padding:0px;border:0px;font-size:11px;font-family:Menlo">    'django.middleware.csrf.CsrfViewMiddleware',</p><p style="margin:1em 0px;padding:0px;border:0px;font-size:11px;font-family:Menlo">                                              ^</p><p style="margin:1em 0px;padding:0px;border:0px;font-size:11px;font-family:Menlo">SyntaxError: invalid syntax</p><p style="margin:1em 0px;padding:0px;border:0px;font-size:11px;font-family:Menlo">CaiGengYangs-MacBook-Pro:mysite CaiGengYang$ </p></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Sep 28, 2015 at 12:08 AM, Joel Goldstick <span dir="ltr"><<a href="mailto:joel.goldstick@gmail.com" target="_blank">joel.goldstick@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Sep 27, 2015 at 3:32 AM, Cai Gengyang <span dir="ltr"><<a href="mailto:gengyangcai@gmail.com" target="_blank">gengyangcai@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello all !<br>
<br>
So I am going through the (Database setup) chapter of this tutorial (<a href="https://docs.djangoproject.com/en/1.8/intro/tutorial01/" rel="noreferrer" target="_blank">https://docs.djangoproject.com/en/1.8/intro/tutorial01/</a>) --- Its the section right after the first chapter on "Creating a project"<br>
<br>
I opened up mysite/settings.py as per the instructions on the Django tutorial.<br>
<br>
However, when I try to run the following command : $ python manage.py migrate to create the tables in the database,<br>
<br>
CaiGengYangs-MacBook-Pro:Weiqi CaiGengYang$ python manage.py migrate ---- input<br>
<br>
I get the following error message :<br>
<br>
/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python: can't open file 'manage.py': [Errno 2] No such file or directory ---- output<br>
<br>
Any idea how to solve this issue?<br>
<br>
Thanks a lot !<br>
<span><font color="#888888"><br></font></span></blockquote><div>You need to be in the directory that contains manage.py </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span><font color="#888888">
Gengyang<span class="HOEnZb"><font color="#888888"><br>
--<br>
<a href="https://mail.python.org/mailman/listinfo/python-list" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/python-list</a><br>
</font></span></font></span></blockquote></div><span class="HOEnZb"><font color="#888888"><br><br clear="all"><div><br></div>-- <br><div><div dir="ltr"><div>Joel Goldstick<br></div><a href="http://joelgoldstick.com" target="_blank">http://joelgoldstick.com</a><br></div></div>
</font></span></div></div>
</blockquote></div><br></div>