python - How to publish (in a server) a pydev app using eclipse? -
i'm new eclipse , in field of web applications. used eclipse wrote django application works inside development server integrated in django. now, using eclipse, want export app work apache2 server. i've installed server , configured inside eclipse (defining server runtime environments preferences , creating server).
now, steps have follow export , make app work in server?
you using django development server (the manage.py runsrever
) eclipse. eclipse or other ide has little deployment of web application.
django documentation explains how deploy application on appache , wsgi quite well.
basically need reproduce eclipse configuration in wsgi script. wsgi script python script runned apache mod_wsgi module. here example of wsgi script:
import os project_dir = os.path.dirname(__file__) # provided python-paths (places python modules) # in eclipse configuration. you'll need add path's wsgi # script too. os.path.append(project_dir) os.path.append(project_dir + '/lib') os.path.append(project_dir + '/src') # have set in eclipse too: os.environ['django_settings_module'] = 'production_setting' import django.core.handlers.wsgi application = django.core.handlers.wsgi.wsgihandler()
it idea make python_path relative wsgi script file. application more portable.
probably want disable debug mode in deployment. possible separate settings.py
file. typical production settings might this:
from settings import * debug = false template_debug = false maybe database settings... maybe secret keys... maybe api keys various services...
Comments
Post a Comment