Skip to content

Package for deploy django projects via FastCGI for django version greater then 1.9

Notifications You must be signed in to change notification settings

NetAngels/django-fastcgi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Description

Package for deploying django projects via FastCGI for django version 1.9 or higher. It's is copy version of source code for FastCGI server from Django 1.8

Django deploy method via FastCGI for shared-hosting described here

Installation

Just install with pip:

pip install django-fastcgi-server

or

pip install git+https://github.com/NetAngels/[email protected]#egg=django-fastcgi-server

Examples

Example of myproject.fcgi file

#!/usr/bin/python
# -*- coding: utf-8 -*-
import os
import sys

# Add a custom Python path.
sys.path.insert(0, "/path/to/project/myproject")

# Switch to the directory of your project. (Optional.)
os.chdir("/path/to/project/myproject")

# Set the DJANGO_SETTINGS_MODULE environment variable.
os.environ['DJANGO_SETTINGS_MODULE'] = "myproject.settings"

from django_fastcgi.servers.fastcgi import runfastcgi
from django.core.servers.basehttp import get_internal_wsgi_application

wsgi_application = get_internal_wsgi_application()
runfastcgi(wsgi_application, method="prefork", daemonize="false", minspare=1, maxspare=1, maxchildren=1)

About

Package for deploy django projects via FastCGI for django version greater then 1.9

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages