pythonanywhere

Adding a custom domain in PythonAnywhere does not work

旧巷老猫 提交于 2020-01-16 18:38:26
问题 I added my application to pythonanywhere, now I'm trying to add a custom domain but I can not get a positive result. My change I've added in pythonanywhere looks like this. Under my hidden field is my domain name. According to the documentation, I added a CNAME record (at my domain provider, it looks like this.). But after entering in the address www.ka ....pl I am not being redirected to my django application in pythonanywhere. This is my first time when i added my domain, how to fix this

Login using python requests doesn't work for pythonanywhere.com

梦想与她 提交于 2020-01-16 05:39:10
问题 I am trying login to the site pythonanywhere.com import requests url='https://www.pythonanywhere.com/login' s = requests.session() values = { 'auth-username': 'username', 'auth-password': 'password'} headers = {'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36'} u = s.post(url, data=values, headers=headers) But I am getting a <Response [403]> , Csrf verification failed. How do I login to that site? 回答1: You

PythonAnywhere - No module named 'pyvirtualdisplay'

£可爱£侵袭症+ 提交于 2020-01-15 10:23:09
问题 I am trying to run online a project on PythonAnywhere. When I call this function: def getPrice(item_url): from forex_python.converter import CurrencyRates from selenium import webdriver from pyvirtualdisplay import Display #from IPython.display import display with Display(): browser = webdriver.Firefox() try: browser.get(item_url) item_price = browser.find_element_by_xpath("//SPAN[@class='market_table_value normal_price']").text #item_price isn't an integer, it's a string, 'Prezzo iniziale: $

Slack API - rtm_connect error

廉价感情. 提交于 2020-01-06 07:31:47
问题 When attempting to use the Slack API (Real Time Messaging) I get what seems to be a certification error. Any ideas why this is happening? Would love to get some feedback to point me in the right direction. I am using python 2.7 and the code is hosted in a paid account at pythonanywhere. import os from slackclient import SlackClient verif_token = os.environ.get("MYTOKEN") slack_client = SlackClient(verif_token) slack_client.rtm_connect(with_team_state=False) Traceback (most recent call last):

Slack API - rtm_connect error

喜夏-厌秋 提交于 2020-01-06 07:31:14
问题 When attempting to use the Slack API (Real Time Messaging) I get what seems to be a certification error. Any ideas why this is happening? Would love to get some feedback to point me in the right direction. I am using python 2.7 and the code is hosted in a paid account at pythonanywhere. import os from slackclient import SlackClient verif_token = os.environ.get("MYTOKEN") slack_client = SlackClient(verif_token) slack_client.rtm_connect(with_team_state=False) Traceback (most recent call last):

Flask-SQLAlchemy session object not seeing changes to the database?

自古美人都是妖i 提交于 2020-01-06 05:47:08
问题 I have a website on PythonAnywhere that uses Flask and Flask-SQLAlchemy connected to a MySQL database. Users can use the website to queue a task that is saved to the database as a record in a table, and then a separate scheduled task (Python program) checks the database and handles every unhandled record. The problem I'm encountering is that the scheduled task's db query seems to only find new records when it runs for the first time, but if I then use the website to add a new task, the still

Pythonanywhere, how to use static files? url?

北慕城南 提交于 2020-01-03 17:45:04
问题 I am completely new to Pythonanywhere, I cant figure out why static files are not loading... Here is the path where I stored css and images stuff, i.e. static/images/wikiLang.png etc /static/admin/ /usr/local/lib/python2.7/dist-packages/django/contrib/admin/media /static/ /home/saadfast/WikiWorld/static /media/ /home/saadfast/WikiWorld/media where as in the client side how should I use the URL? what i have done in the search.html : <div id="TopheaderImg"> <img src="/home/saadfast/WikiWorld

Restart server from bash console

大憨熊 提交于 2020-01-02 07:16:42
问题 Is there any way to restart the web server from within the bash console given in the browser for PythonAnywhere ? I have searched google for a while and have not found anything relevant. 回答1: There is a file for each of your web apps in /var/www . The naming of the file should make it obvious which file applies to which web app. Type touch /var/www/<filename> (where <filename> is the name of the file that is for the web app you want to restart) and server will notice that the modified date of

How do I deploy web2py on PythonAnywhere?

流过昼夜 提交于 2020-01-01 02:42:21
问题 How do i get a basic web2py server up and running on PythonAnywhere? 回答1: [update - 29/05] We now have a big button on the web tab that will do all this stuff for you. Just click where it says Web2Py , fill in your admin password, and you're good to go. Here's the old stuff for historical interest... I'm a PythonAnywhere developer. We're not massive web2py experts (yet?) but I've managed to get web2py up and running like this: First download and unpack web2py: wget http://www.web2py.com

Media files not showing on Debug False

Deadly 提交于 2019-12-25 16:49:44
问题 I've just deployed a site with pythonanywhere, when I set to DEBUG mode to False , my media images dissapear, the path of my media folder is not found. I was asking myself what causes this issue and how I can resolve it ? Here is how I configured my settings : STATIC_URL = '/static/' STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles') MEDIA_ROOT = os.path.join(BASE_DIR, 'media') MEDIA_URL = '/media/' urls.py urlpatterns = [ ... ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)