How to cache a dynamic web page in django

2014-08-06 Thread Chen Xu
Hi Everyone, I have a dynamic page which generates some data from the database, but the content in the database might be the same for everyone or for a long time, so I wonder what is the best way to cache the page so that it won't be talking to the database every time? Thanks -- ⚡ Chen Xu ⚡

Re: admin site not available after modifying base_site.html

2014-08-06 Thread Eric G
Yeah, I tried running the runserver.py script from the django-trunk file, and the error message was: ImportError: Could not import settings 'myproject.settings.admin' (Is it on sys.path? Is there an import error in the settings file?): No module named myproject.settings.admin On Wednesday, Aug

Re: admin site not available after modifying base_site.html

2014-08-06 Thread Collin Anderson
Is there an error message on the runserver console? Or is it possible to start a new one? -- 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..

Re: admin site not available after modifying base_site.html

2014-08-06 Thread Eric G
On Wednesday, August 6, 2014 6:26:50 AM UTC-7, juantonio v wrote: > > No estás haciendo la referencia al archivo por el nombre. Renombrado tu > archivo HTML a base.html So I'm supposed to modify the base.html file instead of the base-site.html file? > On Wednesday, August 6, 2014 11:34:07 A

Re: admin site not available after modifying base_site.html

2014-08-06 Thread Amol
Did you make sure to uncomment the admin auto discover in urls.py and installed apps in settings? I find it easy to overlook those things and causes major headache. On Wednesday, August 6, 2014 1:43:34 AM UTC-7, Eric G wrote: > > Hey everyone, > > I was doing the "Writing your first Django App,

Re: admin site not available after modifying base_site.html

2014-08-06 Thread Collin Anderson
is your dev server (runserver) still running? -- 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, s

Re: admin site not available after modifying base_site.html

2014-08-06 Thread François Schiettecatte
This suggests the server is not running, can you get to http://127.0.0.1:8000/ ? On Aug 6, 2014, at 2:30 PM, Eric G wrote: > I'm on Google Chrome, so it reads, "This webpage is not available." > > On Wednesday, August 6, 2014 5:27:12 AM UTC-7, Collin Anderson wrote: > Now the 127.0.0.1:8000/a

Re: admin site not available after modifying base_site.html

2014-08-06 Thread Eric G
I'm on Google Chrome, so it reads, "This webpage is not available." On Wednesday, August 6, 2014 5:27:12 AM UTC-7, Collin Anderson wrote: > > Now the 127.0.0.1:8000/admin/ site isn't available. > > > What happens when you try? > -- You received this message because you are subscribed to the Goo

Re: nginx and django without virtualenv

2014-08-06 Thread Bill Freeman
Right. I thought of that later. But virtualenv or not is still just a different sys.path, and you still have to have your stuff installed in the correct python. On Wed, Aug 6, 2014 at 1:53 PM, Bill Freeman wrote: > Though if he's moving to nginx, thus not mod_wsgi, I guess it doesn't > matter

Re: nginx and django without virtualenv

2014-08-06 Thread Bill Freeman
Though if he's moving to nginx, thus not mod_wsgi, I guess it doesn't matter what mod_wsgi is linked against. On Wed, Aug 6, 2014 at 1:49 PM, Collin Anderson wrote: > Actually, that's a good point. I always use the same python version that's > linked with mod_wsgi. I don't use a virtualenv to u

RE: nginx and django without virtualenv

2014-08-06 Thread Paul Greenberg
Bill, I see. However, I wanted to try uwsgi instead of mod_wsgi. I will be using nginx, not Apache. Best Regards, Paul Greenberg, Esq. Law Office of Paul Greenberg 530 Main Street, Suite 102 Fort Lee, NJ 07024 E-mail: p...@greenberg.pro Tel: 201-402-6777 Fax: 201-301-8876 Cell: 212-380-73

Re: nginx and django without virtualenv

2014-08-06 Thread Collin Anderson
Actually, that's a good point. I always use the same python version that's linked with mod_wsgi. I don't use a virtualenv to use a different python version. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop

RE: nginx and django without virtualenv

2014-08-06 Thread Paul Greenberg
Collin, I will be running it with p3.4. How is the performance of it? Best Regards, Paul Greenberg, Esq. Law Office of Paul Greenberg 530 Main Street, Suite 102 Fort Lee, NJ 07024 E-mail: p...@greenberg.pro Tel: 201-402-6777 Fax: 201-301-8876 Cell: 212-380-7343 Web: http://www.greenberg.p

Re: nginx and django without virtualenv

2014-08-06 Thread Bill Freeman
Performance *should* be identical. All that virtualenv does (from the point of view of the executing python program) is to change how sys.prefix and sys.exec_prefix are set, and thus, how sys.path is calculated. But with a vanilla sys.path, you need to be sure that django, your other dependencies

Re: nginx and django without virtualenv

2014-08-06 Thread Collin Anderson
Personally, in my `manage.py and `wsgi.py, I have the line: import site site.addsitedir('/path/to/virtenv/lib/python2.7/site-packages') Actually, truthfully, I've merged wsgi.py and manage.py into one manage.py) #!/usr/bin/env python import os import site import sys sys.dont_write_bytecode = Tru

nginx and django without virtualenv

2014-08-06 Thread Paul Greenberg
All, I was running django with Apache and mod_wsgi for a while. Now, I am planning to run django without virtualenv. Although, it seems virtualenv might help. http://uwsgi-docs.readthedocs.org/en/latest/tutorials/Django_and_nginx.html Any pointers? Performance issues? Best Regards, Paul Gre

Re: seeting ur django site doamin name

2014-08-06 Thread Collin Anderson
Generally with apache you set up the domain name using ServerName in VirtualHost. http://httpd.apache.org/docs/2.4/vhosts/name-based.html -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails f

Re: urlconf problem

2014-08-06 Thread Joel Goldstick
On Wed, Aug 6, 2014 at 8:22 AM, Collin Anderson wrote: > shouldn't it be: > > urlpatterns = patterns('', > ) > Thanks for catching that! As it ended up, the problem was in the blog_app view code. When I ported from earlier version I had to edit some things, and I had bad code in the view that ne

seeting ur django site doamin name

2014-08-06 Thread ngangsia akumbo
I AM CURRENTLY DEPLOYING DJANGO WITH APACHE I WISH TO SET THE MAIN DOMAIN NAME I HAVE THE FOLLOWING URLS from django.conf.urls import patterns, include, url from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', #new urls url(r'^blog/$', 'blog.view

AppRegistryNotReady trying to access model's verbose name

2014-08-06 Thread Stodge
I'm trying to port my Django project to Dango 1.7rc2 but I'm hitting the app registry error. I know that this is mentioned in the Troubleshooting section of the documentation but I don't understand why this is happening. __init__.py", line 44, in register_layer layer['verbose_name'] = model.

Re: guinicorn

2014-08-06 Thread ngangsia akumbo
(testproject)yems@localhost ~/Documents/testproject $ gunicorn_django --bind localhost:8000 !!! !!! WARNING: This command is deprecated. !!! !!! You should now run your application with the WSGI interface !!! installed with your project. Ex.: !!! !!! gunicorn myproject.wsgi:appli

guinicorn

2014-08-06 Thread ngangsia akumbo
i am trying to host my site with gunicorn i get this error !!! !!! WARNING: This command is deprecated. !!! !!! You should now run your application with the WSGI interface !!! installed with your project. Ex.: !!! !!! gunicorn myproject.wsgi:application !!! !!! See https://

Re: deploying django

2014-08-06 Thread ngangsia akumbo
Thanks bro will chceck if it works On Wednesday, August 6, 2014 1:26:06 PM UTC+1, Collin Anderson wrote: > > It would look like this: > > > WSGIScriptAlias / /home/yems/Documents/testproject/hotel/hotel/wsgi.py > > WSGIPythonPath /home/yems/Documents/testproject

Re: Using an application is more than one other application

2014-08-06 Thread Some Developer
On 06/08/2014 15:09, Collin Anderson wrote: I recommend in Application B's templates pulling in the data from Application A using an assignment tag. https://docs.djangoproject.com/en/dev/howto/custom-template-tags/#assignment-tags Otherwise, in Application B's views, you can always: from appa.

Re: Using an application is more than one other application

2014-08-06 Thread Collin Anderson
I recommend in Application B's templates pulling in the data from Application A using an assignment tag. https://docs.djangoproject.com/en/dev/howto/custom-template-tags/#assignment-tags Otherwise, in Application B's views, you can always: from appa.models import Message -- You received this mes

Using an application is more than one other application

2014-08-06 Thread Some Developer
Hi, I have a Django application that I want to provide a global messaging system that can be used in all the applications in my project. So for instance if someone sends a message to a user while using Application A then the user should be able to access the message from Application B. But I'

admin site not available after modifying base_site.html

2014-08-06 Thread juantonio v
No estás haciendo la referencia al archivo por el nombre. Renombrado tu archivo HTML a base.html -- 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+un

Re: admin site not available after modifying base_site.html

2014-08-06 Thread Collin Anderson
> > Now the 127.0.0.1:8000/admin/ site isn't available. What happens when you try? -- 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...@g

Re: deploying django

2014-08-06 Thread Collin Anderson
It would look like this: WSGIScriptAlias / /home/yems/Documents/testproject/hotel/hotel/wsgi.py WSGIPythonPath /home/yems/Documents/testproject/hotel Require all granted -- You received this message because you are subscribed to the Google Groups "Djan

Re: urlconf problem

2014-08-06 Thread Collin Anderson
shouldn't it be: urlpatterns = patterns('', ) And blog_app/__init__.py and blog_app/urls.py exist? Could you include a longer traceback? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails

admin site not available after modifying base_site.html

2014-08-06 Thread Eric G
Hey everyone, I was doing the "Writing your first Django App, part 2" tutorial when I got to the portion where I customize the project's template. I must have screwed up by overriding the base_site.html code in the source file with the default file. Now the 127.0.0.1:8000/admin/ site isn't avai

Re: deploying django

2014-08-06 Thread ngangsia akumbo
Please i have a question here is the path to my django project (testproject)yems@yems ~/Documents/testproject/hotel $ (testproject)yems@yems ~/Documents/testproject/hotel $ ls blog event gallery home hotel manage.py yems (testproject)yems@yems ~/Documents/testproject/hotel $ cd event (t

Re: deploying django

2014-08-06 Thread ngangsia akumbo
i migrated everything in to linux mint On Tuesday, August 5, 2014 5:17:22 PM UTC+1, Jeff Trawick wrote: > > On Monday, August 4, 2014 6:12:16 PM UTC-4, Adrian Marshall wrote: >> >> I've went through a few different ways. If your set on using apache, >> Configure Apache with Mod-WSGI on a server

Re: urlconf problem

2014-08-06 Thread Erik Cederstrand
Den 06/08/2014 kl. 01.00 skrev Joel Goldstick : > I have this: > > from django.conf.urls import patterns, include, url > > from django.contrib import admin, admindocs > import blog_app > > admin.autodiscover() > > patterns = patterns('', >url(r'^admin/doc/', include(admindocs.urls)), >