title: How do they run these commands in python console within Django project?
body: <p>How do they run these python commands in python console within their django project. Here is <a href="https://docs.djangoproject.com/en/2.2/intro/overview/#enjoy-the-free-api" rel="nofollow noreferrer">example</a>.</p>
  
  <p>I'm using Windows 10, PyCharm and python 3.7. I know how to run the project. But when I run the project, - console opens, which gives regular input/output for the project running.
  When I open python console - I can run commands, so that they execute immidiately, but how do I run python console, so that I can type some commands and they would execute immediately, but that would happen within some project?</p>
  
  <p>Example from <a href="https://docs.djangoproject.com/en/2.2/intro/overview/#enjoy-the-free-api" rel="nofollow noreferrer">here</a>:</p>
  
  <pre><code># Import the models we created from our "news" app
  &gt;&gt;&gt; from news.models import Article, Reporter
  
  # No reporters are in the system yet.
  &gt;&gt;&gt; Reporter.objects.all()
  &lt;QuerySet []&gt;
  
  # Create a new Reporter.
  &gt;&gt;&gt; r = Reporter(full_name='John Smith')
  
  # Save the object into the database. You have to call save() explicitly.
  &gt;&gt;&gt; r.save()
  
  # Now it has an ID.
  &gt;&gt;&gt; r.id
  1
  </code></pre>