Django 1.4 layout #30

Closed
dmishe opened this Issue Mar 13, 2012 · 24 comments

Projects

None yet
@dmishe
dmishe commented Mar 13, 2012

If you follow heroku guide on django, but use 1.4, it won't be started on release. In logs:

Error H14 (No web processes running)

I assume this is due to new layout, specifically settings.py and manage.py being on different levels and default web process will not be able to find manage.py

@kennethreitz
Contributor

Work in progress :)

@desimone

+1

@kennethreitz
Contributor

Fixed, waiting on deploy.

@adrianholovaty

I just tried following the tutorial at http://devcenter.heroku.com/articles/django and ran into this bug. kennethreitz, do you mind updating this ticket when it's been deployed?

@kennethreitz
Contributor

Absolutely. Will likely happen tonight or tomorrow.

@MrPiao
MrPiao commented Mar 26, 2012

Still doesn't seem to be working. Has this been deployed yet?

@adrianholovaty

At least update http://devcenter.heroku.com/articles/django to note the fact that the tutorial as written doesn't work? I wasted two hours over the weekend trying to figure out why it wasn't working.

@kennethreitz
Contributor

@adrianholovaty Sorry for the trouble. I just updated the tutorial to show django==1.3 at install time.

@dgrtwo
dgrtwo commented Mar 27, 2012

Any updates?

@airstrike

Also waiting on updates..

@kennethreitz
Contributor

Official updates to the platform are available here: https://devcenter.heroku.com/changelog

@nsb
nsb commented Mar 29, 2012

Also waiting for this to be deployed.

@kennethreitz
Contributor

There are some pretty major changes in this new buildpack, so I've been exhaustively testing to make sure there are no regressions before the deploy.

I just ran the last of my tests and everything's good :)

@erikcw
erikcw commented Mar 29, 2012

Also waiting on 1.4 support.

@erikcw
erikcw commented Mar 30, 2012

Creating a Procfile with the following contents seems to fix it for new apps:

web: python ./manage.py runserver 0.0.0.0:$PORT

@stevenp
stevenp commented Apr 2, 2012

The detector script still doesn't look for settings.py in the correct place in the new Django 1.4 project layout. The ls mask in the detection script, "/settings.py", should be "/**/settings.py", since "startproject" now puts settings.py one directory level deeper for 1.4.

@kennethreitz
Contributor

I haven't updated the documentation yet, but the intended usage is like so:

$ mkdir myrepo && cd myrepo
$ django-admin.py startproject hellodjango .
@kennethreitz
Contributor

Also:

$ django-admin.py startproject hellodjango
$ cd hellodjango
$ git init
@kennethreitz
Contributor

Here's what we're doing to find settings.py irrespective of location:

$(find . -maxdepth 2 -type f -name 'settings.py' | head -1)
@stevenp
stevenp commented Apr 2, 2012

Got it. Since I initially started using the 1.3 tutorial, but then switched to 1.4, my layout is:

Procfile
requirements.txt
mysite
-- manage.py
---mysite
------settings.py
---myapp

Because of that, the depth of my settings.py file ends up being 3 instead of 2. I assume your suggestion is a layout like this instead:

mysite
-- Procfile
-- requirements.txt
-- manage.py
---mysite
------settings.py
---myapp

I'll give this a shot. Thanks for the quick response!

@andres-torres-marroquin
Contributor

I updated the buildpack with the new project structure(django 1.4), also I made a script for detect django at the requirements.txt with recursive includes.

#35

Thanks,

@aljosa
Contributor
aljosa commented Apr 25, 2012

i don't get why people are using "python manage.py ..." to run stuff on heroku (or anything else).
i've used "heroku config" to setup DJANGO_SETTINGS_MODULE and PYTHONPATH and can normally run django-admin.py and everything else.
on the other hand, i don't get why manage.py exists so it's probably just me..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment