Re: error python manage.py syncdb

2013-09-11 Thread Kishor Pawar
In python.py you just need to change the following line

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "projectname.settings")

no other changes required.

this error should be from settings.py

for details on python.py 

read same doc as your django version.
https://docs.djangoproject.com/en/dev/ref/django-admin/


On Wednesday, 11 September 2013 14:16:35 UTC+5:30, Gabriele Angeli wrote:
>
> Hi guys i have the following errors when edit python manage.py syncdb :
>
> Traceback (most recent call last):
>   File "manage.py", line 11, in 
> execute_manager(settings)
>   File 
> "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", 
> line 469, in execute_manager
> utility.execute()
>   File 
> "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", 
> line 392, in execute
> self.fetch_command(subcommand).run_from_argv(self.argv)
>   File 
> "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", 
> line 272, in fetch_command
> klass = load_command_class(app_name, subcommand)
>   File 
> "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", 
> line 77, in load_command_class
> module = import_module('%s.management.commands.%s' % (app_name, name))
>   File "/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py", 
> line 35, in import_module
> __import__(name)
>   File 
> "/usr/local/lib/python2.7/dist-packages/django/core/management/commands/syncdb.py",
>  
> line 8, in 
> from django.core.management.sql import custom_sql_for_model, 
> emit_post_sync_signal
>   File 
> "/usr/local/lib/python2.7/dist-packages/django/core/management/sql.py", 
> line 9, in 
> from django.db import models
>   File "/usr/local/lib/python2.7/dist-packages/django/db/__init__.py", 
> line 11, in 
> if settings.DATABASES and DEFAULT_DB_ALIAS not in settings.DATABASES:
>   File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", 
> line 53, in __getattr__
> self._setup(name)
>   File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", 
> line 48, in _setup
> self._wrapped = Settings(settings_module)
>   File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", 
> line 152, in __init__
> raise ImproperlyConfigured("The SECRET_KEY setting must not be empty.")
> django.core.exceptions.ImproperlyConfigured: The SECRET_KEY setting must 
> not be empty.
>
>
> Someone can help me?
>
> Thank you!!!
>
>
>
>
>

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: csrf_exempt decorator and class based views

2015-04-15 Thread Kishor Pawar
Hey Casey,

I followed this doc, but still I am not getting this working.

Do I need to do anything else to get it work?

On Tuesday, 8 March 2011 19:11:32 UTC+5:30, Casey wrote:
>
> Have you seen this yet:
>
>
> http://docs.djangoproject.com/en/dev/topics/class-based-views/#decorating-class-based-views
>
> I think it answers your question.
>
> Hope this helps,
> Casey
>
> On 03/08/2011 08:19 AM, Christo Buschek wrote:
> > Hello.
> >
> > I came across a problem that I don't fully understand. I try to
> > implement a view where I want to turn csrf protection off. My view is
> > implemented as a class based view, eg:
> >
> > class BaseHandler(object):
> >  """Base class to provide method lookup per HTTP method."""
> >  def __call__(self, request, **kwargs):
> >  self.request = request
> >  try:
> >  callback = getattr(self, "do_%s" % request.method)
> >  except AttributeError:
> >   allowed_methods = [m.lstrip("do_") for m in dir(self) if
> > m.startswith("do_")]
> >   return HttpResponseNotAllowed(allowed_methods)
> >  return callback(**kwargs)
> >
> > class SpecificHandler(BaseHandler):
> >  """Implement the HTTP methods."""
> >  def do_POST(self, **kwargs):
> >  pass
> >
> > If I want to use the @csrf_exempt on the class method 'do_POST', it
> > doesn't get recognised. It is only accepted if I wrap the whole class
> > inside the decorator, eg:
> >
> > # This doesn't work
> > class SpecificHandler(BaseHandler):
> >  @csrf_exempt
> >  def do_POST(self, **kwargs):
> >  pass
> >
> > # This works
> > @csrf_exempt
> > class SpecificHandler(BaseHandler):
> >  def do_POST(self, **kwargs):
> >  pass
> >
> > But I wonder if that is the right way to do because than all class
> > methods are excepted from the csrf protection.
> >
> > 1) Why is the decorator not wrapping the class method (more a python
> > question I guess)?
> > 2) Is there any other way how I could turn off the csrf protection for
> > this single class method?
> >
> > Any enlightenment is very much appreciated.
> >
> > cheers
> > Christo
> >
>
>

-- 
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/fd2188e8-d311-4c32-b3a1-37800123fba9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


django-admin makemessages --no-obsolete doesn't seem to be working

2018-03-18 Thread Kishor Pawar
First of all, I am expecting `--no-obsolete` would comment out `msgid` and 
`msgstr` if `gettext` is deleted, right?

How I am testing is:

1. I wrote `gettext("some string here")` in view  
2. I ran `makemessages` command  
3. It wrote a `.po` file as expected  
4. Then I deleted `gettext()` line from view and saved file, verified 
`runserver` working.  
5. I ran `makemessages --no-obsolete` and it has not made any changes to `.po` 
file.  

`.po` file content extract . 

#. Translators: This message is a test of wrap line
#: servers/views.py:31
msgid "Do let me know if it works."
msgstr ""

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/D4DF701A-03EB-4CB4-B74E-F5D62505DA8E%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: django-admin makemessages --no-obsolete doesn't seem to be working

2018-03-19 Thread Kishor Pawar
All my emails never are responded, i'm thinking they not going to
discussion list. Someone can reply anything just to let me know.


On Sun, 18 Mar 2018 at 19:48 Kishor Pawar  wrote:

> First of all, I am expecting `--no-obsolete` would comment out `msgid` and
> `msgstr` if `gettext` is deleted, right?
>
> How I am testing is:
>
> 1. I wrote `gettext("some string here")` in view
> 2. I ran `makemessages` command
> 3. It wrote a `.po` file as expected
> 4. Then I deleted `gettext()` line from view and saved file, verified
> `runserver` working.
> 5. I ran `makemessages --no-obsolete` and it has not made any changes to
> `.po` file.
>
> `.po` file content extract .
>
> #. Translators: This message is a test of wrap line
> #: servers/views.py:31
> msgid "Do let me know if it works."
> msgstr ""

-- 
*Thanks & Regards*
*Kishor Pawar*

*The Trouble with the world is that Stupids are Full of Confidence and
The Intelligent are Full of Doubts.*

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAKU00M%3DH7CLOot-gxd_ga_hng8-zM%3DX01YupcoWSWFv6EMfcUw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.