Re: Django formset hidden id field

2015-07-04 Thread Javier Guerra Giraldez
On Sat, Jul 4, 2015 at 1:42 AM, Peter of the Norse
 wrote:
> You can’t have it both ways. Either exposing the PK is a security flaw or it 
> isn’t. It’s just as easy for nefarious n’er-do-wells to edit the form’s URL 
> as a hidden field. In either case, if you are using object-level permissions, 
> more checks (not made automatic in Django) are necessary. Having the ID 
> passed as a parameter doesn’t necessitate, hinder, or alleviate running these 
> checks.


the easiest way to make forget PKs a non-issue is to never do things like:

myobj = MyModel.objects.get(pk=pk)

instead, do things like:

myobj = get_object_or_404(request.user.accessible_obj_set, pk=pk)

where the 'accessible_obj_set' is either a reverse foreign key, or
some method that returns a queryset with apropriate filters to return
only the rows that a given user can access.



> If you can come up with a method that associates form data with a database 
> row that doesn’t involve the PK, I would love to know. Keep in mind that most 
> tables only have the one unique identifier.

there are many fans of using UUIDs as primary key.  myself, i use them
for any user-visible record when there might be several instances of
the same code.  this way i can merge or split datasets without
changing user-visible references.


-- 
Javier

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFkDaoTHDBgK2v5Po09cShjQt7VoipA50BcoqawP6MymMmk1uQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Installing Django and Python 3.4 on a freshly registered Debian VPS

2015-07-04 Thread Christian Kleineidam
I want to install Django and Python 3.4 on a freshly registered Debian 
server.
What are the steps I have to take given that I want to use Python 3.4 and 
not the debian default of 2.7?
I expect I also need to install Apache, is that right?

Can you point me to a good tutorial that explains all the details of this 
process?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/9c4a8203-42cd-4d38-acbc-757f951fc9e5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Error :- Debuge= True

2015-07-04 Thread Wanare Piyush 13MCC1056
 

I am getting this error :-

 You're seeing this error because you 
have DEBUG = True in your Django settings file. Change that to False, and 
Django will display a standard 404 page. 


My views.py file:-

from django.http import HttpResponse
import datetime
from django.template import Template, Context
from django.template.loader import get_template
from django.http import Http404  

tasks = [
{
'id': 1,
'title': u'Buy groceries',
'description': u'Milk, Cheese, Pizza, Fruit, Tylenol', 
'done': False
},
{
'id': 2,
'title': u'Learn Python',
'description': u'Need to find a good Python tutorial on the web', 
'done': False
}
 ]

#task_id=='1'
def api(self,task_id):
#task=[task if task['id']=='task_id' for task in tasks ]
task = [task for task in tasks if task['id'] == task_id]
if len(task) == 0:
raise Http404
return HttpResponse(tasks)

 My urls.py file:-


"""Dj1 URL Configuration

The `urlpatterns` list routes URLs to views. For more information please 
see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import:  from my_app import views
2. Add a URL to urlpatterns:  url(r'^$', views.home, name='home')
Class-based views
1. Add an import:  from other_app.views import Home
2. Add a URL to urlpatterns:  url(r'^$', Home.as_view(), name='home')
Including another URLconf
1. Add an import:  from blog import urls as blog_urls
2. Add a URL to urlpatterns:  url(r'^blog/', include(blog_urls))
"""
from django.conf.urls import include, url
from django.contrib import admin
#from App1.views import place_order_form
from App1.views import api

urlpatterns = [
#url(r'^admin/', include(admin.site.urls)),
url(r'^api/(\d{1,2})/$',api),
#url(r'^place_order/$',place_order_form),
]

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/9360a7da-f472-4840-9a6b-b71b9c0b5990%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Error :- Debuge= True

2015-07-04 Thread monoBOT
what error?

2015-07-04 8:05 GMT+01:00 Wanare Piyush 13MCC1056 <
piyush.subhashrao2...@vit.ac.in>:

>  I am getting this error :-
>
>  You're seeing this error because you
> have DEBUG = True in your Django settings file. Change that to False, and
> Django will display a standard 404 page.
>
>
> My views.py file:-
>
> from django.http import HttpResponse
> import datetime
> from django.template import Template, Context
> from django.template.loader import get_template
> from django.http import Http404
>
> tasks = [
> {
> 'id': 1,
> 'title': u'Buy groceries',
> 'description': u'Milk, Cheese, Pizza, Fruit, Tylenol',
> 'done': False
> },
> {
> 'id': 2,
> 'title': u'Learn Python',
> 'description': u'Need to find a good Python tutorial on the web',
> 'done': False
> }
>  ]
>
> #task_id=='1'
> def api(self,task_id):
> #task=[task if task['id']=='task_id' for task in tasks ]
> task = [task for task in tasks if task['id'] == task_id]
> if len(task) == 0:
> raise Http404
> return HttpResponse(tasks)
>
>  My urls.py file:-
>
>
> """Dj1 URL Configuration
>
> The `urlpatterns` list routes URLs to views. For more information please
> see:
> https://docs.djangoproject.com/en/1.8/topics/http/urls/
> Examples:
> Function views
> 1. Add an import:  from my_app import views
> 2. Add a URL to urlpatterns:  url(r'^$', views.home, name='home')
> Class-based views
> 1. Add an import:  from other_app.views import Home
> 2. Add a URL to urlpatterns:  url(r'^$', Home.as_view(), name='home')
> Including another URLconf
> 1. Add an import:  from blog import urls as blog_urls
> 2. Add a URL to urlpatterns:  url(r'^blog/', include(blog_urls))
> """
> from django.conf.urls import include, url
> from django.contrib import admin
> #from App1.views import place_order_form
> from App1.views import api
>
> urlpatterns = [
> #url(r'^admin/', include(admin.site.urls)),
> url(r'^api/(\d{1,2})/$',api),
> #url(r'^place_order/$',place_order_form),
> ]
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/9360a7da-f472-4840-9a6b-b71b9c0b5990%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
*monoBOT*
Visite mi sitio(Visit my site): monobotsoft.es/blog/

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CA%2BxOsGCJEptTGyDdbP3hrZQ%3DkrafDTozUH7_e7CfNKc2fmnMqg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Error :- Debuge= True

2015-07-04 Thread Bradford Wade
Happy to assist—a few notes/questions up-front:

   - It's much easier to troubleshoot if you provide the full stack-trace, 
   as is. It helps answer questions like
  - Which URL were you requesting that ultimately gave you this 404?
  - Which URL patterns were "tried" or were regex-compared to the reqest
   - It looks like you're trying to capture task_id from the url (e.g. "
   api/1/" -> task_id = 1). You should use captured_parameters 
   
for
 
   this (i.e. "url(r'^(?P\d{1,2})/$', api)")
   - Review the Django docs for how views are defined 
   ; Instead of 
(self, 
   task_id) as your api view arguments you probably meant (request, 
   task_id). 
   - Note that '$' ends a regular expression, so calls like "api/1/detail/" 
   will 404.
   - Your regex is requiring a closing slash on the url, which is okay for 
   the most part, but "api/1" will not work if you've modified the APPEND_SLASH 
   setting 
   .


On Saturday, July 4, 2015 at 8:41:31 AM UTC-4, Wanare Piyush 13MCC1056 
wrote:
>
>  I am getting this error :-
>
>  You're seeing this error because you 
> have DEBUG = True in your Django settings file. Change that to False, and 
> Django will display a standard 404 page. 
>
>
> My views.py file:-
>
> from django.http import HttpResponse
> import datetime
> from django.template import Template, Context
> from django.template.loader import get_template
> from django.http import Http404  
>
> tasks = [
> {
> 'id': 1,
> 'title': u'Buy groceries',
> 'description': u'Milk, Cheese, Pizza, Fruit, Tylenol', 
> 'done': False
> },
> {
> 'id': 2,
> 'title': u'Learn Python',
> 'description': u'Need to find a good Python tutorial on the web', 
> 'done': False
> }
>  ]
>
> #task_id=='1'
> def api(self,task_id):
> #task=[task if task['id']=='task_id' for task in tasks ]
> task = [task for task in tasks if task['id'] == task_id]
> if len(task) == 0:
> raise Http404
> return HttpResponse(tasks)
>
>  My urls.py file:-
>
>
> """Dj1 URL Configuration
>
> The `urlpatterns` list routes URLs to views. For more information please 
> see:
> https://docs.djangoproject.com/en/1.8/topics/http/urls/
> Examples:
> Function views
> 1. Add an import:  from my_app import views
> 2. Add a URL to urlpatterns:  url(r'^$', views.home, name='home')
> Class-based views
> 1. Add an import:  from other_app.views import Home
> 2. Add a URL to urlpatterns:  url(r'^$', Home.as_view(), name='home')
> Including another URLconf
> 1. Add an import:  from blog import urls as blog_urls
> 2. Add a URL to urlpatterns:  url(r'^blog/', include(blog_urls))
> """
> from django.conf.urls import include, url
> from django.contrib import admin
> #from App1.views import place_order_form
> from App1.views import api
>
> urlpatterns = [
> #url(r'^admin/', include(admin.site.urls)),
> url(r'^api/(\d{1,2})/$',api),
> #url(r'^place_order/$',place_order_form),
> ]
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/ceef26d3-de7d-45c1-b77e-b911b32a147b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How to restrict update of a record to the record owner in Django REST?

2015-07-04 Thread Daniel Grace
I want to restrict update of a record to the record owner in an 
UpdateAPIView with Django REST, but I don't know how to code the method.

For example, something like this:

from rest_framework import generics
from testapp.serializers import UserProfileSerializer
from rest_framework.renderers import JSONRenderer
from rest_framework.response import Response
from rest_framework.views import APIView
from rest_framework import permissions
from oauth2_provider.ext.rest_framework import TokenHasReadWriteScope

class UserProfileView(generics.UpdateAPIView):
permission_classes = [permissions.IsAuthenticated, 
TokenHasReadWriteScope]
serializer_class = UserProfileSerializer
queryset = UserProfile.objects.all()
# patch method?
# if UserProfile user != self.request.user:
# raise exceptions.PermissionDenied
# else:
# continue as normal

Where "user" is a field on the UserProfile model.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/61d98fdd-c40d-4ec4-9914-9e505ecc8f54%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Installing Django and Python 3.4 on a freshly registered Debian VPS

2015-07-04 Thread Andreas Kuhne
2015-07-04 14:19 GMT+02:00 Christian Kleineidam <
christian.kleinei...@gmail.com>:

> I want to install Django and Python 3.4 on a freshly registered Debian
> server.
> What are the steps I have to take given that I want to use Python 3.4 and
> not the debian default of 2.7?
> I expect I also need to install Apache, is that right?
>
> Can you point me to a good tutorial that explains all the details of this
> process?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/9c4a8203-42cd-4d38-acbc-757f951fc9e5%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>


Hi,

Just searching the net I found:
http://www.extellisys.com/articles/python-on-debian-wheezy . It has
information about how to install python 3.4 on debian. However I haven't
used Debian myself (we use ubuntu on our production servers), so I can't
verify if it's completely correct. Looks ok though. If possible switch to
an ubuntu server instead, because then you will get python 3.4 as standard.

Regarding apache, I would probably choose nginx instead because it should
be faster.

Regards,

Andréas

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CALXYUbnJ%3Dhs%2BWCviBq9orFMnAPYZ%2B5v8SK9XwSdqNnVAvzWGXg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


noob in Django

2015-07-04 Thread Roberth Solis Martínez
¡Hello guys!

sorry it is not a question, i am new in python and Django :)

I just want to introduce myself, and share more of this framework


  

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/e4c50363-463f-4aef-b747-2a97b9f6267d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Post - Deploy project Django-Nginx,gunicorn,virtualenv and supervisor

2015-07-04 Thread Roberth Solis Martínez
Hi guys in this post i can learn, how to deploy app in server with django 
:), and i share it with us !


http://michal.karzynski.pl/blog/2013/06/09/django-nginx-gunicorn-virtualenv-supervisor/

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/eba3eb4d-2a09-4d71-98e4-bb64c08a840f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to restrict update of a record to the record owner in Django REST?

2015-07-04 Thread Daniel Grace
I found a solution based on the example in REST API guide:
http://www.django-rest-framework.org/api-guide/permissions/#examples

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/ad0235e4-87d9-450e-be7e-44b965b65e13%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Not getting static files with django & heroku deployment

2015-07-04 Thread Martin Torre Castro
Hello,

I'm developing a webapp with Django 1.7 (project_name is "sonata") and the 
project layout from the "Two scoops of Django 1.6", so I have a 3-tier 
basic folder tree.

.├── requirements└── sonata
├── person
│   └── templatetags
├── registration
├── sonata
│   └── settings
├── static
│   ├── css
│   │   └── images
│   ├── fonts
│   └── js
├── templates
│   ├── personApp
│   └── registrationApp
└── utils
└── templatetags


I have a problem when deploying on Heroku. I have achieved the deployment, 
but the static files are not being served to the browser.

I know I should force some way of serving the static files through the 
settings and have googled about. I've seen many ways and read about using 
Amazon services, but I'm looking for the easiest one, which will make the 
future production deployment easy as well with gUnicorn (I hope).

I tried modifying the settings file (which is the heroku.py one, which 
overrides the base.py) and changing values for STATIC_ROOT, 
STATICFILES_DIRS and adding the line:

*urlpatterns += static(settings.MEDIA_URL, 
document_root=settings.STATIC_ROOT)*

I've tried as well running:

*heroku run sonata/manage.py collectstatic*

before doing 

*git push heroku master*

but nothing happens, even checking with 

*heroku run ls sonata/assets *

that the files are being copied.

Please, I would like some orientation for really understanding what I'm 
doing wrong and mending it. 

When finding out about heroku and deployment I met also some sample 
ProcFiles which used a project_name.wsgi file and I don't know anything 
about it.

I could use use some help, because the more webs I read, the more confused 
I get. Please assume I know very little about deployments. A link would be 
useful, but it has to show newbie's material :-(

Thank you very much on advance.


### *ProcFile* 
##
web: python sonata/manage.py runserver 0.0.0.0:$PORT --noreload




### *heroku.py* 
##
# -*- coding: utf-8 -*-
"""Heroku settings and globals."""

from __future__ import absolute_import

from .base import *

from os import environ

# TODO Warning! Heroku retrieve values as strings
# TODO we should check (only for Heroku) that 'True' and 'False' are 
respectively True and False 0, 
# or the equivalent ones, True and False
def get_env_setting(setting):
""" Gets the environment variable or an Exception.
This can be used, for example, for getting the SECRET_KEY and not 
having it hardcoded in the source code 
Also for setting the active settings file for local development, 
heroku, production server, etc... """
try:
return environ[setting]
except KeyError:
error_msg = "Set the %s env variable" % setting
raise ImproperlyConfigured(error_msg)

## HOST CONFIGURATION
# See: 
https://docs.djangoproject.com/en/1.5/releases/1.5/#allowed-hosts-required-in-production
ALLOWED_HOSTS = ['*']
## END HOST CONFIGURATION

## EMAIL CONFIGURATION
# See: https://docs.djangoproject.com/en/dev/ref/settings/#email-backend
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'

# See: https://docs.djangoproject.com/en/dev/ref/settings/#email-host
EMAIL_HOST = environ.get('EMAIL_HOST', 'smtp.gmail.com')

# See: 
https://docs.djangoproject.com/en/dev/ref/settings/#email-host-password
EMAIL_HOST_PASSWORD = environ.get('EMAIL_HOST_PASSWORD', '')

# See: 
https://docs.djangoproject.com/en/dev/ref/settings/#email-host-user
EMAIL_HOST_USER = environ.get('EMAIL_HOST_USER', 
'your_em...@example.com')

# See: https://docs.djangoproject.com/en/dev/ref/settings/#email-port
EMAIL_PORT = environ.get('EMAIL_PORT', 587)

# See: 
https://docs.djangoproject.com/en/dev/ref/settings/#email-subject-prefix
EMAIL_SUBJECT_PREFIX = '[%s] ' % SITE_NAME

# See: https://docs.djangoproject.com/en/dev/ref/settings/#email-use-tls
EMAIL_USE_TLS = True

# See: https://docs.djangoproject.com/en/dev/ref/settings/#server-email
SERVER_EMAIL = EMAIL_HOST_USER
## END EMAIL CONFIGURATION

## DATABASE CONFIGURATION
import dj_database_url
DATABASES['default'] = dj_database_url.config()
# DATABASES = {}
## END DATABASE CONFIGURATION


## CACHE CONFIGURATION
# See: https://docs.djangoproject.com/en/dev/ref/settings/#caches
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
}
}
## END CACHE CONFIGURATION


## SECRET CONFIGURATION
# See: https://docs.djangoproject.com/en/dev/ref/settin

Re: Not getting static files with django & heroku deployment

2015-07-04 Thread Malik Rumi
Hi Martin,

First let me say unapologetically that I love PyDanny and his work and 
contributions to the Django community, especially Two Scoops. However, you 
should know that the philosophy he espouses there is very different from 
the one Heroku espouses. I've been told he talks about that somewhere, but 
I've never seen it personally. 

I won't go into too much detail, but you can read about it here: 
https://devcenter.heroku.com/articles/architecting-apps

What you need more than anything is the Heroku Django template :  
https://devcenter.heroku.com/articles/django-app-configuration

Try that first. Follow the directions carefully, then let us know if you 
still need help. 


On Saturday, July 4, 2015 at 7:13:39 PM UTC-5, Martin Torre Castro wrote:
>
> Hello,
>
> I'm developing a webapp with Django 1.7 (project_name is "sonata") and the 
> project layout from the "Two scoops of Django 1.6", so I have a 3-tier 
> basic folder tree.
>
> .├── requirements└── sonata
> ├── person
> │   └── templatetags
> ├── registration
> ├── sonata
> │   └── settings
> ├── static
> │   ├── css
> │   │   └── images
> │   ├── fonts
> │   └── js
> ├── templates
> │   ├── personApp
> │   └── registrationApp
> └── utils
> └── templatetags
>
>
> I have a problem when deploying on Heroku. I have achieved the deployment, 
> but the static files are not being served to the browser.
>
> I know I should force some way of serving the static files through the 
> settings and have googled about. I've seen many ways and read about using 
> Amazon services, but I'm looking for the easiest one, which will make the 
> future production deployment easy as well with gUnicorn (I hope).
>
> I tried modifying the settings file (which is the heroku.py one, which 
> overrides the base.py) and changing values for STATIC_ROOT, 
> STATICFILES_DIRS and adding the line:
>
> *urlpatterns += static(settings.MEDIA_URL, 
> document_root=settings.STATIC_ROOT)*
> 
> I've tried as well running:
>
> *heroku run sonata/manage.py collectstatic*
> 
> before doing 
>
> *git push heroku master*
>
> but nothing happens, even checking with 
>
> *heroku run ls sonata/assets *
>
> that the files are being copied.
>
> Please, I would like some orientation for really understanding what I'm 
> doing wrong and mending it. 
>
> When finding out about heroku and deployment I met also some sample 
> ProcFiles which used a project_name.wsgi file and I don't know anything 
> about it.
>
> I could use use some help, because the more webs I read, the more confused 
> I get. Please assume I know very little about deployments. A link would be 
> useful, but it has to show newbie's material :-(
>
> Thank you very much on advance.
>
>
> ### *ProcFile* 
> ##
> web: python sonata/manage.py runserver 0.0.0.0:$PORT --noreload
>
>
>
>
> ### *heroku.py* 
> ##
> # -*- coding: utf-8 -*-
> """Heroku settings and globals."""
> 
> from __future__ import absolute_import
> 
> from .base import *
> 
> from os import environ
> 
> # TODO Warning! Heroku retrieve values as strings
> # TODO we should check (only for Heroku) that 'True' and 'False' are 
> respectively True and False 0, 
> # or the equivalent ones, True and False
> def get_env_setting(setting):
> """ Gets the environment variable or an Exception.
> This can be used, for example, for getting the SECRET_KEY and not 
> having it hardcoded in the source code 
> Also for setting the active settings file for local development, 
> heroku, production server, etc... """
> try:
> return environ[setting]
> except KeyError:
> error_msg = "Set the %s env variable" % setting
> raise ImproperlyConfigured(error_msg)
> 
> ## HOST CONFIGURATION
> # See: 
> https://docs.djangoproject.com/en/1.5/releases/1.5/#allowed-hosts-required-in-production
> ALLOWED_HOSTS = ['*']
> ## END HOST CONFIGURATION
> 
> ## EMAIL CONFIGURATION
> # See: 
> https://docs.djangoproject.com/en/dev/ref/settings/#email-backend
> EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
> 
> # See: https://docs.djangoproject.com/en/dev/ref/settings/#email-host
> EMAIL_HOST = environ.get('EMAIL_HOST', 'smtp.gmail.com')
> 
> # See: 
> https://docs.djangoproject.com/en/dev/ref/settings/#email-host-password
> EMAIL_HOST_PASSWORD = environ.get('EMAIL_HOST_PASSWORD', '')
> 
> # See: 
> https://docs.djangoproject.com/en/dev/ref/settings/#email-host-user
> EMAIL_HOST_USER = environ.get('EMAIL_HOST_USER', 'your_...@example.com 
> ')
> 
> # See: https://docs.djangoproject.com/en/dev/ref/settings/#email-port
> EMAIL_PORT = e