Django hosting on pythonanywhere.com/ - django

How can I upload my finished django local project to pythonanywhere.com? Is there any option or I should to do file by file?
I have right now something like this My Django website on pythonanywhere
but I don't see there how to upload my finished project :(
I uploaded a zip file but how to unzip it by bash console?

To unzip the file from a bash console, just start one from the "Consoles" tab and then run unzip filename.zip.

from here:
Getting code and content in and out is easy — you can use our built-in
browser-based editor and Bash consoles, scp, or you can use git,
mercurial and other VCS's to push and pull your code. You can even
sync up via Dropbox.
update
The Dropbox feature is not available anymore, and see first comment below

Related

Why is google cloud app deploy still giving me the old site

Recently I update all my site to a new node.js version 13.
I work hard to fixed everything. (My old site was online on Google cloud over 1 year with a version 7 or 8 and was working).
So I create my dist folder, and I create a new bucket on Google cloud. I follow every step from this site:
https://medium.com/#hb.ui/deploy-angular-app-to-google-cloud-app-engine-bucket-storage-9a9852f29869
So my new site was working fine with the new look.
But I had some small mistakes in some pages, so I rebuild a new dist folder. I erase the dist folder in my bucket and upload the new one.
I redo these 2 steps (with my real site name):
gsutil rsync -r gs://fitness-dashboard-bucket ./fitness-dashboard-app
and
gcloud app deploy ./fitness-dashboard-app
Unfortunately, the deploy gives me the old site. I modify and update the YAML file like it says in this post:
gcloud app deploy trying to push old code
And the site was not working . (GREAT, so I know that the deploy is working). I resend my real yaml file and do the 2 commands. but the site still giving me the old site again.
Why my modification are not taken ? Does I need to versioning ? If so How I do this ?
How I can update my site ??
Thanks
Finally I found it by myself.
I Open Editor in google and I saw old directories from a previous deployment. Like if the dist folder was not the same.
So I erase all old stuff in my app directory.
I close the editor and return to the terminal.
I just sync again et redeploy and finally I got my new site.
(I use my 2 commands that I write in my question to sync and deploy).

Download Compressed Folder from Jupyter Notebook in GCloud Deep Learning VM

This seems to be a very simple question, but I couldn't find a way to do it. The jyputer notebook has the option to download file one by one. But my training process generates too many files, and I want to download them all at once. Is there any way to do it?
Assuming it is JupyterLab what you are using:
Open a new Launcher (+ icon) and start a new terminal session.
Use zip -r FILE_NAME.zip PATH/TO/OUTPUT/FOLDER/ to compress the required folder.
Download the zip file as you were doing with the other ones.

How to view contents of a PCF .droplet file in Windows?

Problem
The question pretty much says it all. I used the plugin: "cf local" to get the .droplet file for my app in PCF. However, I have no idea how to expand or view the contents of the file.
What I tried
I tried adding a .zip at the end, but that did not work.
I tried viewing in NotePad, but that did not work.
Notes
We are using a Diego back-end which prevents us from using "cf files".
It shouldn't matter but we are deploying a .NET application
Related: Is it possible to download all files of an application in Cloud Foundry?
It's a gziped tar archive. Try adding a .tgz or .tar.gz extension. You may need a third party archive tool, I don't know if Windows will open that file by default. 7zip or something comparable should open it.
Daniel was on the right track, however I wanted to post exactly what I used as an alternative to an extraction utility.
I found that the easiest way is to use bash, within Windows. When we installed Github desktop there was an option to use bash and most of us, in my area, have done this.
If you have already installed it then: Goto Preferences an choose your Git-Shell. Under default Shell you can choose between: CMD, Git Bash, Powershell or Custom.
Once that is in place you can navigate to the folder where the .droplet file lives and execute the following command:
tar -xvzf app-name.droplet
This will extract the contents into a folder called "app" in the current directory which has the contents of your asset that would be in PCF.

How could i deploy my Cloud Code to AWS Elastic Beanstalk? (Parse Server)

I am struggling about how to upload my Cloud Code files that i had on Parse.com to my Parse Server hosted on AWS EB.
So far i have:
Parse Server hosted on AWS EB. To host it on AWS i used the Orange Deploy Button which basically makes all stuff easier for people without having to install the Parse Server locally and upload it later to AWS.
iOS App written in objective C connected to the Parse server and working perfectly
Parse Dashboard locally on my mac connected to the Parse Server on AWS
The only thing that i would need is to upload all my cloud code files to the Parse Server. How could i do this? I have researched a lot over Google, stackoverflow, etc without success. There is some information but its unclear. Thanks in advance.
Finally and thanks to Ran Hassid i now have a Fully functional Parse Server on AWS with Cloud Code. For those who are in the same situation where i was, here is the answer to my question:
Go to this link here and follow all the steps (By the time i asked the question, the information provided by this link of AWS wasn't that clear as it is now. They improved the explanations and the info.)
After you finish all the previous steps from the link. You would have a Parse Server on AWS working.
Now the part of CLOUD CODE. Just create a folder in your MAC or PC wherever you like. Let's say on the desktop and called it Parse Server AWS (You can call it whatever you want)
Install the EB CLI which is the Command line interface to user Terminal (On Mac) or the equivalent on windows to work with the parse server you just set up on AWS (Similar to CloudCode with Parse CLI). The easy way to install it is running this command:
brew install awsebcli
Now open terminal on mac (or the equivalent on windows) and go to the folder that you just created on the step 3.
Run the next command. It will ask you to select the location of your parse server, and then the name.
eb init
Now this command. It will download all the files from AWS of your parse server to this folder you are in.
eb labs download
Finally, you will have a folder called Cloud where you can put all your cloud code files in.
When you finish just run the command:
eb deploy
Now you have your parse server with all your cloud code files working on AWS.
Now any change you need to make to your cloudCode files, just change the local files inside this folder just created on step 3 and run again the command from the step 9. Just exactly as you used to do with Parse Deploy command
Hopefully this information will help many people as it helped to me.
Have a happy coding!
parse-server cloud code is a bit different from Parse.com cloud code. In Parse.com we use the Parse CLI in order to modify and deploy our cloud code (parse deploy ...) in parse-server your cloud code exist under the following path of your parse project ./cloud/main.js* so your cloud code endpoint is the main.js file which by default located under the **cloud folder of your parse project. If you really want you can change this path but to keep it simple use the default location.
Now about deployment. in parse-server you need to redeploy your parse server again when you do some modification to your cloud code. Another option is to edit your cloud code remotely but from my POV its better to redeploy it

Django Deployment Advice

I have a multi-step deployment system setup, where I develop locally, have a staging app with a copy of the production db, and then the production app. I use SVN for version control.
When deploying my production app I have been just moving the urls.py and settings.py files up a directory, deleting my django app directory with rm -rf command and then doing an svn export from the repository which creates a new django app directory with my updated code. I then move my urls.py and settings.py files back into place and everything works great.
My new problem is that I am now storing user uploads in a folder inside of my django app, so I can't just remove the whole app dir anymore or I would loose all of my users files.
What do you think my best approach is now? Would svn export --force work, since it should just be overwriting all of my changed files? Should I take an entirely new approach? I am open to advice?
You may want to watch this presentation by Jacob. It can help you improve your deployment process.
I use Bitbucket as my repo and I can simply perform push on my Dev box and run pull/update on Stage/Prod box. Actually I don't run them manually, I use fabric to do them for me :).
Your could use rsync or something similar to backup your uploaded files and use this backup when you deploy your project.
For deployment you could try to use buildout:
http://www.buildout.org/
http://pypi.python.org/pypi/djangorecipe
http://jacobian.org/writing/django-apps-with-buildout/
For other deployment methods see this question:
Django deployment tools
You can move your files to S3 servers (http://aws.amazon.com/s3/), so you will not ever have to care about moving them with your project.