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)),
>url(r'^blog/', include(blog_app.urls)),
>url(r'^admin/', include(admin.site.urls)),
> )
> 
> i am using virtualenv, django 1.6
> 
> I get this error:
> 
> Exception Value:
> 
> 'module' object has no attribute 'urls'
> 
> Exception Location:
> /home/jcg/code/python/venvs/joelgoldstick.com.16/blog/blog/urls.py in
> , line 9

You need to actually import the urls module from admindocs (and the other 
modules):

Either:

   from django.contrib.admindocs import urls as admindocs_urls
   url(r'^admin/doc/', include(admindocs_urls)),

Or:

   import django.contrib.admindocs.urls
   url(r'^admin/doc/', include(django.contrib.admindocs.urls)),

> It worked earlier today.  I think I have a typo but can't find it.

That's what a version control system is for :-)

Erik

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/8783998F-37F1-47DA-AD7F-B1599F40B49A%40cederstrand.dk.
For more options, visit https://groups.google.com/d/optout.


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.
>>
>> Here's a Good Tutorial: 
>> http://thecodeship.com/deployment/deploy-django-apache-virtualenv-and-mod_wsgi/
>>
>> If you're having trouble with that and your app isn't too demanding you 
>> can easily upload on Heroku and control it easily using Git commands.
>>
>> check out the docs: 
>> https://devcenter.heroku.com/articles/getting-started-with-django
>>
>> An alternative to both of those would be to use Nginx with uWSGI. If you 
>> want to go that route here's a good tutorial:
>>
>> http://uwsgi-docs.readthedocs.org/en/latest/tutorials/Django_and_nginx.html#concept
>>
>
> As if that weren't enough, you can deploy with Apache httpd proxy + uWSGI 
> in a very similar manner to Nginx + uWSGI. Some may find that more natural 
> than with mod_wsgi.  You can see how similar it can be to an Nginx setup at 
> http://emptyhammock.com/projects/info/pyweb/
>
> But the op says "wamp" which usually means Windows.
>
> gunicorn isn't for Windows, uWSGI 1.9 docs mention some experimental 
> Cygwin port.  What's a suitable production-ready Python "app server" for 
> Windows that would work with Apache httpd or Nginx?  Maybe Apache httpd + 
> mod_wsgi is the way to go there.  (shrug)
>
>
>
>>
>> Good luck!
>>
>> On Monday, August 4, 2014 4:53:00 AM UTC-4, ngangsia akumbo wrote:
>>>
>>> I have created a complete site, 
>>>
>>> i have configured it to run with mysql using wamp
>>>
>>> i have also configured apache in wamp which is up and running
>>>
>>> so i want to deploy the site to run as a life page on the internet using 
>>> apache
>>>
>>> what should i do next
>>>
>>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/b679530d-36c9-4b66-86ed-892d5d6553b1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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
(testproject)yems@yems ~/Documents/testproject/hotel/event $ ls
admin.py  admin.pyc  __init__.py  __init__.pyc  models.py  models.pyc  
templates  tests.py  views.py  views.pyc
(testproject)yems@yems ~/Documents/testproject/hotel/event $ 


I have to add this at the bottom of my httpd.conf file in the apache

WSGIScriptAlias / /path/to/mysite.com/mysite/wsgi.pyWSGIPythonPath 
/path/to/mysite.com
Require all 
granted

so how can i add this path , am some how confused here




-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/e561dfaa-7d91-41e1-9289-03498e0c31db%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 available. How 
can I make the admin site accessible again? I changed the source file's 
base_site.html code to the one shown in 
here 
https://github.com/django/django/blob/master/django/contrib/admin/templates/admin/base_site.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+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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d486a734-55be-4752-929e-918d544fd107%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/aaeab2f7-5fb9-41cf-8839-87435eb62def%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 
"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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/3ed37d9f-3168-4586-b110-da01a298f619%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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...@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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/e1fe0dfb-82ac-4eb5-993e-8f3e0011e857%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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+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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/5fadf3c7-82a2-462e-aa93-ab877618297b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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'm unsure how best to implement this.


I have application A set up with the models and views for the messaging 
part but say if I want a notification of new messages whilst the user is 
viewing a page from Application B I have no idea how to make sure that 
the information is available on views from other applications.


I know this is possible because there are other Django applications that 
seem to do similar things. I've never written a Django application that 
was meant to be used by more than one other application so I'm kind of 
in the dark on this one.


Hopefully I've explained what I want to do sufficiently. If not just ask 
and I'll try and clarify.


Thanks for any help!

--
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/53E235C2.1000909%40googlemail.com.
For more options, visit https://groups.google.com/d/optout.


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 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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFO84S7Sma0J%2BEJ0LTvGgMNP2gZ6aX8hje4Mo8hiMr4Rz1q3OQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


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.models 
import Message


Ah, cool. I didn't think of custom tags. Thanks for the link.

Any other advice is always welcome.

--
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/53E238A4.6020005%40googlemail.com.
For more options, visit https://groups.google.com/d/optout.


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/hotel
>
> 
> 
> Require all granted
> 
> 
>
>
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/16cf0ea4-b324-4d0e-901f-f22839dd82e5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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://docs.djangoproject.com/en/1.5/howto/deployment/wsgi/gunicorn/
!!! for more info.
!!!


when i run this commane within my env


(testproject)yems@localhost ~/Documents/testproject $ gunicorn_django 
--bind localhost:8001\

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/0dc233cb-85ed-46f8-8215-30390523bec3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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:application
!!! 
!!! See 
https://docs.djangoproject.com/en/1.5/howto/deployment/wsgi/gunicorn/
!!! for more info.
!!!

Traceback (most recent call last):
  File "/usr/local/bin/gunicorn_django", line 11, in 
sys.exit(run())
  File "/usr/local/lib/python2.7/dist-packages/gunicorn/app/djangoapp.py", 
line 160, in run
DjangoApplication("%(prog)s [OPTIONS] [SETTINGS_PATH]").run()
  File "/usr/local/lib/python2.7/dist-packages/gunicorn/app/base.py", line 
185, in run
super(Application, self).run()
  File "/usr/local/lib/python2.7/dist-packages/gunicorn/app/base.py", line 
71, in run
Arbiter(self).run()
  File "/usr/local/lib/python2.7/dist-packages/gunicorn/arbiter.py", line 
169, in run
self.manage_workers()
  File "/usr/local/lib/python2.7/dist-packages/gunicorn/arbiter.py", line 
477, in manage_workers
self.spawn_workers()
  File "/usr/local/lib/python2.7/dist-packages/gunicorn/arbiter.py", line 
542, in spawn_workers
time.sleep(0.1 * random.random())
  File "/usr/local/lib/python2.7/dist-packages/gunicorn/arbiter.py", line 
209, in handle_chld
self.reap_workers()
  File "/usr/local/lib/python2.7/dist-packages/gunicorn/arbiter.py", line 
459, in reap_workers
raise HaltServer(reason, self.WORKER_BOOT_ERROR)
gunicorn.errors.HaltServer: 


On Wednesday, August 6, 2014 3:25:00 PM UTC+1, ngangsia akumbo wrote:
>
> 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://docs.djangoproject.com/en/1.5/howto/deployment/wsgi/gunicorn/
> !!! for more info.
> !!!
>
>
> when i run this commane within my env
>
>
> (testproject)yems@localhost ~/Documents/testproject $ gunicorn_django 
> --bind localhost:8001\
>
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/6fa67f83-f007-47f4-b855-ce0a0289b6e4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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._meta.verbose_name.capitalize()
  File "/usr/lib/python2.7/site-packages/django/utils/functional.py", line 
132, in __wrapper__
res = func(*self.__args, **self.__kw)
  File 
"/usr/lib/python2.7/site-packages/django/utils/translation/__init__.py", 
line 83, in ugettext
return _trans.ugettext(message)
  File 
"/usr/lib/python2.7/site-packages/django/utils/translation/trans_real.py", 
line 325, in ugettext
return do_translate(message, 'ugettext')
  File 
"/usr/lib/python2.7/site-packages/django/utils/translation/trans_real.py", 
line 306, in do_translate
_default = translation(settings.LANGUAGE_CODE)
  File 
"/usr/lib/python2.7/site-packages/django/utils/translation/trans_real.py", 
line 209, in translation
default_translation = _fetch(settings.LANGUAGE_CODE)
  File 
"/usr/lib/python2.7/site-packages/django/utils/translation/trans_real.py", 
line 189, in _fetch
"The translation infrastructure cannot be initialized before the "
django.core.exceptions.AppRegistryNotReady: The translation infrastructure 
cannot be initialized before the apps registry is ready. Check that you 
don't make non-lazy gettext calls at import time.


The model's verbose name is a translated string, but models.py uses 
ugettext_lazy so I don't understand why it ends up using ugettext. Thanks

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/05bc2654-278d-4824-b15f-a9b8a671fb59%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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.views.list_post'),

url(r'^blog/(?P\d+)/$', 'blog.views.detail_post'),

 

#events urls

url(r'^event/$', "event.views.list_event"),

url(r'^event/(?P\d+)/$', "event.views.detail_event"),

 

#image urls

url(r'^gallery/$', "gallery.views.list_gallery"),

url(r'^gallery/(?P\d+)/$', "gallery.views.detail_gallery"),

#url(r'^gallery/(?P\d+)/album/$', 
"gallery.views.detail_album"),

 

 

#HOME URL

url(r'^home/$', "home.views.list_home"),   

url(r'^home/(?P\d+)/$', "home.views.detail_home"),

 

#pages

#('^pages/', include('django.contrib.flatpages.urls')),

url(r'^admin/', include(admin.site.urls)),

)


HOW DO I SET THE DOMAIN NAME LET SAY THE DOMAIN NAME IS 


www.bamenda.com

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/b3b85e8e-bfbf-433f-be34-1d426181d0b6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 never ran, so my blog_app stuff worked, but when
admin inspects the modules, it apparently couldn't resolve something.
I fixed my view code, then admin stuff worked.

thanks all.

Put into git ;)


-- 
Joel Goldstick
http://joelgoldstick.com

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPM-O%2BwZ4DMzU0iOa2u08OtLQRuukhLFzMPYgu6Bo4Tg-VZ_6w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


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 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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFO84S5DwT_CGwcs7KjUfwz8R65AiX3nV3e%2BMC1OxJdTEgpSQg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


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 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
Web: http://www.greenberg.pro/
Twitter: @nymetrolaw

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/1407345736984.18318%40greenberg.pro.
For more options, visit https://groups.google.com/d/optout.


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 = True  # don't write .pyc files
sys.path.append(os.path.dirname(__file__))
site.addsitedir('/path/to/virtenv/lib/python2.7/site-packages')
os.environ['DJANGO_SETTINGS_MODULE'] = 'demo.settings'


if __name__ == '__main__':  # command line
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
else:  # wsgi
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()


-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/0bee8b3c-d291-42b4-b0a8-9e443cb22f0b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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, and your project are all still found.  (Installing django in
a virtualenv does *NOT* also install it in the main python (actually, it's
the python that mod_wsgi is linked against that counts).


On Wed, Aug 6, 2014 at 1:22 PM, Paul Greenberg  wrote:

>  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 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
> Web: http://www.greenberg.pro/
> Twitter: @nymetrolaw
>
>--
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/1407345736984.18318%40greenberg.pro
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAB%2BAj0vZJLX4f-5e9-hNXkHGkdLDDXU7UWZy7%3D-E_feF2yoBcQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


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.pro/
Twitter: @nymetrolaw



From: django-users@googlegroups.com  on behalf 
of Collin Anderson 
Sent: Wednesday, August 06, 2014 1:38 PM
To: django-users@googlegroups.com
Subject: Re: nginx and django without virtualenv

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 = True  # don't write .pyc files
sys.path.append(os.path.dirname(__file__))
site.addsitedir('/path/to/virtenv/lib/python2.7/site-packages')
os.environ['DJANGO_SETTINGS_MODULE'] = 'demo.settings'


if __name__ == '__main__':  # command line
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
else:  # wsgi
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()



--
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/0bee8b3c-d291-42b4-b0a8-9e443cb22f0b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/1407347216210.7377%40greenberg.pro.
For more options, visit https://groups.google.com/d/optout.


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 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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFO84S6UhP0OKPSNDCFaLfqf_u_Lgc9ANpEq9cqGuhdpY%2BvEzQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


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-7343
Web: http://www.greenberg.pro/
Twitter: @nymetrolaw




From: django-users@googlegroups.com  on behalf 
of Bill Freeman 
Sent: Wednesday, August 06, 2014 1:47 PM
To: django-users
Subject: Re: nginx and django without virtualenv

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, and your project are all still found.  (Installing django in a 
virtualenv does *NOT* also install it in the main python (actually, it's the 
python that mod_wsgi is linked against that counts).


On Wed, Aug 6, 2014 at 1:22 PM, Paul Greenberg 
mailto:p...@greenberg.pro>> wrote:

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 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
Web: http://www.greenberg.pro/
Twitter: @nymetrolaw


--
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/1407345736984.18318%40greenberg.pro.
For more options, visit https://groups.google.com/d/optout.


--
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAB%2BAj0vZJLX4f-5e9-hNXkHGkdLDDXU7UWZy7%3D-E_feF2yoBcQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/1407347519429.77187%40greenberg.pro.
For more options, visit https://groups.google.com/d/optout.


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 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 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAFO84S6UhP0OKPSNDCFaLfqf_u_Lgc9ANpEq9cqGuhdpY%2BvEzQ%40mail.gmail.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAB%2BAj0t2G2PKuufbrCi0kjm2yvTUfyKQQW0XvJf62PLjzgd2DA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


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 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 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 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.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAFO84S6UhP0OKPSNDCFaLfqf_u_Lgc9ANpEq9cqGuhdpY%2BvEzQ%40mail.gmail.com
>> 
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAB%2BAj0vHqKopXN5nRGPgf-_5Ysi7JiGs0DYXyAsoKgbsxBPh7g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


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 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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/47004884-88cc-47ee-8416-ee384e3d1b3f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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/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...@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.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/47004884-88cc-47ee-8416-ee384e3d1b3f%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/BEE4EA98-78E7-4625-98D6-07FF9EF7F231%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


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, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFO84S5aOZXhbae8ymR7nEuL%2BMmHXs784qV4qikyownr2d5KPw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


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, 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 available. How 
> can I make the admin site accessible again? I changed the source file's 
> base_site.html code to the one shown in here 
> https://github.com/django/django/blob/master/django/contrib/admin/templates/admin/base_site.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+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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/6d8ee5f1-9933-41f8-b332-a26c78c0b6e0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 AM UTC-7, François Schiettecatte 
wrote:
>
> This suggests the server is not running, can you get to 
> http://127.0.0.1:8000/  ? 


No, I can't get to that either. 

On Wednesday, August 6, 2014 11:33:57 AM UTC-7, Collin Anderson wrote:
>
> is your dev server (runserver) still running? 


I don't think so. The server was okay right until I made changes the 
base_site.html file. 

On Wednesday, August 6, 2014 2:55:03 PM UTC-7, Amol wrote:
>
> 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. 
>

Yeah, I checked, and those are uncommented. 
 
 

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/e5324be4-6093-40a0-b1b7-5c8d9cee0e65%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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...@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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFO84S51oGXcMnVkKT5aNB-SC5%2BupQ64nZV0VozitSHqZ0vCXA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


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, August 6, 2014 5:41:55 PM UTC-7, Collin Anderson wrote:
>
> 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...@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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/07ae093a-0b58-4049-aeaf-27a02dee6f1f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 ⚡

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CACac-qZUVO289z3Z9s7DziMOhbwYES_Jtv_7tpjH8xMp9-oEEw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.