Nathan Kester
Nathan Kester

Reputation: 21

Configuring passenger_wsgi.py to use Pelican

I've been trying to configure python environment to use Pelican for static blogging. This is a common setting for Django, so I'm wondering what I need to put in so it can start using Pelican.

import os, sys
sys.path.append('/path/to/your/DjangoProjects')
os.environ['DJANGO_SETTINGS_MODULE'] = 'example_com.settings'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()

Btw, my server works fine with this setting.

def application(environ, start_response):
start_response('200 OK', [('Content-type', 'text/plain')])
return ["Hello, world!"]

Upvotes: 2

Views: 295

Answers (1)

ley
ley

Reputation: 41

Pelican is a static blog generator, static means once generated, the content is stored in files and won't change. Tt's different from Django, which dynamiclly generates the content whenever a user visit your blog.

So, all you have to do is copying the files from output folder to a document root folder of a web server like apache or nginx.

Or, you can simply type python -m SimpleHTTPServer in terminal, and you can visit your blog at http://localhost:8000/. (executing make serve in you pelican blog folder will do the same.). This works well for development.

Or, you can use github to serve your blog, see: http://docs.getpelican.com/en/3.1.1/tips.html#publishing-to-github

Upvotes: 3

Related Questions