I have Admin User extended/subclassed by Teacher class.
How to prevent Teachers from seeing and changing other Teachers' profile data and Teachers are able to change their own records/rows only? Thanks in advance!
...
By default Django admin site shows all records of a related model/table for viewing. How can I show only the records that meet certain criteria?
...
I have a django website running with mod_python and Apache. The current configuration directs all / traffic to the django site. Now, I need to enable userDir /~user on the machine as well. I have enabled the userDir module in Apache. Since, Apache is redirecting all the request to the django app, /~user is not working as the django just ...
I've got a problem... we're writing project using django, and i'm trying to use django.test.client with nose test-framework for tests.
Our code is like this:
from simplejson import loads
from urlparse import urljoin
from django.test.client import Client
TEST_URL = "http://smakly.localhost:9090/"
def test_register():
cln = Clien...
I' using django 1.1.1 and its comment framework.
But the "preview" button in the comment form always posts the comment directly without previewing it.
I've edited both forms.html and preview.html.
forms.html
{% load comments i18n %}
<form class="form2 mt10 padding5" action="{% comment_form_target %}" method="post">
<input type="h...
Hi,
I'm using django with apache mod_python. I authenticate users via the basic auth handler (django.contrib.auth.handlers.modpython) [1]. My views get only an instance of AnonymousUser passed in request.user. What am I doing wrong?
[1]: it's an API that is https only, so it shouldn't be a security problem.
...
Question: Could people show or point me a complete example or tutorial to start using Beaker in Django?
Information:
Since I've read about problem in database connection with django orm
from here.
http://lethain.com/entry/2008/jul/23/replacing-django-s-orm-with-sqlalchemy/
Here is the correct link http://adam.gomaa.us/blog/2007/aug/26...
I'm using following model to store info about pages:
class Page(models.Model):
title = models.TextField(blank = False, null = False)
New data saves correctly, I'm saving Unicode data there (lots of non-ASCII titles).
But when I'm performing query:
page = Page.objects.filter(id = 1)
page.title looks odd:
u'\u042e\u0449\u0435\u0...
While subclassing db.models.Model, sometimes it's essential to add extra checks/constraints. E.g. I have an Event model with start_date and end_date. I want to add validation into the fields or the model so that end_date > start_date. How many possible ways to do this? At least I know this can be done outside the models.Model inside the ...
I want to learn how can I add to template to my ModelForm i'm newbie. Below you can see my models.py, url.py and views.py:
My model.py looks like that:
from django.db import models
from django.forms import ModelForm
from django.contrib.auth.models import User
class Yazilar(models.Model):
yazi = models.CharField(max_length=200)...
I am very new to web development, just wanted to figure out if there is a recommended(preferred) project folder structure to use (may be even specific to Django based projects).
Thank you.
...
I am looking for advice on best resources to learn how to develop webapps with Django [the python framework]. Here's a few information to help responders to narrow-down the gazillion options "out there".
Where I stand
I know python (2.x series) and I have developed a few applications/scripts with it. I wouldn't define myself a python-...
Hi,
I am trying to get Oauth working with the Google API using Python. I have tried different oauth libraries such as oauth, oauth2 and djanog-oauth but I cannot get it to work (including the provided examples).
For debugging Oauth I use Google's Oauth Playground and I have studied the API and the Oauth documentation
With some librari...
The app-engine-patch authors have officially marked this wonderful project as dead on their website. Over the last year a lot of people have asked what the best way to run Django on Google App Engine was, and time after time people have pointed to app-engine-patch being the way to go. Now that this project is dead, I would love to revis...
Looking for some implementation ideas here. I am trying to design a custom polling system for my school, to allow teachers to give students polls to take.
I have a Poll model, Question model (with a foreignkey to Poll model), and Choice model (with a foreignkey to the Question model).
What I need to be able to do is allow whoever is ad...
I have a view definition that (attempts to) outputs a model as a table. This is what I have so far:
def output_table(request):
output = My_Model()
return render_to_response('outputtable.html', {'output': output})
Here's the HTML for outputtable.html:
<html>
<table>
{{ output.as_table }}
</table>
</html>
What am I doing ...
I am having to look into some code and consider working in a Python framework called Glashammer.
I know and love Django. I have some experience with Appengine native framework and Django on Appengine.
I'd like to know from you that have used one or more of those, how Glahammer compares and contrasts with others. What are there any Pros...
Hey,
I use Django and just dropped and re-created database in order to flush table data. Now when I'm trying to do any db-related task, I get:
./manage.py sql portfolio
Traceback (most recent call last):
File "./manage.py", line 11, in <module>
execute_manager(settings)
File "/usr/lib/pymodules/python2.6/django/core/managemen...
I'm trying to optimize a site I'm building with Django/Flash and am having a problem using Django's iterate over chunks() feature. I'm sending an image from Flash to Django using request.POST data rather than through a form (using request.FILES). The problem I foresee is that if there is large user volume, I could potentially kill memory...
Hello,
I'm trying to use both extends and include tags in one template, just like:
{% extends "layout.html" %}
{% block content %}
<div id="content">
<nav class="mainMenu">
{% include "list.html" %}
</nav>
</div>
{% endblock %}
Unfortunately what is displayed is only list.html without contents from layout.html and file that...