Deploying a Django Application in Webfaction

This is the first time I'm trying to deploy a django project (myproject) in a Webfaction.

My design dir structure is as follows:

  • In webapps / django: myproject.wsgi, myproject
  • settings.py is in myproject / src / myproject /

In such circumstances, how do I define DJANGO_SETTINGS_MODULE in myproject.wsgi?

For the default webfaction setting, it is defined as myproject.settings . Should I define DJANGO_SETTINGS_MODULE as myproject.src.myproject.settings ?

+4
source share
2 answers

When you set up your Django project on webfaction, you get the file structure as follows:

 ~ (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 do not need to modify the wsgi file to get started - just go to the apache2 / bin directory and run it. / start, and you will be fine! If you modify the wsgi file, you will need to run. / stop, then. / start to activate the changes.

If the path you specified does not work, it might be worth trying to create a common django project and just execute the project right above 'myproject'

+2
source

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

0
source

Source: https://habr.com/ru/post/1398576/


All Articles