Skip to main content

Posts

Showing posts with the label tutorial

Running tasks with Celery on Heroku guide

An example project and a basic guide showing how to run Django/Celery on Heroku. Basic requirements First of all, let's actually set up a typical Django project for this. We would need virtualenvwrapper   for that. One could use any other particular method. I prefer this one. $ cd dev $ mkvirtualenv dch ( dch ) $ pip install django ( dch ) $ django-admin startproject djheroku ( dch ) $ cd djheroku # Make sure is working: ( dch ) $ ./manage.py runserver From now I will consider working on a terminal with this (dch) environment on. Heroku hosting setup We would need our project set up for heroku python server. The docs live HERE , as for moment of this guide writing. One would need to follow and setup a basic heroku project. I will not stop here rewriting official guide as it is good enough. Installing celery Assuming we have a basic django dyno at heroku here we will continue. Now let's install Celery and add it to our requirements list (as we had just sta...

Installing CouchDB for Mac OS X. Nuances.

Our project will have a new architecture changes in future. We've chosen from different tech. But now we 're experimenting with CouchDB a bit. It may become a part of our new architectural Changes. I'll try to cover most of newbies observations with CouchDB for Python(Django) programmer, planning to use it in your project. First article will be, unsurprisingly, installing CouchDB under Mac OS X. It, sure, has some inches that you need to scratch. So let's roll... CouchDB is not a simple SQL database like you used to install before. It has own server to accept connections. And, in fact, you can work with database from your browser GUI (without other server proxy, like Django or ...). Anyway it will not be our target. Building JS UI is quite easier with CouchDB and changes your logic dramatically. To build UI with Python we need some proxy parts. Anyway, again, CouchDB is a standalone server, that runs on your server's port and talks to your APP/Browser/wha...

Django: How and why to use migrations. Django-South.

Hi there guys and we're here to talk about migrations today. My app grown to complex app with profiles, social registration permits and so on. First time I've decided to make myself a simple app. Now it became complex enough and contains enough code to need code comments :). Anyway Migrations is a process anybody someday will need. I thought it's hard to learn or understand, but it's not. Main point is that you: - save your current database tables structure - change your model tables - scan for differences and create script - then write changes to your database with automatically generated python script. Sound's simple? I't not all so simple in fact. App that you need to learn is Django-south . Its main objectives are to provide a simple, stable and database-independent migration layer to prevent all the hassle schema changes over time bring to your Django applications. It has quite understandable tutorial here . So if you're tired of ALTER'in...