I have a .py file in a directory , which is inside the Django project folder.
I have email settings in my settings.py, but this .py file does not import that file.
How can I specify to Django that settings.py should be used , so that I can use EmailMessage class with the settings that are in my settings.py?
...
Hi I'm learning django and I did successfully start a site on Window XP by following the tutorial.
However, on Window 7 when I issued:
django-admin.py startproject mysite
python.exe was started and a window appeared to ask me to choose either python.exe or other program to open a file....
did I do anthing wrong or there are more tric...
Hi All,
I would like to create an online dictionary application by using python (or with django).
It will be similar to http://dictionary.reference.com/.
PS: the dictionary is not stored in a database. it's stored in a text file or gunzip file. Free english dictionary files can be downloaded from this URL: dicts.info/dictionaries.php...
Hi All,
My basic question is how to prevent spam and dirty words in a comment post system under python (django).
I have a collection of phrases (approximately 3000 phrases) to be blocked.
What I want to do is like this:
If I found a comment which has a dirty-word when user clicks the post button, then the web should popup a warnin...
I tried os.system, os.spwanl, etc.. but it doesn't work well
I need to execute some background process from django application.
...
Hi
I have this sample model working with the admin
class Author(models.Model):
name = models.CharField(_('Text in here'), max_length=100)
with verbose_name set as ugettext_lazy 'Text in here', but sometimes, depending on the site_id i want to present a diferent verbose name, so I modified the init in this way
def __init__(self, ...
Hi there,
I want to get data from 2 tables into a form using ModelForm, like this:
fist model:
class Cv(models.Model):
created_by = models.ForeignKey(User, blank=True)
first_name = models.CharField(('first name'), max_length=30, blank=True)
last_name = models.CharField(('last name'), max_length=30, blank=True)
url = mo...
I have a simple Blog model with a TextField.
What is the best way to save links in the TextField ?
1) Saving link in the database in this form: http://www.example.com
and then using some filter in the template to trasform it in form:
<a rel="nofollow" href="http://www.example.com>http://www.example.com</a>
2) Saving link in...
I need to throw ValidationError containing anchor.
if not profile.activated():
raise ValidationError('Your profile is not activated. <a href="{% url resend_activation_key %}">Resend activation key</a>.')
What I need to modify to make this work?
...
I am using Apache to authenticate users for Django, but I would like to do so without the popup form that Apache uses in its basic configuration.
How do I embed the login form within a page while still using Apache for authentication?
That is, I'd like a page that says "Please login" and provides a form asking for username and passwo...
Background
I'm working on an application which requires user-entered content, and I've decided to use a StackOverflow-style MarkDown editor. After researching this topic for the last few days, I realize there are numerous forks of the base WMD editor, some with a few basic enhancements and some with serious differences from the StackOve...
I have two models, authors and articles:
class Author(models.Model):
name = models.CharField('name', max_length=100)
class Article(models.Model)
title = models.CharField('title', max_length=100)
pubdate = models.DateTimeField('publication date')
authors = models.ManyToManyField(Author)
Now I want to select all authors...
I am building out a solr instance for django, but the example provided from solr is super verbose, with many things that are not relevant to haystack. A sample with spelling suggestions, morelikethis, and faceting, without the extra stuff that haystack doesn't use would go a long way to helping me understand what is needed and what isn't...
Hello,
I have a model like this:
class Entity(models.Model):
entity_name = models.CharField(max_length=100)
entity_id = models.CharField(max_length=30, primary_key=True)
entity_parent = models.CharField(max_length=100, null=True)
photo_id = models.CharField(max_length=100, null=True)
username = models.CharField(m...
In my view I return all posts of one blog:
posts = Post.objects.filter(blog=blog)
and pass it to context.
But.. How can I get the number of posts in the template ?
This is my template:
<h1>Number of posts: {{ ??? }} </h1>
{% for post in posts %}
{{ post.title }}
{{ post.body }}
{% endfor %}
...
I am working with some data over which I have little control. I'd like to return ONLY the fields of my model that aren't certain 'uninteresting' values (e.g. '0', 'X' or '-'), and access them individually in the template.
My model is like this:
class Manors(models.Model):
structidx = models.IntegerField(primary_key=True, verbose_n...
I cant seem to find a way to make django-dajaxice have its callback inside same scoped object from which made the initial call.
MyViewport = Ext.extend(MyViewportUi, {
initComponent: function() {
MyViewport.superclass.initComponent.call(this);
},
LoadRecordsCallback: function(data){
if(data!='DAJAXICE_EXCEPT...
I want to put a "location path" in my pages showing where the user is.
Supposing that the user is watching one product, it could be Index > Products > ProductName where each word is also a link to other pages.
I was thinking on passing to the template a variable with the path like [(_('Index'), 'index_url_name'), (_('Products'), 'produc...
I am currently learning PHP and want to learn about OOP.
I know Python is a well-organized and is all OOP, so would learning Python be a wise choose to learn OOP?
The thing is I am more towards web development then just general programming, and I know Python is just a general purpose language, but there is Django.
So how should I g...
I've got a setup based on the post here, and it works perfectly. Adding more languages to the mix, it recognises them fine, except for Korean (ko) and Hindi (hi). Chinese/Japanese/Hebrew are all fine, so nothing to do with encodings/charsets I don't think.
Taking a look into the django code inside the app-engine SDK, I notice that all t...