How can I configure werker to handle postgis with django - django

I've just setup wercker for python3.4, it seems good - but I am not sure how I should get it to install/configure postgis and django.
There is some information related: http://blog.wercker.com/2013/11/18/django-16.html and https://github.com/wercker/wercker-django-example/blob/master/wercker.yml - but it seems rather outdated.

The docs you refer to are of the "old" wercker. They've transitioned to a Docker based build system now, which is the recommended way to go.
The new (docker based) documentation can be found here.
So basically all you need to do is build using a docker image that already contains Django and Postgis. This one might work.

Related

Is there an in-memory SNS?

im currently looking for a framework that provides a Rest-Api of a SNS and runs in-memory. That means no docker containers which sadly dont let me use localstack. I already searched everything and only find two old projects that are not usable because of security reasons.
What i found and can't use:
https://github.com/gilbertojrequena/bonsai-sns - to old and clashes with log4j
https://github.com/daflockinger/unitstack - to old has many vulnerabilities
Localstack - Runs in Docker and i need a non Docker alternative

Apache airflow vs puckle airflow image

I am currently using puckel airflow but now the apache airflow image is also available.
Which one is better and reliable. And given I need to start from scratch, which option would be better?
Official. Puckel is no longer updated
I started with puckel airlfow but as Javier mentioned its no longer updated. Last updated version was 1.10.9. Its easier to start with this image and following updates and mimicking required behaviours from official docker image you can build on it.

Do I need GeoServer (or alikes) to provide shape files in a web app?

I am attempting to develop a web app with docker. I have tried to look around and have been confused with the essential components of making one. Please bear me if you see my question naive. This is my first attempt.
I would love to use docker - to make it light weight. I have Postgres/PostGIS as data storage.
The question is - I am not going to provide geotiff files (no raster layers), but only shape files that people can download to make their own desk-top version maps. I am also not going to provide maps (so no need to have open layers and such). Do I need GeoServer? Would GeoDjango and PostGIS in a docker environment work well enough?
Thank you for your help.
Geoserver is (as the name implies) a server to share geospatial data.
Essentially you want to serve shapefiles stored in your application's database so GeoDjango can handle that and you will need to provide the appropriate views to access these data.
You can do the same by deploying a dockerized instance of a Geoserver (there are some ready-made docker images for that) to serve your data, but since you will only serve shapefiles without any processing made on them (and you don't need to server rasters) this may be an overkill.

How to work with a local development server and deploy to a production server in django?

I want to work locally on my django(1.7) project and regularly deploy updates to a production server. How would you do this? I have not found anything about this in the docs. I am confused about that because it seems like many people would want to do that and there should be some kind of standard solution to this. Or am I getting the whole workflow wrong?
I should note that I'm not expecting a step-by-step guide. I am just trying to understand the concept.
Assuming you already have your deployment server setup, and all you need to do is push code to your server, then you can just use git as a form of deployment.
Digital Ocean has a good tutorial at this link https://www.digitalocean.com/community/tutorials/how-to-set-up-automatic-deployment-with-git-with-a-vps
Push sources to a git repository from a dev machine.
pull sources on a production server. Restart uwsgi/whatever.
There is no standard way of doing this, so no, it cannot be included with Django or be thoroughly described in the docs.
If you're using a PaaS how you deploy depends on the PaaS. Ditto for a container like docker, you must follow the rules of that particular container.
If you're old-school and can ssh into a server you can rsync a snapshot of the code to the correct place after everything else is taken care of: database, ports, webserver setup etc. That's what I do, and I control stuff with bash scripts utilizing a makefile.
REMOETHOST=user#yourbox
REMOTEPATH=yourpath
REMOTE=$REMOTEHOST:$REMOTEPATH
make rsync REMOTE_URI=$REMOTE
ssh $REMOTEHOST make -C $REMOTEPATH deploy
My "deploy"-action is a monster but might be as easy as something that touches the wsgi-file used in order to reload the site. My medium complex ones cleans out stale files, run collectstatic and then reloads the site. The really complex ones creates a timestamped virtualenv, cloned database and remote code tree, a new server-setup that points to this, runs connection tests on the remote and if they succeed, switches the main site to point to the new versioned site, then emails me the version that is now in production, with the git hash and timestamp.
Lots of good solutions. Heroku has a good tutorial: https://devcenter.heroku.com/articles/getting-started-with-django
Check out a general guide for deploying to multiple PaaS providers here: http://www.paascheatsheet.com

Deploying Django on EC2

I'm having a django project that should be deployed on Amazon's EC2. There are various tutorials on installing django on EC2, but I think it'll always be a time consuming step to generate a new AMI image with your whole application... So I was thinking that it should also be possible to deploy it on the persistent storage, EBS?
But I'm wondering if that would have any disadvantages because there are no tutorials describing that out there... So if anybody is having some ideas on that or having any other tutorials on how to deploy new versions in an easy fast way to EC2 please let me know!
I used Bitnami Djangostack 1.2.3 (I'm not associated with bitnami in any way).
http://bitnami.org/stack/djangostack
The EC2 image is "ami-18fb0f71", described as "bitnami-djangostack-1.2.3-0-linux-ubuntu-10.04-ebs".
This is an EBS backed instance, but I can't comment on advantages/disadvantages of this.
I found some of the pertinent configuration files in these locations:
/opt/bitnami/apache2/conf/httpd.conf
/opt/bitnami/apps/django/conf/django.conf
The file served by default (as configured in httpd.conf) is '/opt/bitnami/apache2/htdocs/index.html'.
You can get a bit of support here:
http://bitnami.org/forums/forums/djangostack
I think it should be fine. At the least, you can experiment: get an EBS-backed instance, install django, stop the instance (not terminate!) and snapshot the volume (for backup).
Restart the instance, and see.