The PythonAnywhere help pages
Many of your questions about PythonAnywhere are likely to be answered below. If not, the best place to get support is in our Forums and EU Forums. We monitor them to make sure that every question gets answered, and you get the added benefit that other PythonAnywhere customers can help you out too. They're also a nice place for a chat
If you want, you can access an even broader group of people by asking your questions on StackOverflow; we check all posts there tagged with pythonanywhere daily, and reply if no-one else has already solved the problem.
But if you want to ask your questions in private and get responses over email, you can use the "Send feedback" link at the top of any page on PythonAnywhere. We'll be alerted and will get back to you ASAP. You can also email us directly via support@pythonanywhere.com
If you want help about Python programming generally (as opposed to PythonAnywhere), you can buy 1:1 live Python help at Codementor.
We also have a page that lists books and courses the people have recommended to us here.
The help pages have the following sections -- hopefully you can jump straight to one that describes what you're looking for help with!
- I'm a beginner learning Python
- I've got an existing web app that I'm trying to deploy
- I'm looking at an error message in a console
- I'm looking at an error message in my web app
- I'm trying to figure out how to get a particular tool or feature to work
- I'm a teacher looking to use PythonAnywhere for education
- A few other topics
- Some older/miscellaneous guides
- A few other step-by-step guides
- Security
I'm a beginner learning Python¶
We have lots of beginners on PythonAnywhere! Here's a very quick step-by-step tutorial you might want to start with:
I want to start learning Python [account in US servers] [account in EU servers]
And here are some common questions and guides for beginners:
- How can I use a specific version of Python with the "Save & Run" button?
- Installing new Python modules for yourself
- Using the file browser
- The file editor
- Changing the font size in a PythonAnywhere console
- How do I share my code online?
- What is a good tutorial for learning Python?
I've got an existing web app that I'm trying to deploy¶
This section assumes you have started building a web app on your local PC, and you're now looking to deploy it to PythonAnywhere.
Here is a step-by-step tutorial that walks you through the general outline of how to set up an existing web app on PythonAnywhehre
I have built a web app on my local PC and want to deploy it on PythonAnywhere [account in US servers] [account in EU servers]
And here are some popular how-to guides and help pages for common webapp issues:
- Can I use FTP/Filezilla? How should I upload my code to PythonAnywhere?
- Debugging import errors and sys.path issues in your WSGI file
- Using a virtualenv for your web app
- How to use a custom domain for your web app (including CNAME setup)
- How to set up an HTTPS/SSL certificate for a custom domain
- How to force HTTPS on your web app
- Troubleshooting DNS problems
- How to use our static files service, and why you might want to
- How to set environment variables in web apps
- How to handle slow/async work in a web app
- How to point a new domain at an existing web app in the Web tab
- How to move a domain from one PythonAnywhere user account to another
- Using MySQL
- I'm getting a 502 Bad Gateway error. How can I debug?
- My site is slow!
- How to host a static site on PythonAnywhere
- Using International Domain Names -- that is, ones with non-ASCII/Unicode characters in them
- How do I create a web app that redirects from one domain to another?
- How many hits can my site handle? -- a guide to making sure that you have the right number of worker processes
And some tips for specific web frameworks:
-
Django
- Deploying an existing Django project on PythonAnywhere
- How can I use a more recent version of Django for a new project
-
How to setup static files under Django -- STATIC_ROOT in settings.py,
collectstatic
, etc - The Django admin's CSS isn't working
- How to set SECRET_KEY via an environment variable
- Running Django code in consoles, scheduled and always-on tasks with custom management commands
- How to scale a Django Application on PythonAnywhere with Memcache (external link to Memcachier)
-
Flask
- A beginner's guide to building a simple database-backed Flask website on PythonAnywhere
- General Flask tips, including avoiding app.run() and how to run database config with db.create_all()
- Dealing with 504 or 502 errors in Flask applications
- Using SQLAlchemy with MySQL
- How to scale a Flask Application on PythonAnywhere with Memcache (external link to Memcachier)
-
Web2Py
-
Others
I'm looking at an error message in a console¶
Oh no! Here's our most common explanations and solutions to console problems:
- I get "permission denied" when trying to pip install a new module
- Why do I get a "403 Forbidden" error when accessing a website from PythonAnywhere?
- I'm getting "no such file or directory"
- LOAD DATA INFILE doesn't work
- "Disk Quota Exceeded" (running out of storage space / maxing out your quota)
Some technical problems with consoles that sometimes come up:
- I can't see what I'm typing in the console
- The "Starting encrypted connection" message never disappears
I'm looking at an error message in my web app¶
If you haven't already, the first step is to look in your error log -- you'll find a link to it on the Web tab (account in US servers; account in EU servers). There's more information about the error log here.
Once you've done that, here are some solutions to common problems
- Debugging import errors and sys.path issues <-- if you've just started setting up your app, chances are the answer is in here.
- Dealing with "there was an error reloading your web app" messages
- I'm getting a 502 Bad Gateway error. How can I debug?
- I'm getting a 400 Bad Request error from my Django app
- Debugging problems with static files (js, css) not loading
- Fixing "OperationalError: 2006 MySQL server has gone away"
- Fixing "OperationalError: 1226 User has exceeded the max_user_connections resource
- I'm seeing lots of GeneratorExit errors in my error log
I'm trying to figure out how to get a particular tool or feature to work¶
PythonAnywhere already has many of the Python modules that you might want to use installed. There is a complete list of them available on our Batteries included page
Here are some guides for some of the common things people want to do:
- Installing new Python modules for yourself
- Changing your system image
- Always-on tasks: how do I keep a console running forever? Or, how do I make a program that restarts automatically?
- How to I run an async task queue like celery?
- Can I use matplotlib to generate graphs from my data?
- Can I use SMTP to send email on a Free account?
- How do I solve authentication errors from Gmail when sending emails from my code?
- How to force HTTPS on your web app
- Using MySQL (including using MySQL with Python 3)
- Backing up (and restoring) MySQL databases using mysqldump
- Setting the timezone for your code
- Working with PDFs and converting document formats
- Can I use IPv6?
- Can I use Pygame / Tkinter / turtle / GUI packages?
- Using Selenium
- Using Playwright
- Does PythonAnywhere have an API?
- What do I do if a server I want to connect to has an allowlist that only allows incoming connections from particular (static) IPs?
- How to I get Twilio to work?
- Machine learning: what to do if your website using Keras, TensorFlow or PyTorch doesn't work
- Fonts
- Using Cloudflare with PythonAnywhere
And here's some very brief FAQ answers about common requests:
- Can I use MongoDB? It's not built in, but from a paid account you can use an external service like mLab. Some extra hints and tips on using Mongo here.
- Can I use an external MySQL service? Probably not (on a free account), unless they have an HTTP api.
- Can I use Redis? Again, only via an external service like redislabs. Although you can use redislite
- Can I use websockets, or run my own socket server? I'm afraid not -- we only support Python apps that implement the WSGI protocol
- How do I reload my webapp automatically? You can now use our API for this :)
- Which Python versions does PythonAnywhere support?
I'm a teacher looking to use PythonAnywhere for education¶
Welcome! We have lots of teachers and students on board. Check out this page for an overview of our education-specific features:
Or you can run through this step-by-step tutorial if you prefer:
I want to check out the Education Beta features [account in US servers] [account in EU servers]
A few other topics¶
- how to get SSH access to your account
- How to follow the Django Tutorial on PythonAnywhere
- I want to embed a live python console on my website
- How do I share my code online?
- Getting the IP address of clients connecting to your web app
- How do I get streaming/buffering to work?
- How to use a virtualenv in an IPython Notebook
- What are these virtualenv things, anyway?
- How do I completely delete my account?
Some older/miscellaneous guides¶
Files:
Consoles:
- Types of PythonAnywhere consoles
- Copying and pasting in PythonAnywhere consoles
- Changing a console's name
- What are CPU-seconds?
- Using external version control systems (eg. GitHub, BitBucket)
- Browser extensions that are known to cause problems with PythonAnywhere consoles
Web apps:
- How to create a web application on PythonAnywhere
- Reloading the web application after you've made changes
- Switching to the new virtualenv system
Databases:
- Databases available on PythonAnywhere
- Activating a Postgres server
- Configuring postgres for your app (eg Django)
- Creating Postgres backups
- Increasing the number of connections for your Postgres server
- Connecting to Microsoft SQL Server
- How do I find out how large my MySQL database is?
- Migrating a web2py app from SQLite to MySQL
- Database character sets (UTF8/Unicode etc)
- Importing a database you have stored on your own machine to PythonAnwyhere
- Accessing your MySQL database from outside PythonAnywhere
- Accessing your PostgreSQL database from outside PythonAnywhere
Scheduled tasks (similar to cron):
Other Languages:
- Setting up Haskell and creating a new Cabal package
- Setting up a Node project
- Testing a simple Javascript project using Jasmine
A few other step-by-step guides¶
I want to follow the Django Tutorial [account in US servers] [account in EU servers]
I want to create a web application [account in US servers] [account in EU servers]
I want to clone and hack on my GitHub project [account in US servers] [account in EU servers]