Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
I'm looking to deploy a django app on AWS (since I have some credit coupon) and am looking for a good place to read about it - mostly b/c I never used it before. thanks
looking for a good place to read about it
Here you go
I am a developer at BitNami, you may want to take a look at our free Django AMI. It is compatible with the AWS free tier.
2 new tutorials are given
realpython doc
and
Ashok Fernandez blog
The simplest approach is to simply spin up an EC2 instance, install nginx (mysql? and any other dependencies you might have) then follow the steps on the django site: https://code.djangoproject.com/wiki/DjangoAndNginx to deploying it. This basically goes through setting up a script to run "python [your app directory]/manage.py runfcgi host=127.0.0.1 port=8080" and setting up nginx to proxy requests to that port.
Another approach is to simply use a 3rd party tool like http://nudow.com to automate the deployment. For now the initial deployment I believe has to be done manually, however subsequent deployments can be done with one click. (and has other benefits like versioning)
I usually use Nginx on an EC2 instance
If you wish to deploy your Django app ASAP, without scratching your head :
You can use this script that I wrote:
Safely deploy your Django app in less 1 minute!
Instructions
Installing the DeployDjango script
$ wget https://raw.githubusercontent.com/yask123/DeployDjango/master/deploydjango.sh && chmod +x deploydjango.sh
From your Django App’s root directory (Where manage.py file exists).
$ sudo ./deploydjango.sh project_name
Done!
Visit http://ip-address-of-your-instance to see your web app live!
Related
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 2 years ago.
Improve this question
I have seen some pages with title deploy django with docker .
I deploy just with nginx & gunicorn and its awesome .
Is docker good for deploying django app ?
Does it make application faster or with better performance ?
So whats the main purpose ?
Docker helps developers bring their ideas to life by conquering the complexity of app development. It packages your Django app and creates a run time making sure that it works the same on all machines.
"But, It works on my system" - Developer without docker!
Also, you might be using nginx and gunicorn with Docker as well for hosting your django app. Containerization is a generic concept to have a machine independent run time to package everything. It simplifies your deployment process.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 4 years ago.
Improve this question
I have my blockchain network setup up on the IBM blockchain starter plan using the starter kit (https://github.com/sstone1/blockchain-starter-kit)
I'm trying to setup up GitHub passport authentication on my ibmblockchain/composer-rest-server but I cant install the passport-github package on my composer-rest server.
If I ssh into my server I don't have the permission to use npm as I'm the composer user and I don't know where to find the password to change to the root user.
I tried to install the npm package by adding 'npm install -g passport-github' in the deploy_composer_rest_server in the pipeline-DEPLOY.sh file in https://github.com/sstone1/blockchain-starter-kit/blob/master/.bluemix/pipeline-DEPLOY.sh but it still didn't work.
If I look at the logs of my ibmblockchain/composer-rest-server I keep getting the error:
Cannot find module 'passport-github'
Has anyone found a way to get around this or know how to install the 'passport-github' package on the ibmblockchain/composer-rest-server?
If you look at the Google OAuth tutorial in the composer documentation you will see a similar example of running a passport authentication strategy inside a composer-rest-server docker container. These are the specific lines used to build the new container and install the npm module:
FROM hyperledger/composer-rest-server
RUN npm install --production loopback-connector-mongodb passport-google-oauth2 && \
npm cache clean --force && \
ln -s node_modules .node_modules
If you have continuing problems, I would suggesting opening a ticket the IBM Cloud.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
Disclaimer: I am a newbie to web development.
I built a program using Python, on Django framework. I am at a point where I feel ready to deploy my site, and make it go live.
After extensive research, I've noticed that every possible path to deployment requires me to use Git.
The problem is that Git is so hard to manipulate on my computer. I have the wrong version (I guess) installed, and my attempts to fix compatibility issue has been a nightmare (Im using Mac 10.7.5, and for some reason cant upgrade to newer MAC El Captain)
My question is this: Is there a way to deploy WITHOUT using Git? Evenmore, is there a way to deploy without the use of version control (I'm the only one building this site).
I just want the easiest path to deployment possible, since I am a complete newbie.
PS Please dont direct me to this link: Is git branches necessary for a single developer?
my questions is about the importance of using Git altogether.
For some platforms, git is required for deployment. Heroku, in particular, requires git for pushing changes to a remote defined on the command heroku create. See here for more details.
In other instances, you have more options, with the caveat that you may spend a lot of time configuring a system to do so and that you may suffer from the inability to have continuous deployment without downtime.
For example, using an Amazon EC2 instance or DigitalOcean, you essentially have a bare-bones Ubuntu installation upon which you control pretty much all facets of configuration, you would be able to send files to your remote instance via SSH or using one of their clients. In this case, you would generally do the following:
Shut down your Django server
Backup your existing application and DB, just in case
Upload the files for your updated application
Run any manage.py commands for migrations and updates
pip install -r requirements.txt to check for updated dependencies
Start your server up again
As stated before, git is not required for deployment, but most Django devs would highly, highly suggest you find the root of the issue you are having with git as it helps to protect against potentially devastating problems down the line and can greatly simplify deployment when your production environment is set up correctly.
EDIT: It's worth noting that git can provide deployment functionality when your deployment environment is set up properly, but deployment often is too complex a task to rely on git alone. A commonly used method is to use Fabric with a custom fabfile to automate deployment tasks. In tandem with git you gain version control, simplified deployment commands, and the ability to run tasks as part of your deployment.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 7 years ago.
Improve this question
I am testing apache spark on my aws free tier account following this tutorial. However it creates 2 new instances (1x master and 1x slave) which means I wouldn't be able to run my machines for the whole month...
Question: Is there a way I can install apache spark on one single machine?
thanks
If you are just testing Spark you actually don't need to "install" spark. I do all my Spark development in a local VM running in local mode, but you can do the same thing in AWS with these steps:
Download Spark: http://spark.apache.org/downloads.html I typically go for the "Pre-built for Hadoop 2.6 and later" (don't worry, you don't need Hadoop whatsoever)
scp the tar to your machine, unpack somewhere like /opt or /usr/share
That's it!
You can run the spark shell:
/opt/spark-1.4.1-bin-hadoop2.6/bin/spark-shell
You can run packaged spark applications in local mode:
/opt/spark-1.4.1-bin-hadoop2.6/bin/spark-submit --master local[*] --class com.example.project.class project-1.0.jar
You can start Spark:
/opt/spark-1.4.1-bin-hadoop2.6/sbin/start-all.sh
And hit the Spark UI at port 8080
The solution was easy... follow the instructions to setup apache spark as a standalone server link
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
Is not efficient :).
I'm trying to learn django by building a simple app. I bought a hosting plan on webfaction, set up github account and a putty on my Windows machine. I'm writing the "code" on my Windows, pushing it to github repo, then connecting via putty to my webfaction account to pull from github.
This is extremely tedious and boring process and I can't help but wonder that I'm doing something wrong. Even fixing a simple typo takes a lot of time. Are developers writing everything server-side using vim? This sound even less encouraging. Can I do something to improve my workflow? How it's done by professionals?
To summarise Kit Sunde's answer: you shouldn't be deploying to the server until you've actually got a site to deploy. Normal development and testing is done locally, using manage.py runserver and a local db. This works fine on Windows.
You need to stop wasting your own time, which you are if you are editing code on the server. There are many reasons why you shouldn't deploy code that way the most important ones is that you'll waste time and also importantly is that you'll break things while users are looking at the site.
Setup a development server locally, this is why the django manage.py runserver exists. If you for some reason can't run it on windows, then install a server in virtualbox, mount the folder in windows where your code is and run it off that (this is what we do for our designers although we have a lot of dependencies).
There are IDE's out there that enables you to run Django via a GUI that you might find more comfortable, I use PyCharm and I hear good things about eclipse.
You'd save time if you learned how fabric worked so you can automate your deploy process. I am unsure how well fabric works on windows, but I'm sure you can use cygwin or similar to get it working.
A fairly basic example would be this one:
from fabric.api import *
env.hosts = ['ubuntu#example.org']
def deploy():
pid_file = "~/myproject/process.pid"
with cd('~/myproject/'):
run('git pull')
run('src/city_nomads/manage.py collectstatic --noinput')
# If the process isn't up we don't want the thing to exit.
with settings(warn_only=True):
run("cat {} | xargs kill -TERM".format(pid_file))
run("src/myproject/manage.py runfcgi "
"method=threaded "
"host=127.0.0.1 "
"port=8000 "
"pidfile={} "
"--settings=myproject.settings_release".format(pid_file))
It'll SSH into my server, pull the source, collectstatic, kill the process if it's there and then run django as fastcgi. I'm assuming you have nginx or apache set up to connect to Django on port 8000.