Reset userdata at a specific time without refreshing

2013-02-10 Thread Jak
Hello,

I am creating an app that keeps track of how many classes a person attends 
a month. Basically a person gets 10 classes a month, and each time they 
come to a class I deduct a class from their total. On the 1st of each month 
at 12:01am I want the class packs to reset.

I've created some code to do this, but in order for it to work, the the 
website needs to be refreshed at exactly that time. Is there anyway to make 
it reset at that time without having a user refresh the page.

I haven't hosted the app yet.

(This might be a simple question, I'm new to python/Django)

Thanks

Jake

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




DjangoSEO framework.....seo_mymetadatamodelinstance._content_type_id may not be NULL

2012-08-11 Thread Jak
I am trying to install the djangoSEO framework, and I'm having some 
difficultly. The models are showing up in the admin, but when I click save 
after adding the meta tags I get 
seo_mymetadatamodelinstance._content_type_id may not be NULL.

I tried googleing this error, but haven't found anything. Any ideas?


Thanks!

Jak

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/DDFrllY0yC4J.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Getting images to appear in html using Django.

2012-07-09 Thread Jak
I figured it out. I put the Media folder on the same level as a the
mysite folder and now it seems to work. I think it was a django noob
error.


MEDIA_ROOT ='/Users/Jak/projects/fap/media/'

MEDIA_URL = '/media/'

TEMPLATE_DIRS = (
'/Users/Jak/projects/fap/mysite/templates',

urls.py
(r'^media/(?P.*)$', 'django.views.static.serve',
{'document_root': settings.MEDIA_ROOT}),

HTML



Thanks!

On Jul 9, 7:50 am, Rohan <roha...@gmail.com> wrote:
> Hi Jak,
> I would suggest removing the "," after MEDIA_ROOT in your settings file
> if it indeed is there. Could you also be a little more specific about
> the problem. Is the rest of the page loading fine? and if it is, do you
> see /media/ being pre-pended to your file name when you see the source
> of your html page? Are you getting a page not found error when you're
> trying to access the image directly ( /media/FAPLogo.jpg) ?
>
> Additionally, are you by chance pointing ADMIN_MEDIA_PREFIX  in your
> settings.py to /media/ as well?
>
> On 7/8/2012 6:30 PM, Jak wrote:
>
>
>
>
>
>
>
> > Update:
>
> > I'm now using requestcontext in my view.
>
> > my new view is
> > from django.http import HttpResponse
> > from django.shortcuts import render_to_response
> > from django.template.loader import get_template
> > from django.template import RequestContext
>
> > def homepage(request):
> >      return render_to_response ('index.html',
>
> > context_instance=RequestContext(request))
>
> > But it's still not working.
>
> > Thanks again!
>
> > On Jul 8, 5:26 pm, Jak <jacob.wisch...@gmail.com> wrote:
> >> Hello All,
>
> >> I am new to Django and I'm trying to create a simple website. I am
> >> trying to get an jpg to appear in the base template but I cant get it
> >> to show up.
>
> >> In setting.py
> >> MEDIA_ROOT = '/Users/Jak/projects/fap/mysite/media',
> >> MEDIA_URL = '/media/'
>
> >> urls.py
> >> (r'^media/(?P.*)$', 'django.views.static.serve',
> >>                   {'document_root': settings.MEDIA_ROOT}),
>
> >> HTML
> >>   
>
> >> views.py
> >> from django.http import HttpResponse
> >> from django.shortcuts import render_to_response
> >> from django.template.loader import get_template
>
> >> def homepage(request):
> >>      return render_to_response ('index.html')
>
> >> any ideas on what the problem could be? I dont get an error when I run
> >> the server.
>
> >> Thanks
>
> >> Jak

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Getting images to appear in html using Django.

2012-07-08 Thread Jak
Update:

I'm now using requestcontext in my view.

my new view is
from django.http import HttpResponse
from django.shortcuts import render_to_response
from django.template.loader import get_template
from django.template import RequestContext

def homepage(request):
return render_to_response ('index.html',
 
context_instance=RequestContext(request))

But it's still not working.

Thanks again!

On Jul 8, 5:26 pm, Jak <jacob.wisch...@gmail.com> wrote:
> Hello All,
>
> I am new to Django and I'm trying to create a simple website. I am
> trying to get an jpg to appear in the base template but I cant get it
> to show up.
>
> In setting.py
> MEDIA_ROOT = '/Users/Jak/projects/fap/mysite/media',
> MEDIA_URL = '/media/'
>
> urls.py
> (r'^media/(?P.*)$', 'django.views.static.serve',
>                  {'document_root': settings.MEDIA_ROOT}),
>
> HTML
>  
>
> views.py
> from django.http import HttpResponse
> from django.shortcuts import render_to_response
> from django.template.loader import get_template
>
> def homepage(request):
>     return render_to_response ('index.html')
>
> any ideas on what the problem could be? I dont get an error when I run
> the server.
>
> Thanks
>
> Jak

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Getting images to appear in html using Django.

2012-07-08 Thread Jak
Hello All,

I am new to Django and I'm trying to create a simple website. I am
trying to get an jpg to appear in the base template but I cant get it
to show up.

In setting.py
MEDIA_ROOT = '/Users/Jak/projects/fap/mysite/media',
MEDIA_URL = '/media/'

urls.py
(r'^media/(?P.*)$', 'django.views.static.serve',
 {'document_root': settings.MEDIA_ROOT}),

HTML
 

views.py
from django.http import HttpResponse
from django.shortcuts import render_to_response
from django.template.loader import get_template

def homepage(request):
return render_to_response ('index.html')

any ideas on what the problem could be? I dont get an error when I run
the server.


Thanks

Jak

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



CSS not appearing in production mode.

2012-06-17 Thread Jak
Hello All,

I am having a difficult time getting the CSS for my web app to appear when 
I turn debug mode to false. When debug mode = True all the images show up 
fine, but when I turn it to false only the html appears. What do you think 
could be happening?


Thanks

Jak

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/BNfAFDsMhhsJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django/Python Circular model reference

2012-06-01 Thread Jak
When I use 'Question' as a string i get the following error "Error:
One or more models did not validate:
users.answer: Reverse query name for m2m field 'customer_response'
clashes with m2m field 'Question.answer'. Add a related_name argument
to the definition for 'customer_response'.


Think of it kind of like a conversation.

Person A asks a question
Person B answers
Person A asks another question
Person B gives a different answer.

So for every question there could be an answer and for every answer
there could be another question

Thanks again!

On Jun 1, 12:51 pm, Simone Federici <s.feder...@gmail.com> wrote:
> you can use 'Question' as String (lazy reference)
> ManyToMany('Question')
>
> but I don't really undestand your relations
>
> On Fri, Jun 1, 2012 at 6:42 PM, Kevin Anthony 
> <kevin.s.anth...@gmail.com>wrote:
>
>
>
>
>
>
>
> > Define it in one and back reference it in the other
>
> > Kevin
> > Please excuse brevity, sent from phone
> > On Jun 1, 2012 12:38 PM, "Jak" <jacob.wisch...@gmail.com> wrote:
>
> >> The problem that I'm having is that the model "Question" is not
> >> defined since I am referencing it after I use it in the Answer
> >> model.
>
> >> Thanks
>
> >> Jak
>
> >> On Jun 1, 12:08 pm, Javier Guerra Giraldez <jav...@guerrag.com> wrote:
> >> > On Fri, Jun 1, 2012 at 10:42 AM, Jak <jacob.wisch...@gmail.com> wrote:
> >> > > Each answer has
> >> > > a question, and each question has an answer
>
> >> > use OneToOneField relationships
> >> > (https://docs.djangoproject.com/en/1.4/ref/models/fields/#onetoonefield
> >> )
>
> >> > --
> >> > Javier
>
> >> --
> >> You received this message because you are subscribed to the Google Groups
> >> "Django users" group.
> >> To post to this group, send email to django-users@googlegroups.com.
> >> To unsubscribe from this group, send email to
> >> django-users+unsubscr...@googlegroups.com.
> >> For more options, visit this group at
> >>http://groups.google.com/group/django-users?hl=en.
>
> >>  --
> > You received this message because you are subscribed to the Google Groups
> > "Django users" group.
> > To post to this group, send email to django-users@googlegroups.com.
> > To unsubscribe from this group, send email to
> > django-users+unsubscr...@googlegroups.com.
> > For more options, visit this group at
> >http://groups.google.com/group/django-users?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django/Python Circular model reference

2012-06-01 Thread Jak
The problem that I'm having is that the model "Question" is not
defined since I am referencing it after I use it in the Answer
model.


Thanks

Jak

On Jun 1, 12:08 pm, Javier Guerra Giraldez <jav...@guerrag.com> wrote:
> On Fri, Jun 1, 2012 at 10:42 AM, Jak <jacob.wisch...@gmail.com> wrote:
> > Each answer has
> > a question, and each question has an answer
>
> use OneToOneField relationships
> (https://docs.djangoproject.com/en/1.4/ref/models/fields/#onetoonefield)
>
> --
> Javier

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Django/Python Circular model reference

2012-06-01 Thread Jak
Hi all,

I am trying to create two django models that reference each other. 1
model is a question and the other model is an answer. Each answer has
a question, and each question has an answer. I cant seem to get it to
work without error. Below is the code.

from django.db import models


class Answer(models.Model):
title = models.CharField(max_length = 50)
answer = models.CharField(max_length = 400)
customer_response = models.ManyToManyField(Question)
def __unicode__(self):
return self.title

class Question(models.Model):
title = models.CharField(max_length = 50)
response = models.CharField(max_length = 400)
answer = models.ManyToManyField(Answer)
def __unicode__(self):
return self.title



Thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Cant get spatialite and pysqlite working

2012-03-28 Thread Jak
We have a Django aplication which depends on Spatialite and Pysqlite.
It works well for testing under Ubuntu, but when we try to install it
on the server, we are getting the following error after installing
PySqlite. We did set it up with define=OMIT_SQLITE_LOAD_EXTENSION
commented out:
django.core.exceptions.ImproperlyConfigured: The pysqlite library does
not support C extension loading. Both SQLite and pysqlite must be
configured to allow the loading of extensions to use SpatiaLite.

What could be causing this?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Hosting tutorials

2012-03-28 Thread Jak
Hello All,

I am new to programming, and I have spent the year learning HTML, CSS,
Python, and now Django. I can build a basic dynamic site on the
development server, but I have no idea how to share this site with the
world. The Django deployment section in the Django book is difficult
to understand. What do I need to know before I can begin hosting my
projects. Do I need to know apache? I'm not even entirely sure how
servers work. I read the w3schools sever tutorial, but it only
describes what a server is, not how or what you need to host your
site. Does anyone know of any good tutorials for beginners?

Thanks

Programming noob

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.