2016-04-27 3 views
0

私は2日間プロジェクトを稼働させることに問題があります。 私のプロジェクトは「rfaapp」と呼ばれ、ページにアクセスしようとすると、このApacheエラーが発生します。Importerrorモジュールはrfaappという名前ではありません。apache2 django 1.8 wsgy.pyが私のプロジェクトを見つけることができません

これが私のapache 2 000-は、default.conf

'

<VirtualHost *:80> 
     # The ServerName directive sets the request scheme, hostname and port that 
     # the server uses to identify itself. This is used when creating 
     # redirection URLs. In the context of virtual hosts, the ServerName 
     # specifies what hostname must appear in the request's Host: header to 
     # match this virtual host. For the default virtual host (this file) this 
     # value is not decisive as it is used as a last resort host regardless. 
     # However, you must set it for any further virtual host explicitly. 
     #ServerName www.example.com 

     ServerAdmin [email protected] 
     DocumentRoot /var/www/html 

     # Available loglevels: trace8, ..., trace1, debug, info, notice, warn, 
     # error, crit, alert, emerg. 
     # It is also possible to configure the loglevel for particular 
     # modules, e.g. 
     #LogLevel info ssl:warn 

     ErrorLog ${APACHE_LOG_DIR}/error.log 
     CustomLog ${APACHE_LOG_DIR}/access.log combined 

     # For most configuration files from conf-available/, which are 
     # enabled or disabled at a global level, it is possible to 
     # include a line for only one particular virtual host. For example the 
     # following line enables the CGI configuration for this host only 
     # after it has been globally disabled with "a2disconf". 
     #Include conf-available/serve-cgi-bin.conf 
     Alias /static /home/adminrfaapp/rfaapp/static 
     <Directory /home/adminrfaapp/rfaapp/static> 
       Require all granted 
     </Directory> 

     <Directory /home/adminrfaapp/rfaapp/rfaapp> 
       <Files wsgi.py> 
         Require all granted 
       </Files> 
     </Directory> 
     #WSGIDaemonProcess rfa python-path=/home/adminrfaapp/.local/lib/python3.5 

     WSGIDaemonProcess rfaapp python-path=/home/adminrfaapp/rfaapp/rfaapp:/home/adminrfaapp/.local/lib/python3.5 
     WSGIProcessGroup rfaapp 
     WSGIScriptAlias//home/adminrfaapp/rfaapp/rfaapp/wsgi.py 

</VirtualHost> 

'

私wsgi.py

` 
import os 
import sys 

from django.core.wsgi import get_wsgi_application 
sys.path.append('home/adminrfaapp/rfaapp') 
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "rfaapp.settings") 

application = get_wsgi_application() 
` 

誰もが考えていますか?

答えて

0

いくつかのアイデア:

1 /あなたはrfaappフォルダ内の__init__.pyのファイルがあることを確認してください。

2 /あなたのwsgi.pyファイルでは、あなたのホームパスに/を前置することを忘れています。あなたのwsgi.pyファイルで

3 /、代わりにあなたのrfaappパスを追加するのには、最初の位置に入れたいことがあります。

sys.path.insert(1, '/home/adminrfaapp/rfaapp') 
+0

おかげで返信。私はこの変更を行い、これは私の問題を解決する!ありがとうございます! – ghn

関連する問題