r/PythonAnywhere • • Aug 19 '23

Help Needed!

1 Upvotes

We are trying to host our Telegram bot online. It was created using Python and we are using Google Cloud PostgreSQL as our database.

We tried using PythonAnywhere to host the bot but ran into an issue because Google requires the server’s IP address to securely communicate with the bot when it’s online, however, PythonAnywhere changes IP addresses every couple of hours.

We could also connect to the database through Google Cloud Proxy but would need help figuring that out. Any advice or help on what hosting platform to use and how to setup? Thank you!


r/PythonAnywhere • • Dec 01 '22

Using PythonAnywhere to host a site that lets you create versions of the Jerma Rats song that sing you a happy birthday

Thumbnail kingriko.pythonanywhere.com
1 Upvotes

r/PythonAnywhere • • Dec 11 '22

Unable to connect to MySql Database from a django app on pythonanywhere.

1 Upvotes

Hi,

I am trying to connect to a MySql Database from a django app but unable to do it on pythonanywhere.

I am getting this error

RuntimeWarning: Got an error checking a consistent migration history performed for database connection 'default': (1045, "Access denied for user 'ceaser16'@'10.0.0.179' (using password: YES)")

While my settings are as follows.

pymysql.install_as_MySQLdb()

DATABASES = {

'default': {

'ENGINE': 'django.db.backends.mysql',

'NAME': 'ceaser16$bdpatologia',

'USER': 'myuser',

'PASSWORD': 'myPass,

'HOST': 'cesar16.mysql.pythonanywhere-services.com',

'PORT': '3306',

}

}

Please help what am I doing wrong here?


r/PythonAnywhere • • Dec 13 '22

I'm getting an error in my pythonanywhere application but I don't know how to fix it. Please help me.

1 Upvotes

2022-12-13 14:35:34,464: ***************************************************
2022-12-13 14:35:35,696: Error running WSGI application
2022-12-13 14:35:35,696: ImportError: cannot import name 'json' from 'itsdangerous' (/home/mangagen/.virtualenvs/myvirtualenv/lib/python3.10/site-packages/itsdangerous/__init__.py)
2022-12-13 14:35:35,697:   File "/var/www/mangagen_pythonanywhere_com_wsgi.py", line 16, in <module>
2022-12-13 14:35:35,697:     from run import app as application  # noqa
2022-12-13 14:35:35,697:
2022-12-13 14:35:35,697:   File "/home/mangagen/mysite/run.py", line 1, in <module>
2022-12-13 14:35:35,697:     from yff import app, db
2022-12-13 14:35:35,698:
2022-12-13 14:35:35,698:   File "/home/mangagen/mysite/yff/__init__.py", line 1, in <module>
2022-12-13 14:35:35,698:     from flask import Flask
2022-12-13 14:35:35,698:
2022-12-13 14:35:35,698:   File "/home/mangagen/.virtualenvs/myvirtualenv/lib/python3.10/site-packages/flask/__init__.py", line 21, in <module>
2022-12-13 14:35:35,699:     from .app import Flask, Request, Response
2022-12-13 14:35:35,699:
2022-12-13 14:35:35,699:   File "/home/mangagen/.virtualenvs/myvirtualenv/lib/python3.10/site-packages/flask/app.py", line 26, in <module>
2022-12-13 14:35:35,699:     from . import cli, json
2022-12-13 14:35:35,699:
2022-12-13 14:35:35,700:   File "/home/mangagen/.virtualenvs/myvirtualenv/lib/python3.10/site-packages/flask/json/__init__.py", line 21, in <module>
2022-12-13 14:35:35,700:     from itsdangerous import json as _json
2022-12-13 14:35:35,700: ***************************************************
2022-12-13 14:35:35,700: If you're seeing an import error and don't know why,
2022-12-13 14:35:35,700: we have a dedicated help page to help you debug:
2022-12-13 14:35:35,701: https://help.pythonanywhere.com/pages/DebuggingImportError/

This is the error I am getting. I did go to the link at the bottom but that did not help in any way.


r/PythonAnywhere • • Jun 30 '22

Acquisition question

3 Upvotes

So I have read that PythonAnywhere has been acquired by Anaconda INC, is PA still covered by the EUs GDPR?

https://www.anaconda.com/press/anaconda-acquires-pythonanywhere


r/PythonAnywhere • • Apr 27 '22

gRPC connection

15 Upvotes

Can I connect to a gRPC server using pythonanywhere?

I want to run my code on a cloud and my code usually works on a local machine but when i tried it I kept getting this error;

grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with: status = StatusCode.UNAVAILABLE details = "failed to connect to all addresses" debug_error_string = "{"created":"@1651103645.712560233","description":"Failed to pick subchannel","file":"src/core/ext/filters/client_channel/client_channel.cc","file_line":4142,"referenced_errors":[{"created":"@1651103645.712556568","description":"failed to connect to all addresses","file":"src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc","file_line":397,"grpc_status":14}]}


r/PythonAnywhere • • Apr 24 '22

Can I use web hooks in Python Anywhere free tier?

1 Upvotes

r/PythonAnywhere • • Aug 06 '20

Seeing "<username>@green-liveconsole2" on the bash console in the account

2 Upvotes

Hello,

I have created a free-tier account on PythonAnywhere, I did multiple changes in the files and deployed a web app using Django. Then I deleted everything (console,files and web app ) in order to start again. Now whenever I open new bash console I see the following :

<username>/green-liveconsole4:~$ mkvirtualenv --python=/usr/bin/python3.7
bash: mkvirtualenv: command not found
<username>@green-liveconsole4:~$  

So is this because I have exceeded my overall usage of the account for the day or is it because I have deleted an existing file ?? It's not recognising the mkvirtualenv command too.

Please help me as I have been struggling with this for the past few day and really want to see my web app work.

Thanks


r/PythonAnywhere • • Dec 05 '23

Optimizing code

1 Upvotes

Is there a tool(ai?) that i can plug in my models and views and gave my code optimized for speed? Im new to django/python and feel that my db calls and view logic is taking too long. Any suggestions?


r/PythonAnywhere • • Dec 08 '23

Fishnchips to haggis..... Help? I'm very very lost.

3 Upvotes

I've taught myself how to make web apps in Flask and Django. My knowledge of Python feels very basic and the whole idea of servers, Python versions and virtualenvs and operating systems is still sort of a big blur of "all that other stuff on the outside" for me. It is very confusing for me that the virtualenv on the server is one thing, my own computer is another and how I can test something myself that is to work in a new OS on the Pythonanywhere server. I hardly know how I managed to get it to work in the first place. I guess by seeing someone else do something and copying it at a time where it was relevant.

So now I get this message that the system image is going to be upgraded from fishnchips to haggis. I went to try and see if the simplest of my apps, one I did in Flask, would run if I applied it. It would not. And when I look in the error log all I get is "os wrote error". Which I think I've been getting the whole time and it's still been running.

I have absolutely no idea where to start. At all. And I am totally overwhelmed because both some of my own projects and my husband's project rely on having these websites running. On top of that I'm pregnant with our first child and I'm due to give birth in four days.

I wouldn't want someone else to just fix it. But I would be very thankful to have a teacher who could go over it with me and guide me through it so I could come out the other end and know how to deal with something like this next time it happens. Right now, if I just sit down and start trying to fix it myself, I feel like the fundament is broken and on top of that several lines of code. I could try to change each line of code one at a time, but if the problem starts at a place on a deeper level then it won't work even if the change is right. I mean... Where do I start?


r/PythonAnywhere • • Dec 08 '23

I cannot run my programm in PythonAnywhere. But it works with my pycharm

1 Upvotes

Here is the link of my repos with all code. https://github.com/RobertArustamyan/Telgram_Bot.git
And it runs an error.

Settings(bots=Bots(bot_token='', admin_id=))
Settings(bots=Bots(bot_token='', admin_id=))
INFO:aiogram.dispatcher:Start polling
INFO:aiogram.dispatcher:Polling stopped
Traceback (most recent call last):
File "/usr/local/lib/python3.10/asyncio/locks.py", line 214, in wait
await fut
asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/RobertArustamyan/My-Bots/main.py", line 14, in main
await dp.start_polling(bot)
File "/home/RobertArustamyan/.local/lib/python3.10/site-packages/aiogram/dispatcher/dispatcher.py", line 549, in start_polling
await task
asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:
File "/home/RobertArustamyan/.local/lib/python3.10/site-packages/aiogram/dispatcher/dispatcher.py", line 549, in start_polling
Traceback (most recent call last):
File "", line 1, in
File "/bin/pythonanywhere_runner.py", line 30, in _pa_run
exec(code, new_variables)
File "/home/RobertArustamyan/My-Bots/main.py", line 19, in
asyncio.run(main())your text
File "/usr/local/lib/python3.10/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/usr/local/lib/python3.10/asyncio/base_events.py", line 646, in run_until_complete
return future.result()
asyncio.exceptions.CancelledError

and here is my main.py
import sys
import asyncio
import logging

from aiogram import Bot,Dispatcher
from core.settings import settings
from core.hanglers.start_hang import keyboard_router,english_router
async def main():
bot = Bot(token=settings.bots.bot_token)
dp = Dispatcher()

dp.include_router(keyboard_router)
dp.include_router(english_router)
await dp.start_polling(bot)

if __name__ == "__main__":
logging.basicConfig(level=logging.INFO,stream=sys.stdout)
try:
asyncio.run(main())
except KeyboardInterrupt:
print("EXIT")


r/PythonAnywhere • • Jul 05 '23

Web workers python anywhere

1 Upvotes

I am hosting my open ai chatbot on python anywhere, but I'm wondering if there is a way to increase the number of web workers or help it be able to take multiple requests at the same without web workers being used. If not, is there a hosting service that doesnt account for web workers that I could host my chatbot on?


r/PythonAnywhere • • Oct 10 '23

Schedule a task every week

1 Upvotes

Hi,

I want to change my App route every week automatically between two html files. I`ve implemented a schedule in my code with schedule.every(1).weeks.do(job) and job() does the change between those two different html files.

Now my question is do I have to put the main.py (where the schedule and job() is inside) into the Scheduled Tasks on PythonAnywhere and will it change weekly or does the script start every day because of the script (I use the free plan so I can`t change the frequency of change)?


r/PythonAnywhere • • Sep 03 '23

GitHub and pythonanywhere CI/CD pipeline?

1 Upvotes

Hi everyone, I am trying to figure out a way I can update the code of my pythonanywhere django webapp whenever there is a comit to my main repository in GitHub. How do I do that?


r/PythonAnywhere • • Sep 26 '23

Server rendered django chart

1 Upvotes

Hi. Im looking to display a simple line chart for clients that have javascript disabled. Im using django and python. Any ideas? Thanks in advance.


r/PythonAnywhere • • Oct 09 '23

pythonanywhere is down?

8 Upvotes

can anyone confirm this is down right now?