title: How do you import a custom module with Gunicorn in a Procfile when deploying to Heroku?
body: <p>Right now I am deploying a Flask application to Heroku that a custom form module. </p>
  
  <p>When I check the heroku logs it gets an import error when it tries to import the registration form.</p>
  
  <pre><code>2016-03-16T18:40:08.254753+00:00 heroku[web.1]: State changed from crashed to starting
  2016-03-16T18:40:12.022731+00:00 heroku[web.1]: Starting process with command `gunicorn app.register:app`
  2016-03-16T18:40:14.912795+00:00 app[web.1]: [2016-03-16 18:40:14 +0000] [3] [INFO] Starting gunicorn 19.4.5
  2016-03-16T18:40:14.913529+00:00 app[web.1]: [2016-03-16 18:40:14 +0000] [3] [INFO] Listening at: http://0.0.0.0:39309 (3)
  2016-03-16T18:40:14.913654+00:00 app[web.1]: [2016-03-16 18:40:14 +0000] [3] [INFO] Using worker: sync
  2016-03-16T18:40:14.917468+00:00 app[web.1]: [2016-03-16 18:40:14 +0000] [7] [INFO] Booting worker with pid: 7
  2016-03-16T18:40:14.951783+00:00 app[web.1]: [2016-03-16 18:40:14 +0000] [8] [INFO] Booting worker with pid: 8
  2016-03-16T18:40:15.665966+00:00 heroku[web.1]: State changed from starting to up
  2016-03-16T18:40:15.568052+00:00 app[web.1]: [2016-03-16 18:40:15 +0000] [8] [ERROR] Exception in worker process:
  2016-03-16T18:40:15.568074+00:00 app[web.1]: Traceback (most recent call last):
  2016-03-16T18:40:15.568076+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.5/site-packages/gunicorn/arbiter.py", line 515, in spawn_worker
  2016-03-16T18:40:15.568076+00:00 app[web.1]:     worker.init_process()
  2016-03-16T18:40:15.568077+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.5/site-packages/gunicorn/workers/base.py", line 122, in init_process
  2016-03-16T18:40:15.568078+00:00 app[web.1]:     self.load_wsgi()
  2016-03-16T18:40:15.568078+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.5/site-packages/gunicorn/workers/base.py", line 130, in load_wsgi
  2016-03-16T18:40:15.568079+00:00 app[web.1]:     self.wsgi = self.app.wsgi()
  2016-03-16T18:40:15.568080+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.5/site-packages/gunicorn/app/base.py", line 67, in wsgi
  2016-03-16T18:40:15.568081+00:00 app[web.1]:     self.callable = self.load()
  2016-03-16T18:40:15.568081+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.5/site-packages/gunicorn/app/wsgiapp.py", line 65, in load
  2016-03-16T18:40:15.568082+00:00 app[web.1]:     return self.load_wsgiapp()
  2016-03-16T18:40:15.568083+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.5/site-packages/gunicorn/app/wsgiapp.py", line 52, in load_wsgiapp
  2016-03-16T18:40:15.568083+00:00 app[web.1]:     return util.import_app(self.app_uri)
  2016-03-16T18:40:15.568084+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.5/site-packages/gunicorn/util.py", line 357, in import_app
  2016-03-16T18:40:15.568085+00:00 app[web.1]:     __import__(module)
  2016-03-16T18:40:15.568086+00:00 app[web.1]:     from registration_form import RegistrationForm
  2016-03-16T18:40:15.568086+00:00 app[web.1]:   File "/app/app/register.py", line 2, in &lt;module&gt;
  2016-03-16T18:40:15.568087+00:00 app[web.1]: ImportError: No module named 'registration_form'
  </code></pre>
  
  <p>This what the directory looks like.</p>
  
  <pre><code>app
  ├── register.py
  ├── registration_form.py
  Procfile
  requirements.txt
  runtime.txt
  virtual
  </code></pre>
  
  <p>This in my Procfile. </p>
  
  <pre><code>web: gunicorn app.register:app
  </code></pre>
  
  <p>This is my app/register.py file</p>
  
  <pre><code>from flask import Flask, render_template, request
  from registration_form import RegistrationForm
  
  app = Flask(__name__)
  
  @app.route('/register', methods=['GET', 'POST'])
  def register():
      form = RegistrationForm(request.form)
      #if request.method == 'POST' and form.validate():
      return render_template('register.html', form=form)
  
  if __name__ == '__main__':
      app.run(debug=True)
  </code></pre>
  
  <p>This is my app/registration_form.py file</p>
  
  <pre><code>from wtforms import Form, BooleanField, TextField, PasswordField, validators
  
  class RegistrationForm(Form):
      first_name = TextField('First Name', [validators.Length(min=2, max=25)])
      last_name = TextField('Last Name', [validators.Length(min=4, max=35)])
      email = TextField('Email', [validators.Email()])
      zip_code = TextField('Zip Code', [validators.Length(min=4, max=35)])
      accept_tos = BooleanField('I accept the TOS', [validators.Required()])
  </code></pre>
  
  <p>What should I add to my Procfile to import the registration form? When I run the app locally it works fine so I feel like it has something to do with how Gunicorn is configured.</p>