Hi Kyle,

If I understand correctly, Stephen referred to the repo for his deployment
at mezzanine.herokuapp.com. This directory contained the files ./Procfileand
./requirements.txt as well as the mezzroku directory as created by the
mezzanine-project command. This was not a directory in the master branch at
https://github.com/stephenmcd/mezzanine/tree/master/mezzanine/project_template.
hth.

ken


On Tue, Mar 25, 2014 at 11:49 AM, Kyle Pennell <[email protected]> wrote:

> Hey Stephen,
> Did you since delete that repo?
>
>
> On Friday, July 20, 2012 7:18:21 AM UTC-5, Stephen McDonald wrote:
>
>> As discussed on IRC, here are the bits I used to get Mezzanine and
>> Cartridge up on Heroku (http://mezzanine.herokuapp.com) back in March
>> this year. My repo has a directory called "mezzroku" which is the project
>> itself.
>>
>> Procfile:
>>
>> web: python mezzroku/manage.py createdb --noinput; python
>> mezzroku/manage.py migrate; python mezzroku/manage.py run_gunicorn -b
>> "0.0.0.0:$PORT" -w 3
>>
>> requirements.txt:
>>
>> Cartridge==0.4.9
>> Django==1.3.1
>> distribute==0.6.19
>> psycopg2==2.4.4
>> wsgiref==0.1.2
>> gunicorn==0.13.4
>>  South==0.7.3
>> django-storages==1.1.4
>> boto==2.2.2
>>
>>
>> On Fri, Jul 20, 2012 at 4:52 AM, knite <[email protected]> wrote:
>>
>>> I recently deployed a Mezzanine project to Heroku. The process differs a
>>> bit from standard Django, and took some tinkering, so I thought I would
>>> document the necessary changes here.
>>>
>>> All of these changes stem from the fact that a typical Django project
>>> has a myproj/myproj/ folder structure (manage.py at the top level, the rest
>>> in the sub-folder), whereas Mezzanine eliminates the myproj/ sub-directory.
>>>
>>> 1) In settings.py, replace
>>>
>>> ROOT_URLCONF = "%s.urls" % PROJECT_DIRNAME
>>>
>>> with
>>>
>>> ROOT_URLCONF = "urls"
>>>
>>> (I found no instances of ROOT_URLCONF in Mezzanine's codebase, so I
>>> believe this change will not break anything.)
>>>
>>> 2) Create wsgi.py at the top level of your project. This file is created
>>> when using django-admin.py to start a project, but not when using
>>> mezzanine-project. The default contents should be tweaked slightly if you
>>> do not use the DJANGO_SETTINGS_MODULE environment variable:
>>>
>>> import os
>>>
>>> os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")
>>>
>>> from django.core.wsgi import get_wsgi_application
>>>  application = get_wsgi_application()
>>>
>>> 3) Modify the Procfile example given in Heroku's docs (
>>> https://devcenter.heroku.com/articles/django):
>>>
>>> web: gunicorn wsgi -b 0.0.0.0:$PORT
>>>
>>> (Note: for production, gevent should be used. I haven't gotten there
>>> yet, but it should be as simple as appending '-w <number of workers> -k
>>> gevent'.)
>>>
>>> You'll also need to serve your static files.There are a few ways to do
>>> this, the main choice being whether to wrap your web worker with a call to
>>> collectstatic, or use Amazon S3.
>>>
>>> ...and that's where I'm stuck! After the above, I get the following
>>> error when I deploy:
>>>
>>> 2012-07-19T18:41:39+00:00 app[web.1]: 2012-07-19 20:41:39 [5] [ERROR]
>>> Error handling request
>>> 2012-07-19T18:41:39+00:00 app[web.1]: Traceback (most recent call last):
>>> 2012-07-19T18:41:39+00:00 app[web.1]:   File "/app/.heroku/venv/lib/
>>> python2.7/site-packages/django/core/handlers/wsgi.py", line 219, in
>>> __call__
>>> 2012-07-19T18:41:39+00:00 app[web.1]:   File "/app/.heroku/venv/lib/
>>> python2.7/site-packages/gunicorn/workers/sync.py", line 99, in
>>> handle_request
>>> 2012-07-19T18:41:39+00:00 app[web.1]:     respiter = self.wsgi(environ,
>>> resp.start_response)
>>> 2012-07-19T18:41:39+00:00 app[web.1]:     self.load_middleware()
>>> 2012-07-19T18:41:39+00:00 app[web.1]:   File "/app/.heroku/venv/lib/
>>> python2.7/site-packages/django/core/handlers/base.py", line 47, in
>>> load_middleware
>>> 2012-07-19T18:41:39+00:00 app[web.1]:     raise 
>>> exceptions.ImproperlyConfigured('Error
>>> importing middleware %s: "%s"' % (mw_module, e))
>>> 2012-07-19T18:41:39+00:00 app[web.1]: ImproperlyConfigured: Error
>>> importing middleware mezzanine.core.middleware: "cannot import name utils"
>>>
>>> Does anyone know what might be happening in mezzanine.core.middleware?
>>> It doesn't directly import a module named utils, but does have:
>>>
>>> from django.utils.cache import get_max_age
>>> from mezzanine.utils.cache import (cache_key_prefix, nevercache_token,
>>>                                    cache_get, cache_set, cache_installed)
>>> from mezzanine.utils.device import templates_for_device
>>> from mezzanine.utils.sites import templates_for_host
>>>
>>> --Aris
>>>
>>
>>
>>
>> --
>> Stephen McDonald
>> http://jupo.org
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "Mezzanine Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to