Forums

Regarding Clarification of the Deploy Guide

I am a hopeless newbie, I don't mind admitting that, but that combined with my field of expertise, namely pedagogical method, somehow also makes me a prime candidate for finding pedagogical errors in literature such as this. Please don't take offense by my criticism; my intentions are quite pure, and I know that it's difficult writing a bulletproof guide to anything that has to do with computers :)

Anyway, I present to you my observations:

While https://help.pythonanywhere.com/pages/DeployExistingDjangoProject/ is mostly easy to follow, a couple of things could probably do with a spot of elaboration and perhaps a tiny audit, if you don't mind my interjection here. To make it a bit easier in terms of future reference, I've boiled the process down to 11 steps, including setting up staticfiles and environ vars and created a local document. However there's a bug in there, somewhere, and I need to kill that little son of a gun :)

I made the setup work once by fiddeling with the setup; I don't know if it was purely blind luck or simply persistance. 2nd time around, I'm somewhat wiser, yet I'm once again trudging along in the mud, blindly changing vars here and there in the hopes that I hit the golden combination at some point like last time.

In the Code section, you may opt to insert Source Code and Working Directory. Being a greenhorn, I'd like to know what Source Code is supposed to mean in this particular case. Working dir is clear enough (I think), that's the folder in which manage.py lives, right..?

In the "edit your WSGI" I'm confused by this little gem:

assuming your Django settings file is at '/home/myusername/mysite/mysite/settings.py'

I should refuse to guess as per the instructions found in Python's import self easter egg. What is the difference between 'mysite' and 'mysite'? Wouldn't it be better to have, say, 'myusername/my_project_name/my_site/settings.py' or something to that effect?

Lastly, I think the Configuring Static Files and the Additional Configuration sections should come prior to the user being advised to proceed with the migration process in order to avoid frustration/confusion. I reckon it is somewhat common to have those things in a django project, but I could of course be wrong.

Something must've gone right in the process of setting up, none the less, but unfortunately not entirely. I'm finally welcomed by something familiar; a 400 error msg that I've stuck in my local project. I am, however a bit puzzled as to what I'm doing wrong still (it's clearly my error seeing as I made it work before). Through persistance I'll get it up and running again, I'm sure.

I hope that you find my take on the guide useful somehow. Have a nice day :)

Some answers to your questions:

  • source code on the webapp tab: it's current use case is that if you are editing a file which is within that source code directory using our file editor, then a webapp reload button shows up in the file editor
  • WSGI path: take a look at the file structure that django creates automatically (eg: scroll down a bit from here). Django automatically creates a mysite/mysite/settings.py. That's just how django structures their files.
  • seeing a 400 error: Here is a debugging guide that I recently created. I would appreciate any feedback!