4

This is the first time I am trying to deploy my django project (myproject) on Webfaction.

My project dir-structure is as follows:

  1. In webapps/django: myproject.wsgi, myproject
  2. settings.py is at myproject/src/myproject/

Under such circumstances, how should I define DJANGO_SETTINGS_MODULE in myproject.wsgi?

For the default installation by webfaction, it is defined as myproject.settings. Should I be defining DJANGO_SETTINGS_MODULE as myproject.src.myproject.settings?

egor83
  • 1,199
  • 1
  • 13
  • 26
vkb001
  • 75
  • 1
  • 9
  • placing wsgi file at myproject/src and defining DJANGO_SETTINGS_MODULE to 'myproject.settings' did the trick. – vkb001 Mar 02 '12 at 17:48

2 Answers2

2

When you setup a Django project on webfaction, you get a file structure like so:

~ (your home directory)
    +webapps
        +some_project_name
            +myproject
                -standard django files
                -settings.py
                -app_directory
            +apache2
                +bin
                    -start
                    -stop
                    -restart
                -other dirs
            -bin
            -lib
            -myproject.wsgi
        -some_project2
        -symlink_to_static_files

If you are building your project under "myproject", you should not have to modify the wsgi file to get started- just change to the apache2/bin directory and run ./start and you're good to go! If you change the wsgi file you'll need to run ./stop then ./start to activate the changes.

If the path you listed isn't working, it may be worth trying to create a generic django project and just puaste your project right over 'myproject'

j_syk
  • 6,511
  • 2
  • 39
  • 56
-1

It seems like your service provider has already given you some helpful instructions: http://docs.webfaction.com/software/django/getting-started.html

kdt
  • 27,905
  • 33
  • 92
  • 139