Deploying Django App on PythonAnywhere without using GitHub - python

I need to deploy a Django app on pythonanywhere, but I wish I could upload the code without using GitHub because I don't have private repositories and I don't want my codes to be exposed to the public.
How can I deploy my Django app on pythonanywhere without using GitHub?

According to their documentation, you can upload your project as zip to pythonanywhere. Have in mind that if the project is big enough you have to split it into parts.
Steps
Make a zip file ( split it to parts if needed)
Uploaded to pythonanywhere using the Files Tab
Use the bash console and the unzip command to decompress it
Done
More Info here

See the documentation of python anywhere
https://help.pythonanywhere.com/pages/DeployExistingDjangoProject/

Related

deploy first django test app to anywhere (azure or heroku)

tldr; - When I have deployed a flask app in the past, it uses a requirements.txt file in the main root of the project folder so that azure or heroku can understand what modules need to be installed. However, this is the first time I am messing with django. I am trying to test deploy to azure or heroku but I azure can't detect the stack of the app because there is no requirements.txt file in the main root of the folder.
From messing with django a little bit, it seems alot more complicated than flask. What can I do to test deploy the most basic app to azure app services or heroku or aws or any place in general?
I tried deploying the django app like I normally do with flask but received an error:
Could not auto-detect the runtime stack of your app.
HINT: Are you in the right folder?
For more information, see 'https://go.microsoft.com/fwlink/?linkid=2109470'
Here is a picture of what I am seeing on my side:
I would assume I am not in the right folder but I am not sure if that is the problem completely.
Here is app I am testing myself. Its a microsoft authenication test app where you can test your xbox live account, microsoft school account, or microsoft work account against the webpage: https://github.com/Azure-Samples/ms-identity-python-django-tutorial
**Of course I added the app registration information from azure. Infact, the same app registration information works on my flask app so any azure app registrations issues is probably not the issue. **
The repo you link contains multiple projects. It sounds like you need to clone this, then move one of the project sub-directories (which should have its own requirements.txt already) into a fresh working tree, initialize a new repo there, and then push that to the cloud provider.

Deploying an app that can upload, create new files, and download created files

I am currently working on creating a flask app that can take uploaded files(.xslx), use them for analysis, and then redirect to a page with the output and a download button to download the output that they see.
The local version I have right now just stores these files in ./uploads/. It then uses the uploaded file as input for some analysis. To do this analysis it uses another file stored in ./analysis/ and the results of this analysis are then stored in ./results/.
Currently, this flask app works but to deploy it, as far as I know, I can no longer use ./uploads/ and ./results/ nor can expect for there to be ./analysis/.
While I have worked on a few flask apps as projects, I have never really had to worry about deploying them (since I'm a student and have mainly worked on personal projects.)
What is the best way to deploy this app? I was going to use Heroku since that's the only deployment platform I've used in the past to deploy a full stack application and I'm completely lost on how to deploy this app.

how to view/edit files uploaded to Azure webapp?

I got my first flask webapp (hello.py) working (deployed) on Azure. I want to add more functionality to this webapp. According to documentation I am following
(https://medium.com/#nikovrdoljak/deploy-your-flask-app-on-azure-in-3-easy-steps-b2fe388a589e)
I should test my files (hello.py, home.html etc) locally and use git push to send new files to Azure cloud. I should restart my application to see changes.
(1) Is there a way to edit these files on Azure cloud using say emacs ?
(2) Related to (1) on which path do these files exist on Azure ? I clicked on cloudshell and a terminal popped up. It is apparently my home directory. I can see only one directory (clouddrive). I cannot see hello.py. I also went to .scm.azurewebsites.net and clicked on bash. I do get a command prompt but cannot see hello.py.
Thanks.
Under Development Tools you should have App Service Editor (Preview)
If you click on that it should allow you to edit the files via the portal.

Can't find `FlaskWebProject` files in Azure set-up

I am trying to run through the creation of a Flask web app in Azure using this instruction page.
Creating Web apps with Flask in Azure
In the "Application Overveiw" section, it lists some FlaskWebProjectfiles saying.
Here's an overview of the files you'll find in the initial Git repository
\FlaskWebProject\__init__.py
\FlaskWebProject\views.py
\FlaskWebProject\static\content\
\FlaskWebProject\static\fonts\
\FlaskWebProject\static\scripts\
\FlaskWebProject\templates\about.html
\FlaskWebProject\templates\contact.html
\FlaskWebProject\templates\index.html
\FlaskWebProject\templates\layout.html
The problem is that I don't get these files when I connect up Azure to a Github repository. I know they exist because my Azure app renders the this default Flask webapp. The files exist in /wwwroot.
I am sure that I am missing something obvious here, so if anyone has followed the most recent Flask setup instruction for Azure, and had success, their input would be great.
Your initial GitHub repository is empty, so you need to clone the repository.
The process is described in the same article you mentioned, but a little later.
Basically:
1) Go to the deployment source and configure the deployment source - for example, local github
2) Go to Settings => Properties. Here you should have Git URL where your files are placed
3) Go to your workstation, and execute
git clone https://yourdeploymentusername#todeleteflask.scm.azurewebsites.net:443/todeleteflask.git
Enter password.
You should be all set now. Now, if you make change, you may push to the repository and it will arrive on the site.

How to set up auto-deploy to AppEngine when pushing to Git Repository

I've heard that other platforms support auto-deployment of their code to production when they push changes to their Git repository.
Can I set up something similar to this for AppEngine? How?
I'm using Python2.7 on Windows, and bitbucket as a repository.
Thanks!
Since app engine deploy is just a python script, why can't you just write a shell script that calls 'git push' followed by 'python appcfg.py deploy'?
Any bitbucket hooks that will send from bitbucket->appengine after you upload to app is probably a bad idea since it will require storing your app engine login credentials on github.
Other projects might have your app server pull from github/bitbucket. You can do this if your app engine site just serves static websites using http://drydrop.binaryage.com/, but you can't update actual running code this way.
Recently, App Engine added Push to Deploy features: https://developers.google.com/appengine/docs/push-to-deploy
It only has built in support for GitHub, but it might still be possible to configure BitBucket to work with it.

Categories

Resources