Deploy Django on Apache?

前端 未结 3 1053
醉梦人生
醉梦人生 2021-01-28 15:02

I create project using Django 1.8. now ,I want deploy it to server.when I run this command in Ubuntu every thing working find.

python manage.py runserver
         


        
3条回答
  •  情歌与酒
    2021-01-28 15:13

    finally I could successfully deploy my project.I enabled Apache this module early.

    refer this link

    --------------this is my virtual host file----------------------------------

    WSGIPythonPath /home/umayanga/Desktop/view_site/serialKey_gen_site:/home/umayanga/Desktop/view_site/serialKey_gen_site/myvenv/lib/python3.4/site$
    
    
        ServerAdmin admin@key.com
        ServerName key.com
        ServerAlias www.key.com
    
        Alias /templates/ /home/umayanga/Desktop/view_site/serialKey_gen_site/templates/
        Alias /static/ /home/umayanga/Desktop/view_site/serialKey_gen_site/static/
    
    
        
               Require all granted
        
    
        
               Require all granted
        
    
        WSGIScriptAlias / /home/umayanga/Desktop/view_site/serialKey_gen_site/mysite/wsgi.py
    
        
            Options Indexes FollowSymLinks
            AllowOverride all
            Require all granted
            
                   Require all granted
            
        
    
    
    

    -----------------wsgi.py---------------------------------------

    """
    WSGI config for mysite project.
    
    It exposes the WSGI callable as a module-level variable named ``application``.
    
    For more information on this file, see
    https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/
    """
    
    import os
    
    from django.core.wsgi import get_wsgi_application
    
    
    
    os.environ.setdefault("DJANGO_SETTINGS_MODULE", "mysite.settings")
    
    application = get_wsgi_application()
    

    I think this will be help to other Django developers.Thank you all developers those who help me.

提交回复
热议问题