Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Fri Nov 19, 2010 6:28 pm 
Offline
Senior Newbie

Joined: Fri Nov 19, 2010 5:14 pm
Posts: 5
WLM: redraw@renderopolis.com
Hi all,
I'm currently planning to move a company website to django.
My background is primarily in PHP+MySQL although I've also written a couple thousand lines of code in python for offline apps. I'm not new to the linux shell either, but I am new to nginx and django.

I've deployed debian 5 and followed Python using uWSGI and nginx on Debian 5 from the linode library.
nginx is up and running (uploaded some static content to test it).

Since I'm new to django, I just started the tutorial -and now I'm stuck.
In the django tutorial, one of the first steps is starting the development server. I can do that on the server, but then i can't access the app.

What do i have to do to access the django app I'm creating with nginx instead of the django development server? There's just something I'm really not getting...


Top
   
 Post subject:
PostPosted: Fri Nov 19, 2010 6:32 pm 
Offline
Junior Member

Joined: Tue Jul 13, 2010 8:28 pm
Posts: 28
The django development server is for local development. I'd suggest you do your dev work locally.

Otherwise, you have bind it to the right ip and port. By default it only listens on 127.0.0.1 and uses port 8000. One or more of these may apply: 1) can't access 127.0.0.1 from your webbrowser, 2) you're not trying to access it using port 8000, or 3) firewall is blocking that port.

Oh, and I should repeat: do your dev work locally.


Top
   
 Post subject:
PostPosted: Fri Nov 19, 2010 6:39 pm 
Offline
Senior Newbie

Joined: Fri Nov 19, 2010 5:14 pm
Posts: 5
WLM: redraw@renderopolis.com
sirpengi wrote:
The django development server is for local development. I'd suggest you do your dev work locally.


That is correct, and I will do the development of the site locally, but i really wanted to check out how to move something i created locally to the server and be able to access it. Starting the django development server was more of a desperate try than anything else.


Top
   
 Post subject:
PostPosted: Fri Nov 19, 2010 6:44 pm 
Offline
Junior Member

Joined: Tue Jul 13, 2010 8:28 pm
Posts: 28
Keep your code in a versioning system. I'd recommend hg (mercurial), but the nerdy kids use git. You can get free accounts at bitbucket.org (for hg) or github.com (for git).

Keeping code in sync with your server is now basically tracking your repository.

If you use the right command line arguments with the dev server, you *should* be able to get access to it from the outside world. But I'd seriously suggest you consider reading about Django deployment ( http://www.djangobook.com/en/1.0/chapter20/ ) when that time comes.

If you're new to django, follow that tutorial you're using, and read the djangobook. It only took me a couple days to get down and dirty with django when I first started out.


Top
   
 Post subject:
PostPosted: Fri Nov 19, 2010 6:45 pm 
Offline
Senior Newbie

Joined: Fri Nov 19, 2010 5:14 pm
Posts: 5
WLM: redraw@renderopolis.com
sirpengi wrote:
By default it only listens on 127.0.0.1 and uses port 8000. One or more of these may apply: 1) can't access 127.0.0.1 from your webbrowser, 2) you're not trying to access it using port 8000, or 3) firewall is blocking that port.


I've used
Code:
python manage.py runserver 0.0.0.0:8000
to start the dev server, and tried accessing it using port 8000, but it won't do.
The dev server is really not what i actually want to use, so i need to figure ou how to use nginx to access the app.


Top
   
 Post subject:
PostPosted: Fri Nov 19, 2010 6:51 pm 
Offline
Senior Newbie

Joined: Fri Nov 19, 2010 5:14 pm
Posts: 5
WLM: redraw@renderopolis.com
Ok, maybe i don't have to use nginx...
@sirpengi: would you recommend just using apache with mod_wsgi?


Top
   
 Post subject:
PostPosted: Fri Nov 19, 2010 8:17 pm 
Offline
Junior Member

Joined: Tue Jul 13, 2010 8:28 pm
Posts: 28
I personally run nginx+uwsgi, although now I'm thinking about gunicorn (not for performance reasons, just because of ease of deployment). You can find deployment guides for nginx+wsgi|uwsgi all over the net.

However, I'm also pretty fluent with my server distro and I can troubleshoot/fix issues/keep up to date with patches when they arise.

If you're not certain about what you're doing, or you're new to the server admin game, apache+mod_wsgi is probably your best bet because there are more resources out there. Also, the people that work on django recommend apache+mod_wsgi. It's time-tested and proven. Nginx+uwsgi is cutting edge stuff, so you might bleed a little.


Top
   
 Post subject:
PostPosted: Fri Nov 19, 2010 8:24 pm 
Offline
Senior Newbie

Joined: Fri Nov 19, 2010 5:14 pm
Posts: 5
WLM: redraw@renderopolis.com
I'll be switching over to apache + mod_wsgi. Otherwise I just have too many new variables at once.

Thanks!


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group