Re: Adding link to admin page

2012-03-26 Thread Mike Dewhirst
I should have mentioned that {% extends "admin/base.html" %} is actually extending the django admin/base.html in site-packages because there is no such file in my SRC_ROOT/templates/admin directory. Mike On 27/03/2012 2:19pm, Mike Dewhirst wrote: Larry Here is a working setup ... From

Re: Adding link to admin page

2012-03-26 Thread Mike Dewhirst
Larry Here is a working setup ... From settings.py # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # if templates are not found here look in app_name/templates TEMPLATE_DIRS = ( os.path.join(SRC_ROOT, 'templates/').replace('\\','/'), ) # List of callables

Re: Adding link to admin page

2012-03-26 Thread Larry Martell
On Mon, Mar 26, 2012 at 7:25 PM, Mike Dewhirst wrote: > On 27/03/2012 10:16am, Larry Martell wrote: >> >> On Mon, Mar 26, 2012 at 4:37 PM, Mike Dewhirst >>  wrote: >>> >>> On 27/03/2012 9:16am, larry.mart...@gmail.com wrote: On Mar 25, 3:29

Re: Adding link to admin page

2012-03-26 Thread Mike Dewhirst
On 27/03/2012 10:16am, Larry Martell wrote: On Mon, Mar 26, 2012 at 4:37 PM, Mike Dewhirst wrote: On 27/03/2012 9:16am, larry.mart...@gmail.com wrote: On Mar 25, 3:29 pm, Larry Martellwrote: I have a client that has an app built with

User/UserProfile Queryset problem

2012-03-26 Thread bcrem
Hello Django Nerds! So I have a (somewhat) complicated lookup I'm trying to do; here's the gist of it: 1. I have a Store class, with a User ManyToManyField, Store.users 2. I have a user profile class associated with each user, UserProfile, accessible through the usual User.get_profile()

Re: Much the same code, different businesses

2012-03-26 Thread Doug Ballance
There are a few choices that I'm familiar with. 1) Create a separate project/settings file for each of your stores, overriding templates as needed by placing assigning a template path for the project. I think this is pretty much the recommended way to do things, especially if the number of sites

Re: Adding link to admin page

2012-03-26 Thread Larry Martell
On Mon, Mar 26, 2012 at 4:37 PM, Mike Dewhirst wrote: > On 27/03/2012 9:16am, larry.mart...@gmail.com wrote: >> >> On Mar 25, 3:29 pm, Larry Martell  wrote: >>> >>> I have a client that has an app built with django. On every page of >>> their app is

Re: myproject/wsgi.py vs. myproject.wsgi?

2012-03-26 Thread Micky Hulse
On Mon, Mar 26, 2012 at 5:14 AM, Reinout van Rees wrote: > In 1.3, there was no wsgi file. So either you added it yourself or > webfaction automatically adds it. > 1.4 started adding that wsgi.py file. It should be a drop-in replacement for > the one you have now, basically.

Re: Adding link to admin page

2012-03-26 Thread Mike Dewhirst
On 27/03/2012 9:16am, larry.mart...@gmail.com wrote: On Mar 25, 3:29 pm, Larry Martell wrote: I have a client that has an app built with django. On every page of their app is a link to their admin site. They tell me the admin site is generated entirely by django, and

Re: Adding link to admin page

2012-03-26 Thread larry.mart...@gmail.com
On Mar 25, 3:29 pm, Larry Martell wrote: > I have a client that has an app built with django. On every page of > their app is a link to their admin site. They tell me the admin site > is generated entirely by django, and they've never customized it > before. On the very

Re: Multiple Choice Quiz

2012-03-26 Thread jbr3
Thank you for taking the time to help Babatunde; it's very much appreciated. On Mar 26, 7:00 am, Babatunde Akinyanmi wrote: > jbr3,https://gist.github.com/2204408 > The code is most likely buggy and might be insecure because I'm not really > sure if hackers can use radio

Authentication and Modeling question.

2012-03-26 Thread Lee Hinde
I'm working on a rewrite of an app that has three categories of users and I'm wondering about the best way to link them to the authentication system: In-House Staff. Contractors Customers who interact via the app. The in-house staff model doesn't store any address info. Contractor and Customer

Re: How to adjust grid in Django Admin Forms

2012-03-26 Thread Steven
I tried changing width from 8em to 16em in /usr/local/lib/python2.7/ dist-packages/django/contrib/admin/static/admin/css/forms.css in the two places where it appeared: .aligned label{ display: bloack; padding: 3px 10px 0 0; float: left; width: 8em; } and .inline-group .aligned-label{

Re: Sending data to the server

2012-03-26 Thread drk
Just to rephrase it, I'm setting the data through a variable in a django template, maybe that's not the best way to do it, I guess. Segunda-feira, 26 de Março de 2012 16h23min15s UTC+1, drk escreveu: > > Yea, that was it. > Also changing the url to just '/logout' > > Thanks! > > > I'm having

Re: Sending data to the server

2012-03-26 Thread drk
Yea, that was it. Also changing the url to just '/logout' Thanks! I'm having other problem now, the data that is getting sent to the javascript code from the server is json data, but the quote symbol " is returned as and so I get an error when trying to parse it. Segunda-feira, 26 de Março

Re: How to adjust grid in Django Admin Forms

2012-03-26 Thread akaariai
On Mar 26, 4:53 pm, Steven wrote: > I've just created a model in Django and want to use the admin form to > enter information for it. The problem I'm having is that my field > names are so long that they overlap the edit boxes where their values > are to be entered. > >

How to adjust grid in Django Admin Forms

2012-03-26 Thread Steven
I've just created a model in Django and want to use the admin form to enter information for it. The problem I'm having is that my field names are so long that they overlap the edit boxes where their values are to be entered. If one follows the tutorial in the Django website, it's as if the label

Re: Custom option for Model Meta Options

2012-03-26 Thread akaariai
On Mar 26, 12:26 pm, Roman Klesel wrote: > Hello, > > in my App I would like some Models to accept some custom Meta options like > this: > > class MyModel(models.Model) > >   name = models.CharField(...) >   other = models.CharField(...) >   more =

Re: myproject/wsgi.py vs. myproject.wsgi?

2012-03-26 Thread Reinout van Rees
On 25-03-12 08:04, Micky Hulse wrote: Hello, This is is probably a silly question, but... I just installed a fresh copy ofDjango 1.4 (mod_wsgi 3.3/Python 2.7) on my WebFaction server. In 1.3, the command startproject (IIRC) generated a myproject.wsgi that lived next to myporject

Much the same code, different businesses

2012-03-26 Thread Nick Mellor
Hi all, I'm wanting the same code to run many fairly simple, near-identical websites. That's the bottom line. I've had a look through the group archives and found a couple of hints. My planned application serves small grocery businesses taking orders and making weekly home deliveries for their

Re: philosophy behind sites and applications in Django

2012-03-26 Thread Reinout van Rees
On 26-03-12 02:21, Jojo wrote: Hi guys, I'm new in Django (I started with the 1.3 and now I'm playing with the 1.4) and I'd like to understand better the phylosophy behind the concepts of sites and applications. Ok a site can contain multiple applications and an application can live in many

Re: Pip install matplotlib error with virtualenv

2012-03-26 Thread Reinout van Rees
On 23-03-12 22:01, darwin_tech wrote: Yes, that is true. I set the virtualenv with --no-site-packages as I want a reproducible environment for my Django project. This should not mean that I cannot install matplotlib within the virtualenv though, surely? You can install matplotlib just fine in

Re: Tweepy Status Error

2012-03-26 Thread Amit
In the example given in doc of tweepy, the process_status is a user defined method. You have to define this method. Its just a reference given. Define a method process_status and do whatever you want to do with status. On Mar 26, 3:57 am, coded kid wrote: > Hi guys, I

De-serialization of ManyToManyField

2012-03-26 Thread sk
Hi, I have searched high and low to an answer to this, but have been unable too turn anything up. Apologies if I have overlooked an answer or explanation elsewhere. I have set up a very simple model as follows: --- from

Re: Multiple Choice Quiz

2012-03-26 Thread Babatunde Akinyanmi
jbr3, https://gist.github.com/2204408 The code is most likely buggy and might be insecure because I'm not really sure if hackers can use radio buttons to submit malicious stuff. The idea is using the model structure Shawn gave. I created a custom form class which extracts some Question instances.

Re: Multiple Choice Quiz

2012-03-26 Thread Babatunde Akinyanmi
Ok. Let me send you a gist about how I achieved mine to give you an idea. On Sat, Mar 24, 2012 at 4:46 PM, jbr3 wrote: > Babatunde, > > Yes, that's basically the same idea. The questions would all be on the > same page, however, and I wouldn't incorporate the time limit. But,

Re: Template Error: Invalid block tag: 'endblock', expected 'empty' or 'endfor'

2012-03-26 Thread Sam Lai
On 25 March 2012 11:56, Homer wrote: > I tried to create an index webpage but Django told me I had a template > error: > > Invalid block tag: 'endblock', expected 'empty' or 'endfor' > > Here is the code of index.html: > > {% extends "base.html" %} > > {% block title %}Home{%

Re: Template Error: Invalid block tag: 'endblock', expected 'empty' or 'endfor'

2012-03-26 Thread Sam Lai
On 25 March 2012 11:56, Homer wrote: > I tried to create an index webpage but Django told me I had a template > error: > > Invalid block tag: 'endblock', expected 'empty' or 'endfor' > > Here is the code of index.html: > > {% extends "base.html" %} > > {% block title %}Home{%

Custom option for Model Meta Options

2012-03-26 Thread Roman Klesel
Hello, in my App I would like some Models to accept some custom Meta options like this: class MyModel(models.Model) name = models.CharField(...) other = models.CharField(...) more = models.CharField(...) class Meta: db_table = "my_table" custom_option = True It would be quite

Re: Sending data to the server

2012-03-26 Thread jim
Do you have CSRF protection enabled? https://docs.djangoproject.com/en/dev/ref/contrib/csrf/ It will 403 POST requests unless they have the right token. Jim On Sun, Mar 25, 2012 at 11:24 PM, drk wrote: > Hi, so I have a application that works offline (with localStorage),