Re: django_nose failing to discover tests

2013-01-03 Thread eculver
I think the trick is in the name of the module and/or test case. I can't 
remember exactly how django-nose modifies test discovery but here's what 
nose does alone:

https://nose.readthedocs.org/en/latest/finding_tests.html

Try renaming the test class to something that begins with "Test" -- so like 
"TestAccounts" and then use "test_something", "test_something_else" types 
of names for methods. I think that this should work.

If all else fails, you can always point to the module directly:

./manage.py test myproject.accounts.tests.test_account.AccountTest

You may also try adding '--all-modules' to NOSE_ARGS in your project 
settings:

NOSE_ARGS = [
...
'--all-modules'
]

or by passing "--all-modules" directly to ./manage.py:

./manage.py test --all-modules

Hope this helps.

--Evan


On Monday, December 31, 2012 9:41:33 AM UTC-8, Joe Legner wrote:
>
> I am trying to get django_nose to discover tests in my project.  I watched 
> this video which seems to indicate that my project/app/tests/__init__.py 
> should be able to be empty (not contain a bunch of import * statements):
>
> http://pyvideo.org/video/1406/djangos-nasal-passage
>
> The goal is to have django_nose find my tests by name so I do not have to 
> have import * from ... statements within my tests/__init__.py for every 
> app.  My project is set up like this:
>
> /myproject
> /accounts
> __init__.py
> /tests
> __init__.py
> test_account.py
>
> The __init__.py file is empty.  The test_account.py file contains an 
> AccountTest class derived from unittest.TestCase.
>
> When I run ./manage.py test accounts (with an empty __init__.py), the 
> result is "Ran 0 tests in 0.000s"
>
> Now, if I make accounts/tests/__init__.py contain the line from 
> test_account import *, it works correctly; therefore, I believe I do have 
> django_nose (version 1.1 and nose 1.2.1) installed and working.
>
> I Googled all morning to solve the problem but have failed.  If you have 
> any insight, please reply.  Thank you.
>
>

-- 
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/-/GUuMIl4BjwMJ.
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: Admin page not found error

2013-01-03 Thread eculver
Hi,

I have ran into this a few times and it's not exactly obvious what's going 
on. In short, the last line of the exception:

return getpass.getuser().decode(locale.getdefaultlocale()[1])

is somewhat of a hint, if you can even call it that. 

Try setting $LANG in your shell environment. For example, if you're using 
bash/zsh:

export LANG=en_US.UTF-8

For other shells, you may have to use setenv.

That's obviously for US english. You'll have to replace "en_US.UTF-8" with 
your locale string. For more information on that check out:

http://cygwin.com/cygwin-ug-net/setup-locale.html
http://userguide.icu-project.org/locale

or you could even check out the man page:

man locale

Hope this helps.

-Evan



On Friday, December 28, 2012 12:29:50 AM UTC-8, Shahjalal Hossain wrote:
>
>
> 
>
>
> 
>
>
> 
>
> Hi, I am new at Django. I am learning Django from instruction manual "a 
> basic poll application". I was doing step by step. But, at a certain point 
> I stacked. 
>
> It does not shows admin page as "2.4 Writing your first Django app, part 
> 2". I have done all the steps, like uncomment settings.py and urls.py and 
> run the syncdb. I am writing on code on Aptana Studio 3. For convenient, I 
> have given some images. and source files.
>
> Thanks, in advance.
>
> *settings.py*
>
> INSTALLED_APPS = (
> 'django.contrib.auth',
> 'django.contrib.contenttypes',
> 'django.contrib.sessions',
> 'django.contrib.sites',
> 'django.contrib.messages',
> 'django.contrib.staticfiles',
> # Uncomment the next line to enable the admin:
> 'django.contrib.admin',
> # Uncomment the next line to enable admin documentation:
> # 'django.contrib.admindocs',
> 'polls',
> )
>
> *urls.py*
>
> from django.conf.urls import patterns, include, url
>
> # Uncomment the next two lines to enable the admin:
> from django.contrib import admin 
> admin.autodiscover()
>
> urlpatterns = patterns('',
> # Examples:
> # url(r'^$', 'mysite.views.home', name='home'),
> # url(r'^mysite/', include('mysite.foo.urls')),
>
> # Uncomment the admin/doc line below to enable admin documentation:
> # url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
>
> # Uncomment the next line to enable the admin:
> url(r'^admin/', include(admin.site.urls)),
> )
>
>
>
>

-- 
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/-/hEYZPvLCFLMJ.
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: New Relic with Django

2012-01-03 Thread eculver
To answer your question and to address the cost concern, I gave New
Relic a shot because their monitoring service it totally free and it
gives you pretty awesome metrics on all kinds of app and DB level
metrics like memory consumption and response times among many others.

To get started, create a free trial account at New Relic and check out
their guide on getting the python agent installed here:

http://newrelic.com/docs/python/python-agent-installation

Once I had the newrelic package installed and my newrelic.ini file
created via newrelic-admin:

newrelic-admin generate-config LICENSE-KEY newrelic.ini

All I had to do was add two lines to my WSGI handler and it was good
to go. Here is an example of a WSGI handler that works for me:

http://pastie.org/3119693

Hope this helps.

--Evan




On Jan 3, 8:12 am, "Cal Leeming [Simplicity Media Ltd]"
 wrote:
> Argh - sorry again for the email signature on my last response, damn Google
> Mail is driving me a bit nuts and keeps reverting my settings, grr!
>
> Cal
>
>
>
>
>
>
>
> On Tue, Jan 3, 2012 at 2:12 PM, Andre Terra  wrote:
> > newrelic.com
>
> > On Tue, Jan 3, 2012 at 12:09 PM, william ratcliff <
> > william.ratcl...@gmail.com> wrote:
>
> >> Could someone provide a link, or a brief description of "New Relic"
>
> >> Thanks!
>
> >> On Tue, Jan 3, 2012 at 9:00 AM, Cal Leeming [Simplicity Media Ltd] <
> >> cal.leem...@simplicitymedialtd.co.uk> wrote:
>
> >>> Yeah, the pricing is very steep - and is really only suited for
> >>> production systems which are bringing in a decent amount of revenue.
>
> >>> It's a shame no one has brought out an open source version of New Relic
> >>> - if I had the time/funding, I totally would!
>
> >>> Cal
>
> >>> On Tue, Jan 3, 2012 at 1:33 PM, Brian Bouterse wrote:
>
>  Make sure you look at the pricing.  A local startup was very pleased
>  with what new relic's capabilities with Django, but then they looked at 
>  the
>  price ... wow.
>
>  On Tue, Jan 3, 2012 at 4:39 AM, Abhaya Thapa <
>  abhaya.th...@sproutify.com> wrote:
>
> > Hi,
> > I am trying to get stated with new relic on my django app. I am new to
> > new relic. Can you please guide me on steps to get started in
> > developer mode and how to use it in live server.
> > I did try to find tutorials on this, but it looks like I could not
> > find a good one.
>
> > --
> > 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.
>
>  --
>  Brian Bouterse
>  ITng Services
>
>   --
>  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.
>
> >>> --
>
> >>> *Cal Leeming*
> >>> Technical Director - Simplicity Media Ltd
>
> >>> For 24/7 emergency support, please call 02476 970798 *(UK)* or
> >>> 302-111-4902* (US)*
>
> >>> *P** *Please consider the environment before printing this email.
> >>> The information contained in this email is confidential and is intended
> >>> for the use only of the addressee. Any unauthorised dissemination or
> >>> copying of this email and any use or disclosure of information is strictly
> >>> prohibited and may be illegal. Please let us know immediately by 
> >>> telephone,
> >>> if an email has been sent to you in error and return the email to us. 
> >>> Registered
> >>> company number 7143564, Abbey House, Manor Road, Coventry, UK, CV1 2FW.
>
> >>>  --
> >>> 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 grou

Re: Just upgraded to 1.1, can't start development server, TypeError

2010-01-25 Thread eculver
What worked for me was what Evgeny suggested. I blew away all of my
previous Django install and then proceeded to do the happy dance.

On Jan 1, 5:05 pm, davenaff  wrote:
> In my case, I had to remove mysql_replicated as our db backend.  We're
> no longer using mysql_replicated so I haven't tried to find the source
> of the incompatibility, but this was the source of this error message
> for us.
>
> On Nov 10 2009, 12:57 pm, Evgeny  wrote:
>
>
>
> > I think I found a workaround:
> > first completely delete previous django installation, then install
> > 1.1.1
>
> > the problem went away for me after this manipulation.
>
> > On Nov 10, 12:39 pm, Evgeny  wrote:
>
> > > Same problem here. Any ideas?
> > > Thanks!
>
> > > On Oct 14, 7:11 pm, eculver  wrote:
>
> > > > Not so sure about that. Here are my installed apps:
>
> > > > INSTALLED_APPS = (
> > > >     'django.contrib.auth',
> > > >     'django.contrib.contenttypes',
> > > >     'django.contrib.sessions',
> > > >     'django.contrib.sites',
> > > >     'django.contrib.admin',
> > > >     'myproject.api',
> > > >     'myproject.pages',
> > > >     'myproject.contact_form',
> > > >     'myproject.albums',
> > > >     'myproject.paypalcart',
> > > >     'myproject.messaging',
> > > > )
>
> > > > None of them are being pulled from my python path? Am I missing
> > > > something obvious?
>
> > > > On Oct 14, 1:09 am, Lakshman Prasad  wrote:
>
> > > > > Seems like, some of the apps that you have in settings.py 
> > > > > INSTALLED_APPS are
> > > > > there in the pythonpath for python2.5 and not for python2.6.
> > > > > You will need to do a easy_install-2.6 (or a corresponding 
> > > > > pip/distribute
> > > > > equivalent) package_name
>
> > > > > On Wed, Oct 14, 2009 at 11:48 AM, eculver  wrote:
>
> > > > > > I just tried upgrade to django 1.1, ran ./manage.py runserver, but 
> > > > > > was
> > > > > > promptly halted due to this exception:
>
> > > > > > ...
>
> > > > > > File 
> > > > > > "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/
> > > > > > site-packages/django/utils/translation/trans_real.py", line 180, in
> > > > > > _fetch
> > > > > >    app = import_module(appname)
> > > > > >  File "/Library/Frameworks/Python.framework/Versions/2.6/lib/
> > > > > > python2.6/site-packages/django/utils/importlib.py", line 35, in
> > > > > > import_module
> > > > > >    __import__(name)
> > > > > >  File "/Library/Frameworks/Python.framework/Versions/2.6/lib/
> > > > > > python2.6/site-packages/django/contrib/admin/__init__.py", line 1, 
> > > > > > in
> > > > > > 
> > > > > >    from django.contrib.admin.options import ModelAdmin, HORIZONTAL,
> > > > > > VERTICAL
> > > > > >  File "/Library/Frameworks/Python.framework/Versions/2.6/lib/
> > > > > > python2.6/site-packages/django/contrib/admin/options.py", line 5, in
> > > > > > 
> > > > > >    from django.contrib.contenttypes.models import ContentType
> > > > > >  File "/Library/Frameworks/Python.framework/Versions/2.6/lib/
> > > > > > python2.6/site-packages/django/contrib/contenttypes/models.py", line
> > > > > > 1, in 
> > > > > >    from django.db import models
> > > > > >  File "/Library/Frameworks/Python.framework/Versions/2.6/lib/
> > > > > > python2.6/site-packages/django/db/__init__.py", line 57, in 
> > > > > >    'TIME_ZONE': settings.TIME_ZONE,
> > > > > > TypeError: __init__() takes exactly 1 argument (2 given)
>
> > > > > > Everything worked fine in 1.0.4 before the upgrade. Seems like it 
> > > > > > may
> > > > > > be an obvious upgrade problem/oversight on my part. Any ideas?
>
> > > > > --
> > > > > Regards,
> > > > > Lakshman
> > > > > becomingguru.com
> > > > > lakshmanprasad.com

-- 
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...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Just upgraded to 1.1, can't start development server, TypeError

2009-10-14 Thread eculver

Not so sure about that. Here are my installed apps:

INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.admin',
'myproject.api',
'myproject.pages',
'myproject.contact_form',
'myproject.albums',
'myproject.paypalcart',
'myproject.messaging',
)

None of them are being pulled from my python path? Am I missing
something obvious?

On Oct 14, 1:09 am, Lakshman Prasad  wrote:
> Seems like, some of the apps that you have in settings.py INSTALLED_APPS are
> there in the pythonpath for python2.5 and not for python2.6.
> You will need to do a easy_install-2.6 (or a corresponding pip/distribute
> equivalent) package_name
>
>
>
>
>
> On Wed, Oct 14, 2009 at 11:48 AM, eculver  wrote:
>
> > I just tried upgrade to django 1.1, ran ./manage.py runserver, but was
> > promptly halted due to this exception:
>
> > ...
>
> > File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/
> > site-packages/django/utils/translation/trans_real.py", line 180, in
> > _fetch
> >    app = import_module(appname)
> >  File "/Library/Frameworks/Python.framework/Versions/2.6/lib/
> > python2.6/site-packages/django/utils/importlib.py", line 35, in
> > import_module
> >    __import__(name)
> >  File "/Library/Frameworks/Python.framework/Versions/2.6/lib/
> > python2.6/site-packages/django/contrib/admin/__init__.py", line 1, in
> > 
> >    from django.contrib.admin.options import ModelAdmin, HORIZONTAL,
> > VERTICAL
> >  File "/Library/Frameworks/Python.framework/Versions/2.6/lib/
> > python2.6/site-packages/django/contrib/admin/options.py", line 5, in
> > 
> >    from django.contrib.contenttypes.models import ContentType
> >  File "/Library/Frameworks/Python.framework/Versions/2.6/lib/
> > python2.6/site-packages/django/contrib/contenttypes/models.py", line
> > 1, in 
> >    from django.db import models
> >  File "/Library/Frameworks/Python.framework/Versions/2.6/lib/
> > python2.6/site-packages/django/db/__init__.py", line 57, in 
> >    'TIME_ZONE': settings.TIME_ZONE,
> > TypeError: __init__() takes exactly 1 argument (2 given)
>
> > Everything worked fine in 1.0.4 before the upgrade. Seems like it may
> > be an obvious upgrade problem/oversight on my part. Any ideas?
>
> --
> Regards,
> Lakshman
> becomingguru.com
> lakshmanprasad.com
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Just upgraded to 1.1, can't start development server, TypeError

2009-10-13 Thread eculver

I just tried upgrade to django 1.1, ran ./manage.py runserver, but was
promptly halted due to this exception:

...

File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/
site-packages/django/utils/translation/trans_real.py", line 180, in
_fetch
app = import_module(appname)
  File "/Library/Frameworks/Python.framework/Versions/2.6/lib/
python2.6/site-packages/django/utils/importlib.py", line 35, in
import_module
__import__(name)
  File "/Library/Frameworks/Python.framework/Versions/2.6/lib/
python2.6/site-packages/django/contrib/admin/__init__.py", line 1, in

from django.contrib.admin.options import ModelAdmin, HORIZONTAL,
VERTICAL
  File "/Library/Frameworks/Python.framework/Versions/2.6/lib/
python2.6/site-packages/django/contrib/admin/options.py", line 5, in

from django.contrib.contenttypes.models import ContentType
  File "/Library/Frameworks/Python.framework/Versions/2.6/lib/
python2.6/site-packages/django/contrib/contenttypes/models.py", line
1, in 
from django.db import models
  File "/Library/Frameworks/Python.framework/Versions/2.6/lib/
python2.6/site-packages/django/db/__init__.py", line 57, in 
'TIME_ZONE': settings.TIME_ZONE,
TypeError: __init__() takes exactly 1 argument (2 given)

Everything worked fine in 1.0.4 before the upgrade. Seems like it may
be an obvious upgrade problem/oversight on my part. Any ideas?
--~--~-~--~~~---~--~~
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 static files

2009-05-12 Thread eculver

I figured this out. Your advice lead me in the right direction, but I
went ahead and configured my urls.py like this:

# For serving static media files (css, js, images)
if settings.DEBUG:
urlpatterns += patterns('',
(r'^content/(.*)$', 'django.views.static.serve',
{'document_root': os.path.join(settings.PROJECT_PATH, 'content')}),
)

And set my PROJECT_PATH accordingly in settings.py (/home/me/
project_name). I'm thinking that the (r'^media/(.*)$... url pattern
conflicts with django admin URLs and based on the order of inclusion,
overrides what I had as my pattern for serving static files in my
development environment. Either way, it works now. Thanks Tim!

On May 12, 3:53 am, Tim Chase  wrote:
> eculver wrote:
> > I know this one has been covered pretty well, and I'm not a "total"
> > newb todjango, but something alludes me here. Why when I put:
>
> > if settings.DEBUG:
> >    urlpatterns += patterns('',
> >             (r'^media/(?P.*)$', 'django.views.static.serve',
> > {'document_root': settings.MEDIA_ROOT},
> >    )
>
> > in my urls.py does it fail and output:
>
> > Page not found: /var/lib/python-support/python2.6/django/contrib/admin/
> > media/css/master.css
>
> > Why is it even looking in /var/lib/python-support/python2.6/django/
> > contrib/admin/ if I've configured MEDIA_ROOT in my settings.py to an
> > absolute path to my project's media source... just seems strange? Any
> > ideas would be greatly appreciated.
>
> Had the same problem on a project I was just working on.  I think
> I had to change the settings.ADMIN_MEDIA_PREFIX to some other
> location because it was superseding my settings.MEDIA_ROOT
>
> -tim
--~--~-~--~~~---~--~~
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 static files

2009-05-11 Thread eculver

I know this one has been covered pretty well, and I'm not a "total"
newb to django, but something alludes me here. Why when I put:

if settings.DEBUG:
urlpatterns += patterns('',
 (r'^media/(?P.*)$', 'django.views.static.serve',
{'document_root': settings.MEDIA_ROOT},
)

in my urls.py does it fail and output:

Page not found: /var/lib/python-support/python2.6/django/contrib/admin/
media/css/master.css

Why is it even looking in /var/lib/python-support/python2.6/django/
contrib/admin/ if I've configured MEDIA_ROOT in my settings.py to an
absolute path to my project's media source... just seems strange? Any
ideas would be greatly appreciated.

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---