Comments (11)
I agree. I'm having the same issue at the moment. The buildout does generate a bin/gunicorn
script, as well as a wsgi wrapper. At the same time we also have the standard wsgi.py that django auto generates for a new project.
I'm tried to use all 3 of these in various combinations and configurations in order to run my app with the new gunicorn, with no success.
Documentation or guidance on this topic would be very helpful
from djangorecipe.
Apparently I haven't used the new gunicorn yet! Ok, I'll have to dive into this. Some initial thoughts:
- Django now comes with a wsgi file itself. Probably we ought to copy/use that.
- The number one thing that djangorecipy does is to set the proper
DJANGO_SETTINGS
env variable. And bin/gunicorn is generated from the gunicorn egg, not from djangorecipy. Does that mean we need to create abin/django_gunicorn
file or so? Of that it is enought to runbin/gunicorn some/wsgi/file/we/generated
? Ideas?
from djangorecipe.
- Agree that we should use django's wsgi file for the sake of consistency
- I'm a bit torn on entry point. One of my primary reasons for using buildout is the "single point of entry" for your application. So I like the idea of having a
bin/run_gunicorn
script as my single point of entry. That said, I also like my packages to be as clean and disconnected as possible, so adding a gunicorn configuration inside of djangorecipe, feels like it's adding extra bloat.
from djangorecipe.
I've managed to get the latest gunicorn working with the current recipe. It's a tiny bit of a workaround but this works for me.
Firstly note that I'm not using the wsgi or django project skeleton, generated by djangorecipe. I'm using the project skeleton from djangoproject itself. See example buildout, and pay attention to the [python] part. I've added my project directory there as part of the extra-paths, so that it's on the python path, and my the default django wsgi script can be found:
[buildout]
versions = versions
include-site-packages = false
extensions = mr.developer
unzip = true
parts =
python
django
auto-checkout = *
eggs =
pillow
django
eventlet
gunicorn
psycopg2
[versions]
pillow = 2.6.1
django = 1.7.1
gunicorn = 19.1.1
psycopg2 = 2.5.4
[sources]
[python]
recipe = zc.recipe.egg
interpreter = python
eggs = ${buildout:eggs}
# This here is what makes the gunicorn script aware of our app
extra-paths = ${buildout:directory}/<PROJECTNAME>/
[django]
recipe = djangorecipe
project = <PROJECTNAME>
settings = settings
control-script = <PROJECTNAME>
extra-paths = ${buildout:directory}/<PROJECTNAME>/
eggs = ${buildout:eggs}
The above config allows me to run gunicorn as documented: ./bin/gunicorn myapp.wsgi:application
... where, wsgi.py sits in ${buildout:directory}/myapp/myapp/wsgi.py
from djangorecipe.
First, I don't use djangorecipe's generated structure myself either :-)
Second, there's one thing weird (to my eye) in your buildout: you don't list your own project as an egg. Do you have a setup.py? If so, just add your project's name to the buildout eggs
list and you shouldn't need the extra-paths
setting as buildout does the right thing automatically.
Perhaps it works out of the box, then!
from djangorecipe.
Problem is that the my primary project in the buildout is not eggified :)
That's a conscious decision, and I dont mind little workarounds like the one above, since it keeps my environment the way I prefer it.
from djangorecipe.
Ok, so you're not blocked anymore?
It'll still need fixing, but at least it doesn't need fixing yesterday :-)
from djangorecipe.
No, I'm not blocked anymore. If I was I would not expect you to fix my problem :D
from djangorecipe.
This should be fixed with release 2.0. Read the changelogs, as I've done quite some cleanup regarding options :-)
Basic idea: add script-entrypoints = gunicorn
to your [django]
part and you'll get a bin/django_env_gunicorn
script that's the same as bin/gunicorn
but with the settings env variable set.
As you were using extra-paths for instance, can you check if 2.0 works for you? I've removed some options that seemed to be unused (=only necessary when django wasn't really a proper python package). I might have removed too much :-)
Also feedback regarding changelog/readme and the naming of the bin/django_env_gunicorn (in your case it would be bin/project_env_gunicorn) script is welcome.
from djangorecipe.
thx @reinout
Currently busy with other deadlines, but will review the new recipe and gunicorn options soon as I have the time :)
from djangorecipe.
No hurry :-)
from djangorecipe.
Related Issues (20)
- Buildout is pulling package twice HOT 2
- In the django wsgi script, setup_environ is deprecated, should be replaced by os.environ['DJANGO_SETTINGS_MODULE'] HOT 4
- Update Documentation to newest Django version HOT 1
- Project generation HOT 4
- django 1.5: DeprecationWarning: The 'execute_manager' function is deprecated HOT 7
- Add templates for 1.4 and 1.5 for the startproject stuff HOT 2
- Allow custom path to wsgi application HOT 4
- Allow parameter for custom base source directory HOT 5
- How do I run the tests? HOT 3
- django-configurations support requires custom mange.py file HOT 2
- Rename deploy_script_extra to deploy-script-extra HOT 1
- Djangorecipe always forces the download of latest packages HOT 8
- Bad assumptions with project and settings options HOT 2
- Deployment settings HOT 4
- Unable to generate project with bin/django startproject projectname HOT 2
- An internal error occurred due to a bug in either zc.buildout or in a recipe being used HOT 2
- djangorecipe cannot install django HOT 1
- uwsgi configuration hints to deploy django build with djangorecipe HOT 3
- Support for Python3 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from djangorecipe.