Giter Site home page Giter Site logo

help_pages's People

Contributors

2x2xplz avatar amooabeebadesina avatar caseneuve avatar conradho avatar deeptikorwar avatar dependabot[bot] avatar dullbananas avatar filiplajszczak avatar gottagofaster236 avatar gpjt avatar gregkaleka avatar hendrikvandeput avatar hjwp avatar idanenglander avatar jdemonasterio avatar mikemyl avatar nicozanf avatar nilsrg avatar ninakahr avatar pythonanywherefts avatar rdil avatar rogererens avatar samboyd avatar soundmaking avatar sputtering avatar thomasbooij95 avatar tobex001 avatar wdoyle123 avatar willemhendriks avatar windsooon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

help_pages's Issues

Add filess.io to Whitelist IPs

I am trying to access the Relational DB from PythonAnywhere Application but it does not allow me to connect to the database.
I get the error: connection to server at "vmd.h.filess.io" (161.97.121.243), port 5433 failed: Connection refused

After researching a lot, I found that the website/server is not listed in the Allowlisted sites for free users and because of that, I cannot connect to the DB.

Please add vmd.h.filess.io to the allowed hosts list.

Environment Variables help page does not address non virtualenv bash consoles

https://github.com/pythonanywhere/help_pages/blob/master/articles/EnvironmentVariables.md

mentions how to load environment variables in your web application or in your virtualenv consoles.

However, not everyone uses a virtualenv and there is no documentation to address loading the environment variables into a normal bash console.

I discovered you just need to add set -a; source ~/my-project-dir/.env; set +a to the .bashrc file that's at /home/username/ so it shouldn't be hard.

I think this would make the article more complete, I could open a PR if you want but I wanted to run this past you guys first :)

Redirect question.

It would like to be redirected to the main page after login in the registration window.

It was like being redirected to the previous page.

Cannot create a virtualenv

Whenever I try to create a virtual environment using mkvirtualenv or virtualenv commands, the setup gets stuck and no further progress happens. Hitting ctrl_c gives the result as:

10:12 ~ $ virtualenv -p python3 arham
Running virtualenv with interpreter /home/anujdhongade/.local/bin/python3
Using base prefix '/usr'
New python executable in /home/anujdhongade/arham/bin/python3
Also creating executable in /home/anujdhongade/arham/bin/python
Installing setuptools, pip, wheel...^Cdone.
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/virtualenv.py", line 2328, in
Traceback (most recent call last):
File "/usr/local/bin/virtualenv", line 11, in
sys.exit(main())
File "/usr/local/lib/python2.7/dist-packages/virtualenv.py", line 671, in main
raise SystemExit(popen.wait())
File "/usr/lib/python2.7/subprocess.py", line 1376, in wait
main()
File "/usr/local/lib/python2.7/dist-packages/virtualenv.py", line 713, in main
symlink=options.symlink)
File "/usr/local/lib/python2.7/dist-packages/virtualenv.py", line 945, in create_environment
download=download,
File "/usr/local/lib/python2.7/dist-packages/virtualenv.py", line 901, in install_wheel
pid, sts = _eintr_retry_call(os.waitpid, self.pid, 0)
File "/usr/lib/python2.7/subprocess.py", line 476, in _eintr_retry_call
return func(*args)
KeyboardInterrupt
call_subprocess(cmd, show_stdout=False, extra_env=env, stdin=SCRIPT)
File "/usr/local/lib/python2.7/dist-packages/virtualenv.py", line 769, in call_subprocess
line = stdout.readline()
KeyboardInterrupt

Please help!

Please update documentation error on mysql python code snippet (Connect From Outside)

Change the mysql import with pymysql on the following article

https://help.pythonanywhere.com/pages/AccessingMySQLFromOutsidePythonAnywhere

Section From Python code

Some users (me included) have been experiencing errors DB frozen errors while trying access the DB via SSH Tunnel using that code.

Articles with Examples on this Topic

My working example after changing that:

import pymysql as sqlConnector
import sshtunnel

sshtunnel.SSH_TIMEOUT = 5.0
sshtunnel.TUNNEL_TIMEOUT = 5.0


dbHostName='zzzzzz.mysql.pythonanywhere-services.com'
dbName='myDB$tendlc_db'
dbUserName='myDBuser'
dbUserPassword='xxxxxx!'
sshHostName='ssh.pythonanywhere.com'
pyUserName='myLogin'
pyPassWord='myPWD'

#Perform Connection test and Sample Query
def dbtest(): 
    dbapi_config.refresh()
    with sshtunnel.SSHTunnelForwarder(
        (sshHostName),
        ssh_username=pyUserName, ssh_password=pyPassWord,
        remote_bind_address=(dbHostName, 3306)
    ) as tunnel:
        print ("SSH TUNNEL ESTABLISHED")
        connection = sqlConnector.connect(
            user=dbUserName, password=dbUserPassword,
            host='127.0.0.1', port=tunnel.local_bind_port,
            database=dbName,
        )
        print("CONNECTED")
        tst_query="SHOW TABLES"
        execute_query(conn=connection,query=tst_query)
        connection.close()

#This Helper function o execute query I am not the author but someone else's I cant find on my files
def execute_query(conn, query):
    cur = conn.cursor()
    cur.execute(query)
    print(cur.description)
    print()
    for row in cur:
        print(row)

pyowm import issue

i have a python script which takes a webhook request from dialogflow and returns a response
now here am facing trouble with importing pyowm package the error exactly says permission denied

improvement to MySQL Workbench instructions

  • on this page: https://help.pythonanywhere.com/pages/AccessingMySQLFromOutsidePythonAnywhere/

  • add the following line to: MySQL Workbench section right above Settings Values
    select "Standard TCP/IP over SSH" from drop down combo box

  • spent 2 hours trying "Standard TCP/IP" and setting the SSH values on the Remote Management Tab in the Sql Workbench UI but i would get unable to connect to localhost errors but if you use the "Standard TCP/IP over SSH" it works just fine.

  • by the way i think pythonanywhere is really awesome. you guys have done a fantastic job.

Have an article on the differences between bcrypt and py-bcrypt

This was a big that took me HOURS to figure out. I think it would be useful to add an article in the help pages about the following:

I was creating a flask app, and I was using bcrypt to validate my users passwords. My code worked on my local machine fine, passed all my unit tests, yada-yada. I pulled my code onto Python Anywhere, and opened a python3 shell and did this:

$ python3
>>> import bcrypt
>>> 

Everything worked, so I guess that PA has it preinstalled. Let me now run my unit tests:

TypeError: Unicode-objects must be encoded before hashing

Hm, probably a Python 2 vs 3unicode thing. No worries, I'll just install the Python 3 version of bcrypt.

pip3 install --user bcrypt

Then, I run my unit tests again. Everything passes, looking good. However, I try going on my website, but all I get now is a 500 error with this in my error log:

ValueError: Invalid salt

After spending a VERY long time messing around with utf encodings, strings and even Flask-bcrypt (not python 3 friendly), I still couldn't figure anything out. Turns out, if you do a pip freeze, PA has py-bcrypt preinstalled, instead of bcrypt.

The really frustrating part is that the module to use py-bcryt is actually called bcrypt! This explains why my unit tests worked, as they were using the bcrypt module, whereas the WSGI was probably using the py-bcrypt module. After hours of googling and debugging... Finally! A solution!

So, here's what to do if you're using bcrypt in your program and you're going to host your code on Python Anywhere:

  1. Use virtualenvs

  2. Refactor your code so that it works with py-bcrypt. Here are the major differences I could find (bcrypt vs py-bcryt)

    • In bcrypt, you will need to encode the hash and string into bytes if you wanna use the hashpw method (assuming you're storing your hash as string in your DB).
    >>> hash.encode('utf-8') == bcrypt.hashpw(b"badpassword", hash.encode('utf-8'))
    >>> True
    

    In py-bcrypt you must only use strings:

    >>> hash = bcrypt.hashpw("badpassword", bcrypt.gensalt())
    >>> hash == bcrypt.hashpw("badpassword", hash)
    >>> True
    
    • Hashes generated with bcrypt will NOT be compatible with the hashes used with py-bcrypt. Forgive me if I get this incorrect, but bcrypt hashes begin with the $2b$, whereas py-bcrypt hashes start with $2a. You will need to change your hashes in order for the program to work, though I'm not entirely sure if simply changing the prefix will make your hashes compatible.

BTW I posted a bunch of extra details for the lone Googler who also has this obscure problem.

Djanjo Help Tutorial Produces Import Error When Follow Exactly

The Django Tutorial brings you to an error when followed exactly. I've tried this with both python 2.7 and 3.5.
DjangoTutorial
The point that I'm stuck at is

python ./manage.py syncdb

Error that's given is:

23:52 ~/mysite $ python ./manage.py syncdb
Traceback (most recent call last):
  File "./manage.py", line 22, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 367, in execute_from_command_line
    utility.execute()
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 341, in execute
    django.setup()
  File "/usr/local/lib/python2.7/dist-packages/django/__init__.py", line 27, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/usr/local/lib/python2.7/dist-packages/django/apps/registry.py", line 85, in populate
    app_config = AppConfig.create(entry)
  File "/usr/local/lib/python2.7/dist-packages/django/apps/config.py", line 116, in create
    mod = import_module(mod_path)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
ImportError: No module named myapp.apps

Here's some more from the error log
full error log.txt

No method for deleting/removing account

There is currently no instructions on how to deleting/removing pythonanywhere account.

There should be an option for this and if there is it needs to be documented better.

Gettting "Server Error"

I am getting this error for everything I do I can log in but cant continue from here

`Server Error :-/
An error has occurred. This shouldn't happen

Feel free to contact your nearest PythonAnywhere representative (there's a "Send feedback" link above), and loudly complain about the problem.

(Extra credit if you do so in rhyming verse!)`

Not able to rename the web app

Hi there,
I was trying to give custom domain to my deployed application. So I was looking in the help pages - this shows that I can click on the pencil to set my domain, but in my case it is not coming or it is removed.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.