Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # This file contains the WSGI configuration required to serve up your
- # web application at http://crosstalk.pythonanywhere.com/
- # It works by setting the variable 'application' to a WSGI handler of some
- # description.
- #
- # +++++++++++ GENERAL DEBUGGING TIPS +++++++++++
- # getting imports and sys.path right can be fiddly!
- # We've tried to collect some general tips here:
- # https://www.pythonanywhere.com/wiki/DebuggingImportError
- # +++++++++++ HELLO WORLD +++++++++++
- # A little pure-wsgi hello world we've cooked up, just
- # to prove everything works. You should delete this
- # code to get your own working.
- HELLO_WORLD = """
- <!DOCTYPE html>
- <html>
- <head>
- <title>E-Chat - Online Chat Rooms For Everyone | Free Chat</title>
- <meta name="description" content="E-chat is a chat rooms website, where people talk online with each other on various topics.">
- <!-- facebook tags -->
- <meta property="og:image" content="http://www.e-chat.co/Resources/Icons/Misc/EchatFacebookShareIcon.png"/>
- <meta property="og:title" content="E-Chat - Online Chat Rooms For Everyone | Free Chat"/>
- <meta property="og:description" content="E-chat is a chat rooms website, where people talk online with each other on various topics."/>
- <meta property="og:url" content="http://www.e-chat.co"/>
- <meta property="og:type" content="website"/>
- <link rel="shortcut icon" href="http://www.e-chat.co/Resources/Icons/Misc/EchatFavicon.png"/>
- <link rel="stylesheet" href="http://www.e-chat.co/styles/website/website.index.css?v=1485338478727">
- <script src="http://www.e-chat.co/scripts/lib/jquery.1.11.1.min.js?v=1485338478727"></script>
- <script src="http://www.e-chat.co/scripts/shared/google.analytics.js?v=1485338478727"></script>
- <script src="http://www.e-chat.co/scripts/shared/global.utils.js?v=1485338478727"></script>
- <script src="http://www.e-chat.co/scripts/shared/authentication/authentication.controller.js?v=1485338478727"></script>
- <script src="http://www.e-chat.co/scripts/shared/authentication/authentication.interface.js?v=1485338478727"></script>
- <script>
- $(document).ready(function()
- {
- com.echat.shared.authentication.Interface.initializeInterfaceCallbacks();
- com.echat.shared.authentication.Interface.initializeStartupRoutine();
- });
- </script>
- </head>
- <body>
- <div id="MainWrapper">
- <div id="MainWrapperRelative">
- <img id="EchatMainLogo" src="http://www.e-chat.co/Resources/Icons/Misc/EchatLogo.png" alt="Chat rooms logo - E-Chat"/>
- <div id="LeftSection">
- <h1 id="BenefitsTitle">E-Chat</h1>
- <h2 id="BenefitsTitleSecondary">Chat with anyone you want, about anything you want, free.</h2>
- <div class="BenefitWrapper">
- <img class="BenefitImage" src="http://www.e-chat.co/Resources/Icons/Misc/registerIconYesTick.png" alt="Chat Benefit Icon"/>
- <span class="BenefitText">
- Meet new people who share the same interests as you do.
- </span>
- </div>
- <div class="BenefitWrapper">
- <img class="BenefitImage" src="http://www.e-chat.co/Resources/Icons/Misc/registerIconYesTick.png" alt="Chat Benefit Icon"/>
- <span class="BenefitText">
- Make your own chat room with full control over it.
- </span>
- </div>
- <div class="BenefitWrapper">
- <img class="BenefitImage" src="http://www.e-chat.co/Resources/Icons/Misc/registerIconYesTick.png" alt="Chat Benefit Icon"/>
- <span class="BenefitText">
- Add a chat box to another website (<a href="http://www.e-chat.co/widget/example">www.e-chat.co/widget/example</a>).
- </span>
- </div>
- <div class="BenefitWrapper">
- <img class="BenefitImage" src="http://www.e-chat.co/Resources/Icons/Misc/registerIconYesTick.png" alt="Chat Benefit Icon"/>
- <span class="BenefitText">
- All chat rooms run very fast, and require no plug-ins (no flash, no java).
- </span>
- </div>
- <div class="BenefitWrapper">
- <img class="BenefitImage" src="http://www.e-chat.co/Resources/Icons/Misc/registerIconYesTick.png" alt="Chat Benefit Icon"/>
- <span class="BenefitText">
- It was, is, and always will be free. Thanks!
- </span>
- </div>
- </div>
- <div id="RightSection">
- <div class="FormLabelWrap" style="margin:2px 0px 20px 0px; height:27px;">
- <span id="GuestAuthenticationFormTitle" class="AuthenticationFormTitle">
- Guest
- </span>
- <span id="LoginAuthenticationFormTitle" class="AuthenticationFormTitle">
- Log in
- </span>
- <span id="RegistrationAuthenticationFormTitle" class="AuthenticationFormTitle">
- Sign up
- </span>
- <span id="SwitchToRegistrationLabel" class="SwitchFormsLabel">Sign up</span>
- <span id="SwitchToLoginLabel" class="SwitchFormsLabel">Log in</span>
- <span id="SwitchToGuestLabel" class="SwitchFormsLabel">Guest</span>
- </div>
- <div class="FormLabelWrap">
- <span class="FormLabelPrimary">Username:</span>
- <input type="text" id="UsernameInput" class="FormInput"/>
- </div>
- <div id="FormWrapPassword" class="FormLabelWrap">
- <span class="FormLabelPrimary">Password:</span>
- <input type="password" id="PasswordInput" class="FormInput"/>
- </div>
- <div id="FormWrapPassword2" class="FormLabelWrap">
- <span class="FormLabelPrimary">Password: (enter again)</span>
- <input type="password" id="PasswordInput2" class="FormInput"/>
- </div>
- <div id="FormWrapRememberDetails" class="FormLabelWrap">
- <input id="RememberDetailsBox" type="checkbox">
- <span id="RememberDetailsLabel">Remember login details</span>
- </div>
- <div style="clear:both;"></div>
- <button id="GuestFormSubmit" class="FormSubmit">Chat as guest</button>
- <button id="LoginFormSubmit" class="FormSubmit">Log in</button>
- <button id="RegistrationFormSubmit" class="FormSubmit">Sign up</button>
- <div id="FormSubmitHintArea"></div>
- </div>
- </div>
- </div>
- </body>
- </html>
- """
- def application(environ, start_response):
- if environ.get('PATH_INFO') == '/':
- status = '200 OK'
- content = HELLO_WORLD
- else:
- status = '404 NOT FOUND'
- content = 'Page not found.'
- response_headers = [('Content-Type', 'text/html'), ('Content-Length', str(len(content)))]
- start_response(status, response_headers)
- yield content.encode('utf8')
- # Below are templates for Django and Flask. You should update the file
- # appropriately for the web framework you're using, and then
- # click the 'Reload /yourdomain.com/' button on the 'Web' tab to make your site
- # live.
- # +++++++++++ VIRTUALENV +++++++++++
- # If you want to use a virtualenv, set its path on the web app setup tab.
- # Then come back here and import your application object as per the
- # instructions below
- # +++++++++++ CUSTOM WSGI +++++++++++
- # If you have a WSGI file that you want to serve using PythonAnywhere, perhaps
- # in your home directory under version control, then use something like this:
- #
- #import sys
- #
- #path = '/home/crosstalk/path/to/my/app
- #if path not in sys.path:
- # sys.path.append(path)
- #
- #from my_wsgi_file import application
- # +++++++++++ DJANGO +++++++++++
- # To use your own django app use code like this:
- #import os
- #import sys
- #
- ## assuming your django settings file is at '/home/crosstalk/mysite/mysite/settings.py'
- ## and your manage.py is is at '/home/crosstalk/mysite/manage.py'
- #path = '/home/crosstalk/mysite'
- #if path not in sys.path:
- # sys.path.append(path)
- #
- #os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings'
- #
- ## then, for django >=1.5:
- #from django.core.wsgi import get_wsgi_application
- #application = get_wsgi_application()
- ## or, for older django <=1.4
- #import django.core.handlers.wsgi
- #application = django.core.handlers.wsgi.WSGIHandler()
- # +++++++++++ FLASK +++++++++++
- # Flask works like any other WSGI-compatible framework, we just need
- # to import the application. Often Flask apps are called "app" so we
- # may need to rename it during the import:
- #
- #
- #import sys
- #
- ## The "/home/crosstalk" below specifies your home
- ## directory -- the rest should be the directory you uploaded your Flask
- ## code to underneath the home directory. So if you just ran
- ## "git clone git@github.com/myusername/myproject.git"
- ## ...or uploaded files to the directory "myproject", then you should
- ## specify "/home/crosstalk/myproject"
- #path = '/home/crosstalk/path/to/flask_app_directory'
- #if path not in sys.path:
- # sys.path.append(path)
- #
- ## After you uncomment the line below, the yellow triangle on the left
- ## side in our in-browser editor shows a warning saying:
- ## 'application' imported but unused.
- ## You can ignore this error. The line is necessary, and the variable
- ## is used externally.
- #from main_flask_app_file import app as application
- #
- # NB -- many Flask guides suggest you use a file called run.py; that's
- # not necessary on PythonAnywhere. And you should make sure your code
- # does *not* invoke the flask development server with app.run(), as it
- # will prevent your wsgi file from working.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement