Forums

getting PA to serve my python app

i just cant get started with PA....i recently uploaded the python-app files under /home/user/app.. the app was working when i configured it locally but later i needed to serve it here... the wsgi.py file is under ( /home/user/app/app ) but i just cant configure the default --wsgi.py under /var/www/--wsgi.py to get to see my app.....any help plz

If someone could give me the necessary steps that will b really helpful .....here is the file structure..... under /home/user/
app/
------app/ ( init.py , init.pyc , settings.py , settings.pyc , urls.py , urls.pyc , wsgi.py , wsgi.pyc )
------app_ps/ ( init.py , init.pyc , admin.py , admin.pyc , forms.py , forms.pyc , models.py , models.pyc , tests.py )
------static/
------media/
------databs.db
------manage.py

A couple of questions:

  • Which Python version are you using?
  • Which Django version?
  • Can I take a look at your files? (I can see them from our side, but as a matter of policy we never look at your stuff without asking so that you have a reasonable amount of privacy :-)

python 2.7 , wanted to use Django 1.5 but they PA offered 1.3 ......u can chek the files out....realy need to get this thing running

You don't have a web app set up. To use Django 1.5, you'll need a virtualenv. There are instructions here

am new to this...so pardon me...the thing is i was given a python app...n was supposed to put it into production....i was able to configure it with wsgi and nginx and managed to run it locally...ie (serving it with nginx and wsgi) ....now the next task was to to serve it from PA ...thats where am stuck ......SO I HAVE ALL THE NECESSARY FILES FOR THE APP..i just need to know how i can serve it from PA.....hope u understand where am at...

Yes, I understand that you have your app. To serve it from PythonAnywhere, you need to configure the environment it's going to run in and tell PythonAnywhere to run it. If you follow the instructions I linked to, changing the version of Django and skipping the bits about creating Django apps and projects and just use the bits that talk about the virtualenv and the WSGI file (pointing it to your app files) you'll be able to set everything up.

thanks glenn lemi try it out .. i will give a feedback later

am almost getting things running....i sorted it locally by installing wxpython..but on this virtualenv pip cant seem to find it...any help...am sure after this i will get things running

Exception Type: ImportError
Exception Value: No module named wx.lib.agw

wx.lib.agw is a GUI widget set. On PythonAnywhere, there is no screen to draw on so GUI widgets are pointless. What is your web app using it for?

the web app is a form of point of sale app......i think the person who developed it used the library so it comes as a dependency during deployment.......i tried pip installing wxpython on the virtualenv but am faced with storage issues.....the space left is so little

is there a way i can get the library without the need to install the whole wxpython package

I don't think that installing the Python bindings will help we don't have the underlying library installed and so the bindings will just fail. I would think that you should check to see what wxpython is being used for and see if you can replace it with something else.

any help on how we can get rid of this error.... av looked for an alternative but cant seem to find one.... am doing it from a virtual environment,.....av upgraded tp a WEB DEV account so i have all the necesary space....av tried installing wxpython but am now facing several dependencies which r bugging me on installation....coz pip cant find them...n i cant install them from the home directory as root.

Get rid of what error? Have you looked at the code that's giving you the error? What is the app using wx for? What packages are you trying to install that are not on PyPI?

i just want to deploy the app.....this dependency is the only1 slowing me down....i was just given the app....so kindoff i dont know what the app uses if for..remember am new 2 this....i just want to give if the platform similar to the one my machine has......so for now i just need help...since the the major stuff i do on the virtual env...is highly dependant on the root....n i cant run anything as root....so if u may have some useful info let me know...coz am remaining with lyk a day....

for instance...pip install wxpython...depends on gtk..which i cant install on the virtualenv...get it

here's what am getting when i visit the domain....chek the image below and see whether u can help me

http://www.4shared.com/photo/wbOqQX3oba/madivak-Selection_002.html?

So a quick look at your files immediately shows that the import of wx.lib.agw is not even used in the module it's imported in. Just delete the line.

gv me sm tym i'l get back 2 u

am now getting sm DB errors...but from here...i hv looked up the file n its quit confusing what i should do ...coz i just cant delete a line over there...here's what am getting.....

http://www.4shared.com/photo/nlUU7mpdba/Selection_003.html

Either you haven't done a syncdb, or your your web app has a bug that you need to diagnose and fix.

hey ....glenn there's sm help i need from ur side....to chek whether the app is running

Hi there -- what help do you need?

i have an app that works very well from my machine...i am now faced with sm data base error from here (PA) ....

http://www.4shared.com/photo/nlUU7mpdba/Selection_003.html

i have already sync the database...but this error seems to persist......any help pls.....i was wondering whether i can run "Python manage.py runserver" and u check from over there whether u can chek it from the local address 127.0.0.1:8000 coz this command runs without problems

Can I take a look at your files?

(Just to be clear -- I can see your files from our side, but we always ask for permission first.)

yea i know..... u can have a look at them

OK, it looks like you're using sqlite, and you're specifying the database as database.db. You need to specify a full path to your database, as otherwise the file that is used by your application depends on where the code is running. Your web app runs with a working directory of /home/madivak, and when you run things from the command line the working directory depends on where you cd to.

I can see that there's an empty /home/madivak/database.db, which is the one that your web app is currently using (and so that explains why your web app reports that the database doesn't have the right tables). And there's also a non-empty /home/madivak/pos/database.db, which suggests that you ran the syncdb while your working directory was /home/madivak/pos

So, to fix the problem you need to specify a full path to the database file in your settings.py. Change it from database.db to /home/madivak/pos/database.db, then reload the web app, and the error should be fixed.

thanks let me try that out

whatt u are a life saver......thank u very much.......it ran......thank u so much

hey just a question ..... can i be able to customize or get a unique domain name...instead of the madivak@pythonaywhere one?... what is the process of acquiring that from u guys

Thanks for confirming it works now! :-)

We don't sell domain names, but if you buy one from a domain name registrar then you can set up a PythonAnywhere web app to run on the domain -- there's more information on the PythonAnywhere side of the setup on this help page.

hey and if i am to set up a second app ..... cant u guys help me out before i get to buy a domain name i.e for the mean time? ...... coz from the settings am being told to

"set up a CNAME record that tells the DNS system that (say) www.your-domain.com is hosted at your PythonAnywhere web app address, madivak.pythonanywhere.com."

so how do i go about with this

That's something you need to do once you've bought the domain name. Different domain name registrars have different ways of setting up CNAME records -- once you've bought your domain name, if you can't find the CNAME option, just let us know who you used and we'll see if we can find the appropriate help pages on their site for you.

ok...i'll b back when am all sorted