No idea why this error is popping up. Here are the models I created -
from django.db import models
from django.contrib.auth.models import User
class Shows(models.Model):
showid= models.CharField(max_length=10, unique=True, db_index=True)
name = models.CharField(max_length=256, db_index=True)
aka = models.CharField(max_le...
Hi all.
How can I send HTML emails with embedded images? How the HTML should link to the images? The images should be added as MultiPart email attach?
Any example is very appreciated.
...
Hi folks,
Sorry for some crazy subj.
I'd like to override django models save method and call some additional code if the model instance is newly created.
Sure I can use signals or check if the model have empty pk field and if yes, create temporary variable and later call a code:
Class EmailModel(models.Model):
email = models.Emai...
I want to use the django templating system to output csv like data which looks like;
!connection%block
!dosomething
!dosomethingelse
My,Header,Row,Which,Is,Comma,Seperated
All,My,Comma,Seperated,Data
All,My,Comma,Seperated,Data
All,My,Comma,Seperated,Data
All,My,Comma,Seperated,Data
!Footerblock
!that has footer information
The actual...
Hi all,
I am considering a 3rd part Authentication system for logging in (new/old) users. Much like how StackOverflow authenticates it's users. This scheme is good as it frees me from doing authentication from my side. I need this -
Login using Google, Facebook, Twitter, Yahoo, OpenID Authentication Systems.
Provide the same user logge...
I've made a template tag to display a login form on various pages of my site. The idea behind that is also, that after logging in you see the same page/content as before and you don't get redirected to another page.
I could do form validation & logging-in without any problems in the template-tag's render method, but the problem is, that...
I know there is 404 error handling in django.
But is it better to just put that config in nginx ?
This ST thread has the solution for putting it. -
http://stackoverflow.com/questions/1024199/nginx-customizing-404-page
Is that how everyone handles it when using nginx ?
I have created my own 404.html & 500.html in the sites theme, want ...
Hi there,
I have a model "Item", which has a 1:n to "Location". Means, there is a location-history for items.
Location has a FK to "Room", "Room" to "Floor" and "Floor" to "Building".
Now, I want to select all Items which are currently located an a specific Floor.
I could solve it with a list comprehension, but is there any nicer way ...
Hello guys,
I'm trying to do select a model using a relation with a generic foreign key, but it's not working as expected.
I think it's better illustrated and understandable with code
class ModelA(models.Model):
created = models.DateTimeField(auto_now_add=True)
class ModelB(models.Model):
instanceA = models.ForeignKey(ModelA)
cont...
Hi all...
*EDITED THIS QUESTION FOR CLARITY*
I have a Django template with a flash object in it. The template itself inherits from the main template and is in a block called info. Everything works ok with that!
When the flash object is clicked it calls a JavaScript callback function, with a parameter, in a separate js file. Within thi...
I have a very simple db.Model that contains a db.IntegerProperty and a db.TextProperty:
class Foo(db.Model):
shoe_size = db.IntegerProperty()
comments = db.TextProperty()
From this I created a very simple Django Form Object:
class FooForm(djangoforms.ModelForm):
shoe_size = forms.IntegerField(required=False)
comments ...
Our Django site is built using Mako templates. We want to use a third party project called django-socialregistration, but its template tags use Django's templates. If we used Django templates we could just
{% load facebook_tags %}
{% facebook_button %}
{% facebook_js %}
How can I do the same thing in Mako? You can inline strait up py...
I have multiple models on a Django-powered webpage that have a django.contrib.comments form rendered for each. On this page, a post from one of these forms to /comments/post/ always results in:
Forbidden (403)
CSRF verification failed. Request aborted.
If I include the same comment form code on another page where there is just one su...
I have a very simple test with jQuery and a django view:
HTML - Includes jQuery.js
JavaScript - $(document).ready( $.get("/index/" ); )
Django urls.py:
(r'^index/', index_view ),
Django views.py:
def index_view(request): if request.GET: return HttpResponse( "RECEIVED GET" )
Debugging in browser, the javascript gets called ...
My Django view generates a PDF via pycairo in response to a POST (I'm not redirecting in response to the POST). When I POST using desktop browsers I can save and/or view the PDF using Adobe Reader or Document Viewer. However, when I POST via my android browsers the Adobe PDF Reader and the ThinkFree viewers both report the file as corrup...
I want to read in real time the output of a subprocess called from a form in a view. Here is my views.py:
@login_required
@condition(etag_func=None)
def sync_form(request):
# do things to validate form
return HttpResponse(sync_job(request, job_id, src, dest))
def sync_job(request, job_id, src, dest):
# we check the argument...
I'm using dcramer's fork of django-paypal and I've been successful in setting it up until now. I tried to connect 'paypal.pro.signals.payment_was_successful' to a listener I wrote but it sends the signal multiple times which is causing errors in my application. I've tried adding the 'dispatch_uid' to my connect statement but it still sen...
I can't get my site running with south. I've successfully installed south, and I can 'import south' successfully.
./manage.py shell
>>> import south
>>>
However, once I add 'south' to INSTALLED_APPS, and run ./manage.py syncdb (to complete the installation), I get the following error:
There is no South database module 'south.db.d...
I'm trying to install django lfc on my server. Apart of zilions of different problems I've encountered now I'm struggling with TemplateDoesNotExist.
In my settings file I have set TEMPLATE_DIRS variable like this :
TEMPLATE_DIRS = (
"/home/snow4life/lfc/templates",
"/home/snow4life/lfc_theme/templates"
...
What are the best practices and solutions for managing dynamic subdomains in different technologies and frameworks? I am searching for something to implement in my Django project but those solutions that I saw, don't work. I also tried to use Apache rewrite mod to send requests from subdomain.domain.com to domain.com/subdomain but couldn...