django deployment in a virtual machine.

42 views
Skip to first unread message

dk

unread,
Feb 24, 2015, 4:37:27 PM2/24/15
to django...@googlegroups.com
I got a virtual machine with Linux centos that we are going to use for our django webpage. 
that machine will have the html service on. so when people go to the computer typing the IP, will show them the webpage. is there any special trick to do? like make a service that lunch manage.py with the runserver command?
if any one can point me to a webpage I will appreciate.

thanks guys.

George Silva

unread,
Feb 24, 2015, 4:41:14 PM2/24/15
to django-users

not production i hope.

in prod use nginx. if not on prod use runserver 0.0.0.0:8000

--
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/e3255fbf-27c2-4ac5-bec6-939b9a8744cd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

dk

unread,
Feb 24, 2015, 4:49:16 PM2/24/15
to django...@googlegroups.com
its just a website with one link =)
basicly shows one graph. and that's it.

aRkadeFR

unread,
Feb 25, 2015, 3:24:57 AM2/25/15
to django...@googlegroups.com
Hello there,

It's always good to take a look at how prodding a django website.

As George Silva said, you need nginx/apache or other. They will serve
your media and static files. Then for the django server, you need
to run it in uWSGI or another wsgi, and link it to your nginx/apache.

http://uwsgi-docs.readthedocs.org/en/latest/tutorials/Django_and_nginx.html

Have fun :)

Fernando Ramos

unread,
Feb 25, 2015, 7:29:25 AM2/25/15
to django...@googlegroups.com
If there's more than one person using it your site will only grow. The Django web server is meant for debugging, not production.
Go the extra step and setup ngnix or another simple http server. You will thank yourself later.

dk

unread,
Feb 25, 2015, 12:19:34 PM2/25/15
to django...@googlegroups.com
thanks guys, I installed Apache and I am setting everything,  does my project really need to be in /etc/www/

or I can put anywhere in the computer? just making sure the apache.conf point to that address?

Rodrigo Zayit

unread,
Feb 25, 2015, 12:30:34 PM2/25/15
to django...@googlegroups.com
anywhere


Atenciosamente,
Rodrigo de Oliveira

Andrew Farrell

unread,
Feb 25, 2015, 12:39:01 PM2/25/15
to django...@googlegroups.com
 Linode and Digital Ocean both have good tutorials on setting up a production deployment of Django on a virtual private server.

dk

unread,
Feb 25, 2015, 1:50:38 PM2/25/15
to django...@googlegroups.com
thanks   I am watching
but i am stuck at min 20 since it say that I need to activate the website, with a2ensite
they gave me a centos7 machine that doesn't have those commands.

Blazor

unread,
Feb 25, 2015, 2:01:57 PM2/25/15
to django...@googlegroups.com
thanks   I am watching
but i am stuck at min 20 since it say that I need to activate the website, with a2ensite
they gave me a centos7 machine that doesn't have those commands.


a2ensite is basically a shortcut for creating a symbolic link between the sites-available entry you are interested into and the sites-enabled directory. You can do it manually:

# as an administrative user
cd /etc/apache2/sites-enabled
ln -s ../sites-available/<entry_you_would_have_a2ensitED>


B.

dk

unread,
Feb 25, 2015, 2:21:38 PM2/25/15
to django...@googlegroups.com
looks like centos7 doesn't have or need that,
it comes with a folder call conf.d
and if the .conf file I inside this folder,  is like if was activate it.  =)

James Schneider

unread,
Feb 25, 2015, 2:44:38 PM2/25/15
to django...@googlegroups.com

I believe a2ensite is a Debian-specific shortcut that allows you to quickly enable/disable various site configurations through the use of symlinks.

For CentOS you'll need to create a configuration file in your conf.d directory for your virtual host. I believe it will be included automatically by httpd when it is restarted, whereas Debian configures apache to pull configuration files from the sites-enabled directory which contains symlinks back to the real files in sites-available.

-James

--
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.

felix

unread,
Feb 25, 2015, 3:25:19 PM2/25/15
to django...@googlegroups.com
El 25/02/15 12:19, dk escribió:
thanks guys, I installed Apache and I am setting everything,  does my project really need to be in /etc/www/

No. It's even not recommended.

or I can put anywhere in the computer? just making sure the apache.conf point to that address?



Basic configuration

Once you’ve got mod_wsgi installed and activated, edit your Apache server’s httpd.conf file and add the following. If you are using a version of Apache older than 2.4, replace Require all granted with Allow from all and also add the line Order deny,allow above it.

WSGIScriptAlias / /path/to/mysite.com/mysite/wsgi.py
WSGIPythonPath /path/to/mysite.com

<Directory /path/to/mysite.com/mysite>
<Files wsgi.py>
Require all granted
</Files>
</Directory>

Cheers,
Felix.
Reply all
Reply to author
Forward
0 new messages