title: How can I run a Python File in a Django Environment using Crontab?
body: <p>I'm trying to make a Crontab job that will run a Python script once everyday at 4AM.</p>
  
  <p>Here is my crontab line</p>
  
  <pre><code>0 4 * * * cron_scripts/scripttorun.py
  </code></pre>
  
  <p>The file is being linked correctly, and it's attempting to execute it. However, when it tries to execute the file it gives me some errors based on my imports.
  Here is the part of my python file that causes the crash, it crashes on the first line because it's not importing the file correctly for some reason...</p>
  
  <pre><code>from history.models import Model1
  from users.models import User
  </code></pre>
  
  <p>I am trying to run the Python File with some other code from my web server, that uses Django.
  Do I have to do something extra in order to be able to import my models?</p>
  
  <p>I get the same result when I run python scripttorun.py.</p>