One of the great features of Django is that you can open a python interpreter set-up for use with your project. This can be used to analyse objects in a database and allows any python commands to be executed on your project. I find it essential for Django development. It is invoked in the project directory using this command:
$ python m...
Hello,
I've searched a lot but I still have a problem with the static files (css, image,...) with my django website.
I'm using mod_wsgi with apache on archlinux 64bits
I've added it in my http.conf :
LoadModule wsgi_module modules/mod_wsgi.so
<VirtualHost *:80>
WSGIDaemonProcess mart.localhost user=mart group=users processes=2 ...
I have a newbie question about developing interactive, dynamic web sites. Can someone explain concisely the differences between:
Django
Ruby on Rails
Google App Engine
CGI scripts/apps
whatever else is or seems similar (PHP?, Java Servlets?, TurboGears?, etc.)
When would I prefer, say, the Google App Engine over Django, etc.? If I wa...
Let's say I have the following Django models with these ForeignKey fields (simplified syntax):
class Container(Model):
items -> Item
sub_items -> SubItem
sub_sub_items -> SubSubItem
class Item(Model):
container -> Container
children -> SubItem
class SubItem(Model):
container -> Container
parent -> Item
...
Is it possible to develop multi-client web-based CRUD applications (with Django, Ruby on Rails, etc.) on a server on which you don't have root access?
Our machines at school, on which I have a regular account, run a web server, and I can publish regular HTML pages and CGI scripts. How easy/difficult/impossible would it be to install Dja...
urls.py
url(r'^accounts/register/$',register,
{'form_class':RegForm},name='registration_register'),
form.py
from registration.forms import *
class RegForm(RegistrationForm):
"""
"""
fullname = forms.RegexField(regex=r'^\w+$',
max_length=30,
widget=f...
I have a Django server which handles requests to a URL which will return some HTML for use in an image gallery. I can navigate to the URL and the browser will display the HTML that is returned, but I can't get that same HTML by doing an AJAX call (using jQuery) to the same URL.
This is the view that generates the response:
def gallery_...
I implemented a simple sitemap class using django's default sitemap app. As it was taking a long time to execute, I added manual caching:
class ShortReviewsSitemap(Sitemap):
changefreq = "hourly"
priority = 0.7
def items(self):
# try to retrieve from cache
result = get_cache(CACHE_SITEMAP_SHORT_REVIEWS, "sit...
Here is the situation. I have a django project with two installed apps. Both apps appear to function properly if they are installed independently of each other.
However if I list both apps in the settings.INSTALLED_APPS the reverse() function seems to break for urls in the first app. So this leads me to believe that a bug in the seco...
I Have to tables
class Book(models.Model):
title = models.CharField(max_length=200)
authors = models.ManyToManyField(Individual, related_name="author_for", blank=True, null=True)
illustrators = models.ManyToManyField(Individual, related_name="illustrator_for", blank=True, null=True)
class Unitary_Sale(models.Model):...
I'm working with a django form, and I have a choice field. I think the problem may be that the choices are fetched dynamically, and right now there's only one value. I'm getting the TemplateSyntaxError: too many values to unpack. Some of the other posts seem to say that having only one value is a problem, so i adjusted my function that f...
from django import template
register = template.Library()
class_converter = {
"textinput":"textinput textInput",
"fileinput":"fileinput fileUpload"
}
@register.filter#<--------
def is_checkbox(field):
return field.field.widget.__class__.__name__.lower() == "checkboxinput"
@register.filter#<--------
def with_class(field):
...
I have a pretty simple file upload form class in django:
class UploadFileForm(forms.Form):
category = forms.ChoiceField(get_category_list())
file = forms.FileField()
one problem is that when i do {{ form.as_p }}, It has no submit button. How do i add one?
...
Django is incompatible with Python 3:
For larger Python-based software like
Django, the transition is expected to
take at least a year or two (since it
involves dropping support for older
Python releases and so must be done
gradually).
Which other web framework is recommended for Python 3.1?
Thanks
...
I have a models class class A(models.Model): user = models.ForeignKey(User)
Now if I do a a = A.objects.get(pk = something_existing); print a.__dict__, user is not in __dict__. a.user however doesnot give an attribute error.
So when is the actual user being calculated? I looked in django.db.models.base.Model and django.db.models.base.M...
Hi,
I'm trying to implement signals from Django (http://docs.djangoproject.com/en/dev/topics/signals/), or its concept in C# to reduce/eliminate coupling/method dependencies.
So far, I'm replicating the code fine, up until the point whereby I realised methods ain't objects in C# as it is in Python. Then I thought of pointers, and then ...
How can I turn off Django's automatic HTML escaping, when I write into model's TextField?
...
I am developing a Django web application with a suite of steel design tools for structural engineers. There will be a database table of inputs for each design tool, and each row of each table will correspond to a particular design condition to be "solved." The users may work solely or in groups. Each user needs to have ongoing access to ...
Is there an elegant way to take the phpbb user table from the version 2 series, and import the users into my django auth_users table?
I'm looking to outright dumb the old table completely, but don't want to lose the users.
I'm aware that the password column is just a md5 hash of the user's password, but inserting the user with md5$$us...
Hello,
I'm trying to do connect form on my django website
If in a shell I do :
$ ./manage.py shell
Python 2.6.4 (r264:75706, Oct 27 2009, 06:25:13)
[GCC 4.4.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> from django.contrib import auth
>>> user = auth.authenticate(username...