title: Django: can't inspectdb database tables to file
body: <p>I have a database with around 25 tables and I would like to automatically generate the model file for my python project. For developing the project I am using PyCharm with a MariaDB as RDMS.</p>
  
  <p>The basic settings for the database have been done. In the next step I switch to the manage.py console to run the first command:</p>
  
  <pre><code>inspectdb
  </code></pre>
  
  <p>This is working fine. Each table will be listed in the output of the console window.
  Now I want to write the output in a file. Therefore I use the following command:</p>
  
  <pre><code>inspectdb &gt; models.py
  </code></pre>
  
  <p>This ends up in an Error: </p>
  
  <pre><code>Unable to inspect table '&gt;'
  # The error was: (1146, "Table 'mydatabase.&gt;' doesn't exist")
  # Unable to inspect table 'models.py'
  # The error was: (1146, "Table 'mydatabase.models.py' doesn't exist")
  
  Process finished with exit code 0
  </code></pre>
  
  <p>The command is according to the documentation 'python manage.py inspectdb > model.py'.
  But in this case the '>' symbol will be intepreted as table, or a tablename has to be given.</p>
  
  <p>In a second case, I try to export only one table:</p>
  
  <pre><code>inspectdb users &gt; models.py
  </code></pre>
  
  <p>this ends up with the following output:</p>
  
  <pre><code>class Users(models.Model):
      name = models.CharField(max_length=400)
      username = models.CharField(max_length=150)
      email = models.CharField(max_length=100)
      password = models.CharField(max_length=100)
      .....
  
      class Meta:
          managed = False
          db_table = 'users'
  # Unable to inspect table '&gt;'
  # The error was: (1146, "Table 'mydatabase.&gt;' doesn't exist")
  # Unable to inspect table 'models.py'
  # The error was: (1146, "Table 'mydatabase.models.py' doesn't exist")
  
  Process finished with exit code 0
  </code></pre>
  
  <p>Same problem here! In this case the model users is generated, but it is not written to the models.py file.
  What do I have to do, to save the generated models into my models.py file?</p>