WebFaction
Community site: login faq

I have an existing django project and I am wondering if someone could point me to and up to date tutorial or help me out on how to add this project and have webfaction serve it instead of the "myproject" that is automatically made?

I am new to mod_wsgi as well as apache2

thanks

asked 28 Jan '12, 14:14

edhedges
111
accept rate: 0%


Here are the basic steps:

  1. INSTALL DJANGO
    a. In the Webfaction control panel, go "Websites/domains" and select "Application"
    b. Click the icon to add an application, and select Django - use the name "django"
    c. Go to "Websites/domains" and select "websites". Assign your application to your domain.

  2. UPLOAD YOUR EXISTING PROJECT
    Connect with FTP.
    You should see a "webapps" directory which contains a "django" directory, which contains "apache2" and "myproject". "myproject" is the name of sample django project created by WebFaction's installer. To use your own project name, do the following: a. Copy your projects files under the "django" directory, so that this directory now contains three directories: "apache", "myproject" and "my_existing_project" (for example).
    b. To tell apache to serve your application, edit the file /apache2/conf/httpd.conf and change the following line:
    WSGIScriptAlias / /home/username/webapps/django/myproject.wsgi
    to:
    WSGIScriptAlias / /home/username/webapps/django/my_existing_project.wsgi

  3. CREATE WSGI
    a. Duplicate the existing myproject.wsgi file and name it to match your step 2b.
    b. Edit your wsgi file and replace myproject with the name of your project.
    For example change:
    os.environ['DJANGO_SETTINGS_MODULE'] = 'myproject.settings'
    to:
    os.environ['DJANGO_SETTINGS_MODULE'] = 'my_existing_project.settings'

  4. CREATE DATABASE
    a. In the control panel under "Databases" and "Databases" click the add database icon.
    b. Then modify your settings.py file to match the new database settings (type, user, pass).
    c. After changing settings.py you need to do a syncdb or import your existing database:
    Connect with SSH d. Move into your django project directory:
    cd webapps/django/my_existing_project
    e. Run the following command, change X.Y to your python version:
    pythonX.Y manage.py syncdb
    Your can also import your existing database.

  5. ENABLE DJANGO ADMIN

  6. SERVING STATIC MEDIA

  7. FIRING IT UP
    Restart apache to pickup the changes.

If you have any other qestions we have documentation on Getting started with Django.

permanent link

answered 28 Jan '12, 15:07

timg ♦♦
1.3k4
accept rate: 30%

edited 28 Jan '12, 15:07

Teamo timg ?? :) Thanks to you I could be able to upload my existing django project

permanent link

answered 22 May '16, 01:53

chesternalgon
112
accept rate: 0%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×909
×55
×13
×5
×5

question asked: 28 Jan '12, 14:14

question was seen: 8,916 times

last updated: 22 May '16, 01:53

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM