Forums

Help Getting Started

Hi folks,

New to pythonanywhere, and just burying myself here trying to follow various bits of random advice from the forum, so will shout out.

First I tried just cloning my site, and then setting up a wsgi file. It kept failing with the ImportError: No module named wsgi

18:55 ~$ python /var/www/www_crosstech_partners_wsgi.py
Traceback (most recent call last): File "/var/www/www_crosstech_partners_wsgi.py", line 89, in <module> from django.core.wsgi import get_wsgi_application ImportError: No module named wsgi

Looked like it wasn't finding the wsgi module for some reason.

I then thought maybe i should start afresh and create a virtualenv into which I could clone my code. But now it looks like its clashing.

(crosstech)19:33 ~$ git clone git@bitbucket.org:koitaki/crosstech.git fatal: destination path 'crosstech' already exists and is not an empty directory. (crosstech)20:02 ~$

Any constructive suggestions as to the best way to get started please? Eg. if I should persist with the virtualenv, should I delete the files I cloned earlier and stored in a separate non-virtualenv folder? Or should I not worry about the virtualenv and keep trying to fix the wsgi problem?

Many thanks in advance for any help

I'd recommend starting again with a fresh checkout into a new folder, and a new virtualenv too. Check out the instructions here:

https://www.pythonanywhere.com/wiki/Virtualenvs

and some debugging tips for import errors can be found here:

https://www.pythonanywhere.com/wiki/DebuggingImportError

Cheers Harry, all good now. I deleted the folder that was clashing: 'crosstech'. I then went back to the virtualenv, made sure it was active, and cloned the git repository. It worked, then after a few more kerfuffle's I got the site working now.

Btw, I upgraded to Hacker yesterday ($5 per month) to get a Postgres database included for this site. However, when I click on Database - Postgres, the message says I need to upgrade to a custom plan. Would I indeed need to upgrade again?

Yep, postgres is extra. If you go to your "Account" page, you can add postgres to your account by clicking the "customize" button.

How did you get the impression that it was included in a Hacker plan? We should fix that...

Ok, cheers Harry, understood.

Not sure if its misleading, or just how I interpreted it, but here's how I got the impression...

I initially went to the Database and received this message:

Upgrade required. Postgres is not available on your account. If you want all its shiny postgressy goodness, you'll have to upgrade to a Custom plan with Postgres enabled :)

Ah, I thought, all I have to do is upgrade to a paid plan. The bit marked in bold is understandable with full hindsight knowledge, but possibly subtle enough to be open to misinterpretation by an amateur like myself :).

I then clicked through the 'Custom plan' link and saw Hacker for $5 per month. I looked at the offer in boxes, and then down the comparison list. I didn't see PostgreSQL anywhere on that list, so I assumed it was part of all upgrade packages.

Anyway, I understand now so I'll port it to the free MySQL db and use that instead.

Many thanks again Harry!