Guest User

Untitled

a guest
Jul 18th, 2018
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.63 KB | None | 0 0
  1. (myenv) 13:17 ~/1website_v1 (master)$ pwd
  2. /home/Goganoid/1website_v1
  3. (myenv) 13:17 ~/1website_v1 (master)$ ls
  4. README.md db.sqlite3 jinjalesson learntime manage.py media static tinymce webexample
  5. (myenv) 13:17 ~/1website_v1 (master)$
  6.  
  7. HELLO_WORLD = """<html>
  8. <head>
  9. <title>Python Anywhere hosted web application</title>
  10. </head>
  11. <body>
  12. <h1>Hello, World!</h1>
  13. <p>
  14. This is the default welcome page for a
  15. <a href="https://www.pythonanywhere.com/">PythonAnywhere</a>
  16. hosted web application.
  17. </p>
  18. <p>
  19. Find out more about how to configure your own web application
  20. by visiting the <a href="https://www.pythonanywhere.com/web_app_setup/">web app setup</a> page
  21. </p>
  22. </body>
  23. </html>"""
  24.  
  25.  
  26. def application(environ, start_response):
  27. if environ.get('PATH_INFO') == '/':
  28. status = '200 OK'
  29. content = HELLO_WORLD
  30. else:
  31. status = '404 NOT FOUND'
  32. content = 'Page not found.'
  33. response_headers = [('Content-Type', 'text/html'), ('Content-Length', str(len(content)))]
  34. start_response(status, response_headers)
  35. yield content.encode('utf8')
  36.  
  37.  
  38. # Below are templates for Django and Flask. You should update the file
  39. # appropriately for the web framework you're using, and then
  40. # click the 'Reload /yourdomain.com/' button on the 'Web' tab to make your site
  41. # live.
  42.  
  43. # +++++++++++ VIRTUALENV +++++++++++
  44. # If you want to use a virtualenv, set its path on the web app setup tab.
  45. # Then come back here and import your application object as per the
  46. # instructions below
  47.  
  48.  
  49. # +++++++++++ CUSTOM WSGI +++++++++++
  50. # If you have a WSGI file that you want to serve using PythonAnywhere, perhaps
  51. # in your home directory under version control, then use something like this:
  52. #
  53. #import sys
  54. #
  55. #path = '/home/Goganoid/path/to/my/app
  56. #if path not in sys.path:
  57. # sys.path.append(path)
  58. #
  59. #from my_wsgi_file import application # noqa
  60.  
  61.  
  62. # +++++++++++ DJANGO +++++++++++
  63. # To use your own django app use code like this:
  64. import os
  65. import sys
  66.  
  67. # assuming your django settings file is at '/home/Goganoid/mysite/mysite/settings.py'
  68. # and your manage.py is is at '/home/Goganoid/mysite/manage.py'
  69. path = '/home/Goganoid/1website_v1'
  70. if path not in sys.path:
  71. sys.path.append(path)
  72.  
  73. os.environ['DJANGO_SETTINGS_MODULE'] = 'learntime.settings'
  74.  
  75. # then:
  76. from django.core.wsgi import get_wsgi_application
  77. application = get_wsgi_application()
  78.  
  79. 2018-07-18 12:19:25,781: Error running WSGI application
  80. 2018-07-18 12:19:25,789: ModuleNotFoundError: No module named '1website_v1.settings'
  81. 2018-07-18 12:19:25,789: File "/var/www/goganoid_pythonanywhere_com_wsgi.py", line 22, in <module>
  82. 2018-07-18 12:19:25,789: application = get_wsgi_application()
Add Comment
Please, Sign In to add comment