Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 512235
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T07:17:57+00:00 2026-05-13T07:17:57+00:00

I am new on django. I tried this but I can’t deploy. How can

  • 0

I am new on django. I tried this but I can’t deploy. How can I do

#!/usr/bin/python
import sys
import os

base = os.path.dirname(os.path.abspath(__file__)) + '/..'
sys.path.append(base)

os.environ['DJANGO_SETTINGS_MODULE'] = 'myfirstapp.settings'

import django.core.handlers.wsgi

application = django.core.handlers.wsgi.WSGIHandler() 

AddHandler fcgid-script .fcgi
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteRule ^(media/.*)$ - [L]
RewriteRule ^(adminmedia/.*)$ - [L]
RewriteCond %{REQUEST_URI} !(cgi-bin/myproject.fcgi)
RewriteRule ^(.*)$ mysite.fcgi/$1 [L]
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T07:17:57+00:00Added an answer on May 13, 2026 at 7:17 am

    Here’s the alwaysdata wiki entry for setting up Django with fastcgi. Only down-side: it’s written in French.

    Well, I don’t speak French, but what it basically says is:

    1. Create a directory named public in the folder of your django project.
    2. In that directory create the file django.fcgi with the following content:

      #!/usr/bin/python
      import os, sys
      
      _PROJECT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
      sys.path.insert(0, _PROJECT_DIR)
      sys.path.insert(0, os.path.dirname(_PROJECT_DIR))
      
      _PROJECT_NAME = _PROJECT_DIR.split('/')[-1]
      os.environ['DJANGO_SETTINGS_MODULE'] = "%s.settings" % _PROJECT_NAME
      
      from django.core.servers.fastcgi import runfastcgi
      runfastcgi(method="threaded", daemonize="false")
      
    3. Next, create a .htaccess in the public folder with the following content:

      AddHandler fcgid-script .fcgi
      RewriteEngine On
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteRule ^(.*)$ django.fcgi/$1 [QSA,L]
      
    4. If you’re planning to include the django admin interface, create this symbolic link in your public directory:

      ln -s /usr/local/alwaysdata/python/django/1.1/django/contrib/admin/media/ media
      
    5. In the end your folder tree hierarchy should somehow look like this:

      myproject/
          __init__.py
          manage.py
          public/
              django.fcgi
              .htaccess
              media/
          settings.py
          urls.py
          myapp/
              views.py
              models.py
      

    Hope this helps. I talked with the admin, and he said he will soon provide an English wiki. Let’s hope this is going to happen anytime soon.


    UPDATE: There is an English wiki article now.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I recently tried extending django's registration form with the following but i can only
Been using Django for < 1yr now, but this one is new-to-me. Hopefully someone?
I am pretty new to django but experienced in Python and java web programming
While I am studying the new django docs on class-based views, I notice this
I'm new with Django + Ajax. My Problem is I can't get the value
I'm new with Django and python. I have a problem. Is there a way,
I'm new to Django but am working on the tutorial on the Django website
I'm new to Django, so apologies in advance if this is a rookie issue.
I'm new to Django, trying to process some forms. I have this form for
I could really do with some advice here. I'm new to Django, but understand

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.