Django deployment

Visto 117 veces
Saltar al primer mensaje no leído

Hugo Kitano

no leída,
15 sept 2015, 15:40:1715/9/15
a Django users
Hi, I'm a Django newbie, and I'm trying to decide how to deploy my small Django project.

I've read into a few options, but I keep hearing that Django deployment is unnecessarily difficult.  For a website with very little traffic, and for somebody who's new to it all, what is the best way to deploy? And how should I go about deploying!

Thanks!

Shawn Milochik

no leída,
15 sept 2015, 15:46:4015/9/15
a django...@googlegroups.com
It's very simple. Just follow these instructions:


Instead of the final line (gunicorn filename:appname -b 127.0.0.1:9999), use this:

./manage.py run_gunicorn -b 127.0.0.1:9999

Michiel Overtoom

no leída,
15 sept 2015, 16:02:5915/9/15
a django...@googlegroups.com
Hi Hugo,

> I keep hearing that Django deployment is unnecessarily difficult.

Who says this? And what are the reasons they give for it?


> For a website with very little traffic, and for somebody who's new to it all, what is the best way to deploy? And how should I go about deploying!

I can tell you how I do it, which is not necessarily the simplest way nor especially suited to low traffic. But it's not that hard. On the server machine, I install nginx, gunicorn, django and supervisor. Nginx will be the frontend, gunicorn will be the webserver, django is the application server, and supervisor will be used to start/stop/restart the web application.

I basically did the same as Shawn. In my supervisord.conf I have these lines:

[program:myapp]
command=/usr/local/bin/gunicorn myapp.wsgi -b 127.0.0.1:9999
directory=/wwwapp/myapp/my
environment=PATH="%(ENV_PATH)s:/usr/local/bin"
user=root
autostart=true
autorestart=true
stdout_logfile=NONE
stderr_logfile=NONE

I also wrote a blog article about this subject: http://www.michielovertoom.com/freebsd/flask-gunicorn-nginx-supervisord/ which uses Flask as an example, but as Shawn said, it's easy to plug in your Django app instead.

Nikolas Stevenson-Molnar

no leída,
15 sept 2015, 16:27:4915/9/15
a 'Tom Evans' via Django users
I second the nginx/gunicorn/django/supervisor stack. I've used it many times; it's relatively easy to get everything installed and set up, and all the involved components are ready for prime time.

I think the "difficult to set up" sentiment is probably in comparison to something like PHP. So many servers have already have the LAMP stack, so deployment is just dropping your source in the correct directory and making sure the permissions are right. So it's not that Django is *unnecessarily* difficult, but it's certainly a bit more involved than a PHP app.
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/6DFD6635-480E-43A1-B7CC-2C5FA826185C%40xs4all.nl.
For more options, visit https://groups.google.com/d/optout.

Tim Chase

no leída,
15 sept 2015, 16:54:5415/9/15
a django...@googlegroups.com
On 2015-09-15 22:02, Michiel Overtoom wrote:
> > I keep hearing that Django deployment is unnecessarily
> > difficult.
>
> Who says this? And what are the reasons they give for it?

I wouldn't say it's *unnecessarily* difficult, but compared to "dump
a pile of PHP files on your FTP site", it's certainly *more*
difficult.

Also, there are lots of super-cheap hosting services for PHP (under
$3/mo, some are even free) whereas I haven't seen Django hosting for
under ~$5/mo. For a toy project, the difference in cost can play a
deciding factor.

-tkc




bobhaugen

no leída,
16 sept 2015, 9:20:3216/9/15
a Django users
You gotta give PHP credit here. They did deployment better than anybody.

Django as a community could stand to put more concentrated work into deployment.

Daniel Chimeno

no leída,
16 sept 2015, 9:25:5416/9/15
a Django users


El miércoles, 16 de septiembre de 2015, 15:20:32 (UTC+2), bobhaugen escribió:
You gotta give PHP credit here. They did deployment better than anybody.
+1
 
Django as a community could stand to put more concentrated work into deployment.
That was my unique constraint in the last Django survey.

Tom Evans

no leída,
16 sept 2015, 9:57:0716/9/15
a django...@googlegroups.com
On Wed, Sep 16, 2015 at 2:20 PM, bobhaugen <bob.h...@gmail.com> wrote:
> You gotta give PHP credit here. They did deployment better than anybody.
>

I'd disagree massively. Deploying code is not the same as ftping a
bunch of files in to a directory and hoping for the best. Where is the
repeatability, rollback etc?

> Django as a community could stand to put more concentrated work into
> deployment.

Django is a community, but django is also just one part of your stack.
Rightfully, things like being a webserver, rotating logs, managing
rollout/rollback and a whole heap of other things are orthogonal to
Django - is deploying a Django project really that different than
deploying another python application?

Fortunately, Django is part of a larger community - the python
community. The python community has done a lot of work in deployment
(think virtualenv, fabric, the logging API, supervisor processes...)

Even when there isn't a solution in the python community, we're also
all part of the larger open source community. We don't need to bring
CI into django, because we can easily leverage things like Jenkins,
which despite being a Java project, integrates really quite well.

Django isn't a panacea - to really downplay it, it just provides tools
to manage the ORM, processing requests and managing content - but by
combining it with the appropriate other tools and knowledge, you get
awesome deployments.

Cheers

Tom

Hugo Kitano

no leída,
17 sept 2015, 16:44:1017/9/15
a Django users
I'm having trouble deciphering what a APPMODULE is: $(MODULE_NAME):$(VARIABLE_NAME)

What does Module_Name and Variable_NAME refer to in the context of a Django project named "stats"?

Thanks

Hugo Kitano

no leída,
17 sept 2015, 16:54:5117/9/15
a Django users,Sh...@milochik.com
What is the nginx config? And where do I find it?

Mario Gudelj

no leída,
18 sept 2015, 16:07:0418/9/15
a django...@googlegroups.com

Try this guide http://michal.karzynski.pl/blog/2013/06/09/django-nginx-gunicorn-virtualenv-supervisor/

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.

monoBOT

no leída,
18 sept 2015, 17:53:0218/9/15
a django...@googlegroups.com
The guide Mario Gudelj shared is probably the best you can find on internet.


For more options, visit https://groups.google.com/d/optout.



--
monoBOT
Visite mi sitio(Visit my site): monobotsoft.es/blog/

Javier Guerra Giraldez

no leída,
18 sept 2015, 18:16:4918/9/15
a django...@googlegroups.com
On Fri, Sep 18, 2015 at 4:51 PM, monoBOT <monobo...@gmail.com> wrote:
> The guide Mario Gudelj shared is probably the best you can find on internet.


(the best if you like gunicorn....)

--
Javier
Responder a todos
Responder al autor
Reenviar
0 mensajes nuevos