I worked through samples in the Visual Quickpro Guide Django. I used
python manage.py runserver while running through the examples.
Now, I want to configure this in Apache. Django is complaining about
finding modules underneath my top directory.
Here's the apache configuration:
SetHandler pytho
Using Apache and not the built-in Django web server, I can reach the
admin site, but it's not formatted well, as it is with the built-in
web server.
Any ideas on what to do?
Here's the location directive in apache
SetHandler python-program
PythonHandler django.core.handlers.modpython
SetEnv DJA
I am getting a Missing Template exception
Exception Type: TemplateDoesNotExist
Exception Value:
registration/login.html
My urls.py looks like this:
from django.conf.urls.defaults import *
from django.contrib.auth.views import login
.
.
.
urlpatterns = patterns('',
(r'^$', main_page)
Thanks. That worked.
On Sep 28, 7:35 pm, octopusgrabbus wrote:
> I am getting a Missing Template exception
>
> Exception Type: TemplateDoesNotExist
> Exception Value:
>
> registration/login.html
>
> My urls.py looks like this:
>
> from django.conf
I am looking for either programming samples or specific documentation
that show how a user is redirected to a page specific to that user,
after login. Given I am just starting out with Django, if this is
really advanced, then I'll settle for getting people logged in and
give them the same page.
Th
When I run Django admin with runserver running, I get nice graphics. I
don't when I run Django admin from apache. I can log into my django
application from apache, but do not get the graphics. I'm looking for
examples or documentation on how to fix this.
Thanks.
cmn
--
You received this message
Periodically, I keep getting bitten by this error:
The Python egg cache directory is currently set to:
/home/amr/.python-eggs
Perhaps your account does not have write access to this directory?
You can
change the cache directory by setting the PYTHON_EGG_CACHE environment
variable to point to a
rocessed.
"
concerning python eggs, but it is not clear to me the name or location
of the file in question.
On Oct 18, 1:25 pm, octopusgrabbus wrote:
> Periodically, I keep getting bitten by this error:
>
> The Python egg cache directory is currently set to:
>
> /home/amr/.p
Problem fixed by following instructions
http://docs.djangoproject.com/en/dev/howto/deployment/modpython/#serving-the-admin-files
labeled Using "eggs" with mod_python
On Oct 18, 1:25 pm, octopusgrabbus wrote:
> Periodically, I keep getting bitten by this error:
>
> The Python
I've added
PythonInterpreter amr_django
PythonImport /home/amr/django/amr/python_egg_cache.py amr_django
to /etc/init.d/conf/httpd.conf.
Here's python_egg_cache.py
import os
os.environ['PYTHON_EGG_CACHE'] = '/python_egg_cache/.python-eggs'
This was working a few days ago, after I added the con
e.
Got instructions from here:
http://www.question-defense.com/2009/12/22/extractionerror-cant-extract-files-to-egg-cache-errno-13-permission-denied-root-python-eggs
On Oct 25, 11:58 am, octopusgrabbus wrote:
> I've added
>
> PythonInterpreter amr_django
> PythonImport /home/amr/django/am
Sorry for reposting a previous question, but Google temporarily
blocked my access to Groups for going back too far, too fast in this
group to find my original post.
My admin site works, but without graphics.
I've done the following to fix this.
TEMPLATE_DIRS = (
# Put strings here, like "/ho
Thanks. I'll try your suggestions. I am using the phrase no graphics
to mean the admin site comes up, but doesn't have all the nice
background.
On Nov 1, 3:41 pm, Robbington wrote:
> Hi,
>
> By 'with out graphics' do you mean no css or Javascript?
>
> If so you want to make sure the value for the
Tried suggestions, and still do not get full graphics. Everything else
works. Users are displayed, and so on.
On Nov 2, 12:24 pm, octopusgrabbus wrote:
> Thanks. I'll try your suggestions. I am using the phrase no graphics
> to mean the admin site comes up, but doesn't h
Given the following in my main page template how does Django process
logout? I am asking this, because I want an href to take an
authenticated user to a page that, for example, allows the collection
of some data (billing reads).
I have an application within the project that will handle read snaps.
Does anyone have samples for auto logging out a user?
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@goo
tings.py file?)
>
> 2. Check your site settings. If you are using django's web server, it
> will serve the admin files automatically, if you are using apache or
> some other web server, you will have to specify where the admin site's
> files are, like Robbington said. Compare
What is the best way to set the Django command line environment for
testing in the python interpreter?
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this g
I have a simple form:
{% extends "base.html" %}
{% block title %}Take Snapshot of Billing Reads{% endblock %}
{% block head %}Take Snapshot of Billing Read{% endblock %}
{% block content %}
{% if user.username %}
{{ form.as_p }}
Section Number:
ussell Keith-Magee
wrote:
> On Thu, Nov 4, 2010 at 10:32 PM, octopusgrabbus
>
>
>
> wrote:
> > I have a simple form:
>
> > {% extends "base.html" %}
> > {% block title %}Take Snapshot of Billing Reads{% endblock %}
> >
I have a forms class in forms.py
from django import forms
class ReadSnapForm(forms.Form):
cycle = forms.CharField(max_length=1)
message = forms.CharField(widget-forms.Textarea,required=False)
Here is the form that uses the class
{% extends "base.html" %}
Enter Billing Cycle
Thanks. I put back the {% block title %}, {% block head %}, and {%
block content %} directives, corrected the error in forms.py, but the
field still won't display. Any other ideas to try?
On Nov 4, 6:44 pm, Daniel Roseman wrote:
> On Nov 4, 10:32 pm, octopusgrabbus wrote:
>
>
Thanks. I'm starting from the beginning and will eventually get back
to this level of template extraction.
On Nov 5, 9:00 am, Daniel Roseman wrote:
> On Nov 5, 12:10 pm, octopusgrabbus wrote:
>
> > Thanks. I put back the {% block title %}, {% block head %}, and {%
Is there a trick to executing this command line
cmd_line = 'python /home/amr/bin/addReadSnap.py -s ' + str(cycle)
using this function from django?
import sys
import os
import string
from subprocess import call, Popen
def exec_external_cmd(cmd_line):
retcode = None
try:
process
This definitely has something to do with running runserver, because it
works under that. I'm just trying to figure out what to configure in
Apache to make it work.
On Nov 6, 9:55 am, octopusgrabbus wrote:
> Is there a trick to executing this command line
>
> cmd_line = 'p
I fixed this by adding /usr/local/bin/python.
On Nov 6, 12:47 pm, octopusgrabbus wrote:
> This definitely has something to do with running runserver, because it
> works under that. I'm just trying to figure out what to configure in
> Apache to make it work.
>
> On Nov 6, 9:5
I am able to log into my form page, which is a simple form asking the
user for one value. If that value is entered successfully, I am able
to redirect to another "you were successful" page. However, my
template logic that checks to see if the user is authenticated -- as
far as I can tell the user i
edirect('/after_rs/')
else:
errors.append('Read snap transfer failed with ' +
rclist[1])
return render_to_response('rsf.html', {'errors': errors})
def after_rs(request):
return render_to_response('after_rs.html'
I have an existing MySQL table. It's fairly straightforward:
part_num char(20)
ept_type smallint (default 0) not null
inv_id integer (default 0) not null
load_date date
columns 2 and 3 (ept_type and inv_id) form a unique key. An example of
a unique key is 43 and 80581770.
I've tried to create a
Thanks.
On Nov 10, 12:31 pm, Daniel Roseman wrote:
> On Nov 10, 5:23 pm, octopusgrabbus wrote:
>
>
>
> > I have an existing MySQL table. It's fairly straightforward:
>
> > part_num char(20)
> > ept_type smallint (default 0) not null
> > inv_id int
My new model class works great. It returns my answer, but in a query
set, and the table is set up only to return one element in the
QuerySet due to the indexes. My problem is how to extract the data
from that QuerySet. repr() does not work, because the model class has
no repr method.
How do I extr
On Wed, Nov 10, 2010 at 09:23:55AM -0800, octopusgrabbus wrote:
> > > # Create your models here.
> > > class ept_inv(models.Model):
> > > part_num = models.CharField(max_length=20)
> > > ept_type = models.SmallIntegerField
> > > inv_id = model
This may not be the best way, but it works:
temp_ept_id = EptInv.objects.filter(inv_id=80581770).values_list()
and I got it from
http://docs.djangoproject.com/en/1.0/ref/models/querysets/
On Nov 10, 3:47 pm, octopusgrabbus wrote:
> My new model class works great. It returns my answer, but
My form returns back to itself
return render_to_response('chkinv.html', {'errors': errors})
before and after the post.
During the post, status is calculated through a model that a piece of
inventory is or is not available. What is the best way to put that
status back into the message field in th
Thank you. This worked well.
However, I'm left with this value
How do I get that into a comparable form?
On Nov 10, 4:06 pm, Łukasz Rekucki wrote:
> On 10 November 2010 21:55, Shawn Milochik wrote:
>
> > The queryset returns zero or more instances of your model. So if
> > there's only one resu
()
> load_date = models.DateField()
>
> On 10 nov, 18:23, octopusgrabbus wrote:
>
> > I have an existing MySQL table. It's fairly straightforward:
>
> > part_num char(20)
> > ept_type smallint (default 0) not null
> > inv_id integer (default 0) not null
> > load
As to installing a new Django, I'd perform an upgrade and avoid
cutting and pasting.
On Nov 15, 3:54 am, kelp wrote:
> Hello,
> So I have downloaded Django and put the folder into my /home/username/
> directory, and I ran setup.py. I played with Django a little bit, but
> it turns out that I hav
Sorry for the late reply. Most of my users will not remember to log
out. After, say four hours, I'd like to log them out, if of course
they're not already logged out.
On Nov 5, 4:31 am, Daniel Roseman wrote:
> On Nov 3, 12:43 pm, octopusgrabbus wrote:
>
> > Does anyone
There are many books on Django. You can look on www.softpro.com,
Amazon, or your favorite book store.
I've gotten a lot out of two books. The Definitive Guide to Django and
Visual Quick Pro Django.
On Nov 28, 11:24 am, Matthias Runge wrote:
> Djangobook is available as printed edition from apress
I am running Django 1.2.3 -- python -c "import django; print
django.get_version()" I basically need to know what logs to look at to
fix a css file not loading.
I am trying to load a css file in my base template
{% block title %}Town of Arlington Water Department AMR
System{% en
Many thanks. This worked swell, and I also set the cookies expire when
browser closed setting.
On Nov 24, 11:39 am, Daniel Roseman wrote:
> On Nov 24, 4:23 pm,octopusgrabbus wrote:
>
> > Sorry for the late reply. Most of my users will not remember to log
> > out. After, say fo
dia/'
ROOT_URLCONF = 'amr.urls'
STATIC_DOC_ROOT = '/home/amr/django/media'
And here's the reference to it in the base template.
{% block title %}Town of Arlington Water Department AMR
System{% endblock %}
On Dec 1, 4:51 am,
Thank you. I've done made changes according to your suggestions, but
the css appears not to load. I am using apache, not the built-in web
server.
On Nov 30, 5:14 pm, Robert S wrote:
> Well - that's one way
> A simpler way is to use your settings.py file to point to your media,
> and remove all re
04 (lucid) Firefox/3.6.12"
On Dec 1, 10:02 am, Tom Evans wrote:
> On Wed, Dec 1, 2010 at 2:48 PM, octopusgrabbus
>
> wrote:
> > Thank you. I've done made changes according to your suggestions, but
> > the css appears not to load. I am using apache, not the built-in w
My question is what do I need to do to straighten out the media path,
so I can load amr.css.
When trying to load amr.css, my application gets a 404.
10.100.0.88 - - [01/Dec/2010:10:03:06 -0500] "GET /css/amr.css HTTP/
1.1" 404 228
6 "http://amrserver:8002/"; "Mozilla/5.0 (X11; U; Linux i686; en-US
Many thanks to the replies and everyone's patience. I can't see the
9th response to this thread because Google Groups appears to be off
line, but here's what I've done to get amr.css to load:
1) Here is the base template portion that loads the css file:
{% block title %}Town of
I failed to provide the following information in a similar post, and
it slowed down responses.
1) What web server are you using? If it is not the built in
development server, please provide the configuration for Django.
2) Check your application's settings.py file and make sure the
appropriate it
In my muddling around working on two problems involving serving media
pages, I have both problems narrowed down to similar 404 entries in
access_log (apache/mod_python).
10.100.0.88 - - [02/Dec/2010:14:15:29 -0500] "GET /media/admin/media/
css/base.cs
s HTTP/1.1" 404 2343 "http://amrserver:8002/ad
Here is my model (shortened for brevity). It was generated by
inspectdb. I am running Django 1.2 with mod_wsgi, on Ubuntu 10.04 and
apache2.
class CsInvHold(models.Model):
action = models.CharField(max_length=3, db_column='Action',
blank=True) # Field name made lowercase.
.
.
.
inventory_o
file.
On Apr 21, 12:37 pm, octopusgrabbus wrote:
> Here is my model (shortened for brevity). It was generated by
> inspectdb. I am running Django 1.2 with mod_wsgi, on Ubuntu 10.04 and
> apache2.
>
> class CsInvHold(models.Model):
> action = models.CharField(max_leng
I've also added this to force the QuerySet to evaluate, and I'm still
getting the object reference:
for list_element in CsInvHold.objects.filter(inventory_ok=0):
cs_list.append(list_element)
On Apr 21, 12:37 pm, octopusgrabbus wrote:
> Here is my model (shortene
I have been able to narrow my question down. I can pull individual
columns from the returned model object reference. How can I get all
those columns in a list. Wrapping in a list() function returns an
error object is not iterable error.
On Apr 21, 12:37 pm, octopusgrabbus wrote:
> Here is
entire result set without iteration through the
columns.
In addition from what I read in the documentation, I was supposed to
get a QuerySet returned on a filter, not a model object reference.
I'm not sure why this is happening.
On Apr 21, 3:08 pm, Daniel Roseman wrote:
> On Thursday, Apri
I've asked two questions:
1) Why do I get back an Object reference, when the docs say it's a
query set?
2) How can I dump that object's values into a list instead of
iterating each column?
On Apr 21, 5:06 pm, Daniel Roseman wrote:
> On Thursday, April 21, 2011 9:17:54 PM UTC
ction being called. I'm asking 1
about the documentation and 2 about a possible method in the Django
model that would return a list.
On Apr 21, 12:37 pm, octopusgrabbus wrote:
> Here is my model (shortened for brevity). It was generated by
> inspectdb. I am running Django 1.2 with mo
Thanks for the links.
On Apr 21, 11:56 pm, Oleg Lomaka wrote:
> On Fri, Apr 22, 2011 at 1:20 AM, octopusgrabbus
> wrote:
>
>
>
> > Here is the pertinent code:
>
> > def reconcile_inv(request):
> > errors = []
> > cs_list = []
> > return_d
There is a lot of detail for this question, so I'll summarize. I have
two Django projects, each running on a different virtual site and
using a separate wsgi_handler. The first works fine, including logging
in. The second one fails with TemplateDoesNotExist registration/
login.html, but I can reach
Solved. This was due to a missing directory under django/templates.
On May 26, 3:04 pm, octopusgrabbus wrote:
> There is a lot of detail for this question, so I'll summarize. I have
> two Django projects, each running on a different virtual site and
> using a separate wsgi_hand
My Django application successfully executes functions belonging to
user amr. I want to execute an external command line application from
views.py
def exec_external_cmd(cmd_line):
retcode = None
try:
process = Popen(cmd_line, bufsize=2048, executable="/bin/
bash", shell=True, stdout
I get a file permissions error, and this is running on Apache.
It's dying on the retrbinary line. However, it's logging in using
valid user names and passwords, so I'm confused as to why it's dying.
def getInvRpt(id, filename, path, db):
file_list = []
os.chdir('/home/amr/ics_in/')
f
On Aug 15, 2:40 pm, octopusgrabbus wrote:
>
> > I get a file permissions error, and this is running on Apache.
>
> > It's dying on the retrbinary line. However, it's logging in using
> > valid user names and passwords, so I'm confused as to why it's
I would like to see more from Django on what it chooses to,
specifically around the loading or not loading of pages. I am running
Django on RHEL 5 WS, with mod_python. I want to stick with mod_python,
despite the testimonies its replacement is better.
Are there switches I can set to get more granu
you can try out.
> Django Debug Toolbar:https://github.com/robhudson/django-debug-toolbar
>
> Hope it helps.
>
> Regards,
> //Vikalp
>
> On Sun, Jan 9, 2011 at 12:21 AM, octopusgrabbus
> wrote:> I would like to see more from Django on
> what it chooses to,
> > s
I am trying to load a css file in my base.html template
{% block title %}Test{% endblock %}
What kind of path is supposed to go in the href? Is it relative to the
document root?
Does anyone have an example of loading a css file including the Apache
configuration?
I'm trying to reconfigure to mod_wsgi and am wisely starting with a
workstation.
What changes in this line which is in full context below:
PythonHandler django.core.handlers.modpython
modpython changes, but to what does it change?
Listen 8002
WSGIScriptAlias / /home/amr/django/django.wsgi
Alias
I am running Django 1.2.4 and mod_wsgi. My application is running
fine.
My admin won't load correctly.
wsgi_handler.py
---
import os
import sys
PROJECT_ROOT = os.path.realpath(os.path.dirname(__file__))
sys.path.append(PROJECT_ROOT)
sys.path.append(os.path.join('/home/amr/djan
ces and try again, if necessary go back to the most
> basic admin.site.register(MyModel)
>
> Do the static files (css, js) not load? Then maybe your paths in
> settings.py are not configured properly.
>
> Hope this helps, and if you need any further assistance please l
ooted. It looks like there's a caching condition somewhere, but I'm
not aware of what it is. Any ideas? Thanks.
Then, I put back what I had and tested again and di
On Jan 27, 7:24 pm, OverKrik wrote:
> Try this:
>
> ADMIN_MEDIA_PREFIX = BASE_URL + 'media/admin/'
>
&
ute path to the directory that holds media
MEDIA_ROOT = '/usr/local/www/documents/media'
# URL that handles the media served from MEDIA_ROOT
MEDIA_URL = '/media/'
# URL prefix for admin media -- CSS, JavaScript and images.
ADMIN_MEDIA_PREFIX = BASE_URL + 'media/admin/&
On Jan 28, 10:04 am, octopusgrabbus wrote:
> In addition, I can't get the built-in server to serve the admin's look
> and feel. I see that as a good thing, because clearly it's a wrong
> setting that affects both servers. Here are the settings again.
>
> # Main URL f
I am running Django 1.2.4 mod_wsgi. My admin site loads with its look
and feel. I am trying to add css to my application, which works fine.
I have looked through the docs, and cannot get a sample css file to
load. I would appreciate some pointers to get this working.
Here are the appropriate lines
Check out your settings.py for this one of this in the
> TEMPLATE_CONTEXT_PROCESSORS constant.
>
> 'django.core.context_processors.request',
> 'django.core.context_processors.media',
>
>
>
>
>
> > On Wed, Jan 19, 2011 at 5:55 PM, octopusgrabbus
ust plain Context.
> Check out your settings.py for this one of this in the
> TEMPLATE_CONTEXT_PROCESSORS constant.
>
> 'django.core.context_processors.request',
> 'django.core.context_processors.media',
>
>
>
>
>
&
I have written a web application in Django. At most, there will never
be more than five users logged in, if that. I chose this particular
application for Django implementation deliberately due to low use and
because it was a first-time application.
The application sits behind a firewall, and possi
I am trying to load static content (one css file) from the same apache
server, using a different virtual host. I have no errors, but the css
file appears not to load. How can I debug this further?
The load shows up in /var/log/apache2/other_vhosts_access.log:
Here are settings from httpd.conf.
L
Thanks. I was trying to hide the port. They're all the same for real,
8082.
On Feb 2, 2:21 pm, Eric Chamberlain wrote:
> Your port numbers don't match.
>
> What does Firebug or some other html debug tool say about the file?
>
> On Feb 2, 2011, at 10:55 AM, octopusgrabbus
gt; Your port numbers don't match.
>
> > What does Firebug or some other html debug tool say about the file?
>
> > On Feb 2, 2011, at 10:55 AM, octopusgrabbus wrote:
>
> >> I am trying to load static content (one css file) from the same apache
> >> server, using a d
My problem is I create a model object and then save it. The data I put
in the model, which is not added. Instead an update of all similar
part numbers with the date occurs. I know about the override that
forces an insert. Is that what I should do?
Here is a sample of the data:
part_num,"ept_type",
Is there a standard, accepted way to use environment variable or other
substitution, so the application's settings.py file can exist on, for
example, a production and test system. Right now, I've taken to coding
the URL strings separately, and I know that's bad in the long run.
So, my question is,
Here is the table:
class CsRemove(models.Model):
action = models.CharField(max_length=3, db_column='Action') #
Field name made lowercase.
endpointid = models.IntegerField(primary_key=True,
db_column='EndpointId') # Field name made lowercase.
devicetype = models.IntegerField(primary_key
on't know your database and we don't know what
> exactly is wrong (except for "Django fails").
>
> If you add more details, someone might be able to help you
>
> My 2 cents
>
> Jirka
>
> On Tue, Mar 8, 2011 at 14:08, octopusgrabbus
> wrote:
> >
This is a MySQL 5.0+ database. I can manually insert using Query
Browser.
On Mar 8, 12:34 pm, octopusgrabbus wrote:
> Sorry. The error is Exception Type:
> ValidationError
> Exception Value:
> [u'Enter a valid date in -MM-DD format.']
>
> I have printed out for
This is for Django 1.2 and MySQL 5.x
How does a template know a dictionary's name, if a dictionary is
supplied in render_to_response?
totals_dict['TotalActiveAccounts'] = ret_list[0]
totals_dict['TotalBillableAccounts'] = ret_list[1]
totals_dict['TotalNon-BillableAccounts'] = int(ret_l
Thanks. As you pointed out, I had to remove the '-' in the dictionary
key.
On Mar 9, 9:31 pm, Karen Tracey wrote:
> On Wed, Mar 9, 2011 at 1:30 PM, octopusgrabbus
> wrote:
>
> > This is for Django 1.2 and MySQL 5.x
>
> > How does a template know a dic
)
errors.append('Endpoint ID queued for
customer synch removal')
except MySQLdb.Error, e:
info_str = 'Error: ' + e + '
load_date = ' + load_date
Server or Hosted Service? I was confused by the question.
We host our own applications (at least for now).
For server hardware, we use IBM e-server, non-virtual at the moment.
For OS software, Red Hat Enterprise EL WS 5 in production. Eventually,
will be rebuilt using CentOS.
For development Ub
errors.append('Endpoint ID queued for
customer synch removal')
On Mar 10, 10:30 am, Tom Evans wrote:
> On Thu, Mar 10, 2011 at 3:18 PM, octopusgrabbus
>
> wrote:
> > Could my problem be related to the fact that my views.py module first
> > performs a get (sql select)
I converted my date, and it all works fine. Thanks for your help.
On Mar 10, 12:54 pm, Tom Evans wrote:
> On Thu, Mar 10, 2011 at 5:46 PM, octopusgrabbus
>
>
>
> wrote:
> > I'm confused as to how this code isn't using the model?
>
> > Here's the mode
It's a date format MySQL will accept into a date field.
On Mar 10, 8:07 pm, Kenneth Gonsalves wrote:
> On Thu, 2011-03-10 at 09:46 -0800, octopusgrabbus wrote:
> > load_date = '-00-00'
>
> what on earth is this?
> --
> regards
> KGhttp://lawgon.l
I could easily have used the Informix "null" date of 12/31/1899, but
chose that instead. I put the dates into a table, so when they were
processed they'd be set to a real date, today's.
On Mar 11, 7:39 am, Kenneth Gonsalves wrote:
> On Fri, 2011-03-11 at 04:28 -080
Django 1.2
mod_wsgi
Python 2.6.6
When I create an object of a model of a table, what is the best way to
update two columns? I can update one easily, but not two of them. I
also noted the model, does not list the third key, at least that I can
recognize.
What am I asking is what constructs should
This seems to fit the bill just fine.
DrReadRange.objects.update(reading_width_days=read_range_in)
On Mar 16, 9:28 am, octopusgrabbus wrote:
> Django 1.2
> mod_wsgi
> Python 2.6.6
>
> When I create an object of a model of a table, what is the best way to
> update two columns
92 matches
Mail list logo