Re: django models

2018-08-08 Thread Gerald Brown
The last line of the error message tells you what to do.  Create a 
Secret Key in your settings.py file because it says it is now empty.



On Wednesday, 08 August, 2018 02:43 PM, Ramandeep Kaur wrote:
when i run this ./manage.py makemigrations it gives some error. Don't 
know what to do.


Traceback (most recent call last):
  File "manage.py", line 10, in 
    execute_from_command_line(sys.argv)
  File 
"C:\Python27\lib\site-packages\django\core\management\__init__.py", 
line 353, in execute_from_command_line

    utility.execute()
  File 
"C:\Python27\lib\site-packages\django\core\management\__init__.py", 
line 345, in execute

self.fetch_command(subcommand).run_from_argv(self.argv)
  File 
"C:\Python27\lib\site-packages\django\core\management\__init__.py", 
line 195, in fetch_command

    klass = load_command_class(app_name, subcommand)
  File 
"C:\Python27\lib\site-packages\django\core\management\__init__.py", 
line 39, in load_command_class

    module = import_module('%s.management.commands.%s' % (app_name, name))
  File "C:\Python27\lib\importlib\__init__.py", line 37, in import_module
    __import__(name)
  File 
"C:\Python27\lib\site-packages\django\core\management\commands\makemigrations.py", 
line 8, in 

    from django.db.migrations.autodetector import MigrationAutodetector
  File 
"C:\Python27\lib\site-packages\django\db\migrations\autodetector.py", 
line 13, in 

    from django.db.migrations.questioner import MigrationQuestioner
  File 
"C:\Python27\lib\site-packages\django\db\migrations\questioner.py", 
line 12, in 

    from .loader import MigrationLoader
  File "C:\Python27\lib\site-packages\django\db\migrations\loader.py", 
line 10, in 

    from django.db.migrations.recorder import MigrationRecorder
  File 
"C:\Python27\lib\site-packages\django\db\migrations\recorder.py", line 
12, in 

    class MigrationRecorder(object):
  File 
"C:\Python27\lib\site-packages\django\db\migrations\recorder.py", line 
26, in MigrationRecorder

    class Migration(models.Model):
  File 
"C:\Python27\lib\site-packages\django\db\migrations\recorder.py", line 
27, in Migration

    app = models.CharField(max_length=255)
  File 
"C:\Python27\lib\site-packages\django\db\models\fields\__init__.py", 
line 1072, in __init__

    super(CharField, self).__init__(*args, **kwargs)
  File 
"C:\Python27\lib\site-packages\django\db\models\fields\__init__.py", 
line 166, in __init__
    self.db_tablespace = db_tablespace or 
settings.DEFAULT_INDEX_TABLESPACE
  File "C:\Python27\lib\site-packages\django\conf\__init__.py", line 
55, in __getattr__

    self._setup(name)
  File "C:\Python27\lib\site-packages\django\conf\__init__.py", line 
43, in _setup

    self._wrapped = Settings(settings_module)
  File "C:\Python27\lib\site-packages\django\conf\__init__.py", line 
120, in __init__
    raise ImproperlyConfigured("The SECRET_KEY setting must not be 
empty.")
django.core.exceptions.ImproperlyConfigured: The SECRET_KEY setting 
must not be empty.


On Wed, Aug 8, 2018 at 6:22 AM, Gerald Brown > wrote:


Just delete the code in models.py and run ./manage.py
makemigrations and ./manage.py migrate.


On Wednesday, 08 August, 2018 01:14 AM, Ramandeep Kaur wrote:

My question is that how to delete models in django?
-- 
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/42e646fa-af94-4250-b04a-5765e2975c3e%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 https://groups.google.com/group/django-users
.
To view this discussion on the web visit

https://groups.google.com/d/msgid/django-users/ebb428c7-b1cd-46e2-e139-9fe96a884353%40gmail.com



how to django query objects parse in json below format please help me

2018-08-08 Thread arvind yadav
my Quey objects is
jsonquery = PartDetails.objects.all()
{
title:{
text: " march 2018 " ### is time
  },  
  data: [{
type: "column",
dataPoints: [
  { label: "sv", y: 3},
]
  
  
  },
  {
type: "line",
dataPoints: [
  { label: "sv", y: 3},

]
  }
 ]
}

-- 
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/ff3fba82-5e29-4065-9b20-56cded496ddb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


how to convert django query objects in blow formal json

2018-08-08 Thread arvind yadav


*how to convert django query objects in blow formal js*on


{
title:{
text: " march 2018 "
  },  
  data: [{
type: "column",
dataPoints: [
  { label: "sv", y: 3},
]
  
  
  },
  {
type: "line",
dataPoints: [
  { label: "sv", y: 3},

]
  }
 ]
}

-- 
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/306b365e-7efa-44b1-85b9-eeba3d7cca10%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: how to convert django query objects in blow formal json

2018-08-08 Thread SACHIN CHAVAN
Did you mean to say Django queryset? right?

On Wed, Aug 8, 2018 at 4:04 PM arvind yadav 
wrote:

>
>
> *how to convert django query objects in blow formal js*on
>
>
> {
> title:{
> text: " march 2018 "
>   },
>   data: [{
> type: "column",
> dataPoints: [
>   { label: "sv", y: 3},
> ]
>
>
>   },
>   {
> type: "line",
> dataPoints: [
>   { label: "sv", y: 3},
>
> ]
>   }
>  ]
> }
>
> --
> 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/306b365e-7efa-44b1-85b9-eeba3d7cca10%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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAJ288WWds%2B557z0qQHY-Okn1KzocMcNE8xxPY5UGKsVbAN_H5g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: how to convert django query objects in blow formal json

2018-08-08 Thread SACHIN CHAVAN
use Django rest framework, user
serializers
for
converting queryset into the JSON format

-- 
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/CAJ288WWrJr-vyh%3DxeDi-KwzYr-qODANbV6PhY-foxsj5Rg%3DU%2Bg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Django Generic Date Views

2018-08-08 Thread Gerald Brown
Greetings:

Tonight I discovered something at 
https://docs.djangoproject.com/en/2.1/ref/class-based-views/generic-date-based/ 
that I thought is just what I am looking for.  The only problem is I can't 
get them to work.

They are designed to present views by Year, Month, Week, Day, Today or 
specific Date.

If anyone has experience using them I would be interested in how it works 
for you.

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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/f50ac4bf-6da5-4850-b4a2-0ba9abea804f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django Generic Date Views

2018-08-08 Thread Jason
what have you tried so far?  What issues are you having with the 
documentation examples?

"can't get them to work" is really uninformative, 

-- 
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/3ccfa3d5-afc8-4a82-82e6-884da1f4b4ab%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django Generic Date Views

2018-08-08 Thread Gerald Brown


On Wednesday, August 8, 2018 at 8:15:21 PM UTC+8, Jason wrote:
>
> what have you tried so far?  What issues are you having with the 
> documentation examples?
>
> "can't get them to work" is really uninformative,  RIGHT.
>

What I tried was the TodayArchiveView by following the docs. When I enter 
http://127.0.0.1:8000/admin/visit/today/ in my browser I get a 404 error

The code in my views.py file is:
class PaymentTodayArchiveView(TodayArchiveView):
vi = Visit.objects.all()
date_field = "visit_date"

The code in my URLS.py file is:
path('today/', PaymentTodayArchiveView, name="today"),

In the docs is says ".as_view()" should be added to 
PaymentTodayArchiveView. When I add that I get "AttributeError: 'function' 
object has no attribute 'as_view'" error.

Guess I will have to dig more into the docs as I just discovered this 
tonight and "MAYBE" I didn't read all of the  docs thoroughly enough.

Thanks for your reply.  I have discovered that by discussing my problem I 
am then able to come up with a solution.

-- 
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/08676940-3bd7-405d-b738-c7134a902dd9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Upgrading from Django 1.7: render_to_response and context_instance

2018-08-08 Thread Hanne Moa
I'm upgrading a rather large code base from django 1.7, with the
ultimate goal to have it run on 1.11, as the code isn't fully verified
to run on python 3 yet.

I'm replacing `render_to_response()` with `render()` everywhere a
RequestContext is used, and came upon this (simplified) oddity:

return render_to_response(
   template,
   {'important': 1},
   context_instance=RequestContext(
   request, processors=[important_processor])
)

What important_processor() does is return a dictionary {''important":
FOO} where the value of FOO depends on something in the request.

Many other views' render_to_response() had this as its
context_instance, but they did not define 'important" in the
dictionary before the context_instance, so I replaced them with:

return render(
  request,
  template,
  important_processor(request) + {'whatever': 'was', 'in': 'here'}
)

In the first example I'm having some trouble figuring out which value
for "important" is visible to the template: is it 1, or whatever
important_processor() generates?

If I print what I think is context that is used to render the
template, I get a list of multiple dictionaries. The last two both
have a "important"-key, but with different values. {'important': 1}
comes first of the two.

I am neck deep in the template rendering code right now and I'm quite lost.


HM


(For statistics' sake , some 95% of the render_to_response()s looked like this:

return render_to_response(
  some_template,
  some_dict,
  context_instance=RequestContext(request)
)

)

-- 
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/CACQ%3DrrfLhhHrtKVSvcwJ7SmNyePdybEhO50%2Bepd8hcuLEG5sgg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


RE: Upgrading from Django 1.7: render_to_response and context_instance

2018-08-08 Thread Matthew Pava
If you are simply adding something to most every request, I would add a context 
processor in the TEMPLATE settings.

Check out 
https://docs.djangoproject.com/en/2.1/topics/templates/#context-processors

In this example, I have an app called general.  Within that is a py file called 
context_processors.  In that file is a function called extra_context that takes 
request as an argument.  I just return a dictionary that all of my templates 
have access to.

TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [
# insert your TEMPLATE_DIRS here
os.path.join(BASE_DIR, 'templates'),
],
'APP_DIRS': True,
'OPTIONS': {
'debug': True,
'context_processors': [
# Insert your TEMPLATE_CONTEXT_PROCESSORS here or use this
# list if you haven't customized them:
'django.contrib.auth.context_processors.auth',
'django.template.context_processors.debug',
'django.template.context_processors.i18n',
'django.template.context_processors.media',
'django.template.context_processors.static',
'django.template.context_processors.tz',
'django.contrib.messages.context_processors.messages',
'django.template.context_processors.request',
'general.context_processors.extra_context',
],
},
},
]



-Original Message-
From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On 
Behalf Of Hanne Moa
Sent: Wednesday, August 8, 2018 7:56 AM
To: django-users@googlegroups.com
Subject: Upgrading from Django 1.7: render_to_response and context_instance

I'm upgrading a rather large code base from django 1.7, with the ultimate goal 
to have it run on 1.11, as the code isn't fully verified to run on python 3 yet.

I'm replacing `render_to_response()` with `render()` everywhere a 
RequestContext is used, and came upon this (simplified) oddity:

return render_to_response(
   template,
   {'important': 1},
   context_instance=RequestContext(
   request, processors=[important_processor])
)

What important_processor() does is return a dictionary {''important":
FOO} where the value of FOO depends on something in the request.

Many other views' render_to_response() had this as its context_instance, but 
they did not define 'important" in the dictionary before the context_instance, 
so I replaced them with:

return render(
  request,
  template,
  important_processor(request) + {'whatever': 'was', 'in': 'here'}
)

In the first example I'm having some trouble figuring out which value for 
"important" is visible to the template: is it 1, or whatever
important_processor() generates?

If I print what I think is context that is used to render the template, I get a 
list of multiple dictionaries. The last two both have a "important"-key, but 
with different values. {'important': 1} comes first of the two.

I am neck deep in the template rendering code right now and I'm quite lost.


HM


(For statistics' sake , some 95% of the render_to_response()s looked like this:

return render_to_response(
  some_template,
  some_dict,
  context_instance=RequestContext(request)
)

)

--
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/CACQ%3DrrfLhhHrtKVSvcwJ7SmNyePdybEhO50%2Bepd8hcuLEG5sgg%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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/2ad6339f81e14a7bb7ab28a35e07470e%40ISS1.ISS.LOCAL.
For more options, visit https://groups.google.com/d/optout.


Re: django models

2018-08-08 Thread Balasriharsha Cheeday
You must have removed the secret key in settings.py file, try re-adding 
that secret key, then it should work just fine

On Tuesday, August 7, 2018 at 10:17:00 AM UTC-7, Ramandeep Kaur wrote:
>
> My question is that how to delete models in django?
>

-- 
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/cb8e793b-c45f-487f-93d8-e8fa271302e8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Select "class" attributes are not updated

2018-08-08 Thread matteo gassend
Hello everyone,

I am trying to personalize my select fields in a django modelform, however 
the changes are not reflected when I try to render the field. Anyone else 
ever had this problem?

self.fields["prodotti_var"].widget.attrs.update({"class" : 
"form-control 
m-bootstrap-select m_selectpicker", "data-live-search" : "true"})


Can you help me?






-- 
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/46314697-049b-404e-b48d-6bdfac6595f3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: django models

2018-08-08 Thread Ramandeep Kaur
I am new at Django so I don't know how to create secret key. please explain
me.

On Wed, Aug 8, 2018, 1:20 PM Gerald Brown  wrote:

> The last line of the error message tells you what to do.  Create a Secret
> Key in your settings.py file because it says it is now empty.
>
> On Wednesday, 08 August, 2018 02:43 PM, Ramandeep Kaur wrote:
>
> when i run this ./manage.py makemigrations it gives some error. Don't
> know what to do.
>
> Traceback (most recent call last):
>   File "manage.py", line 10, in 
> execute_from_command_line(sys.argv)
>   File "C:\Python27\lib\site-packages\django\core\management\__init__.py",
> line 353, in execute_from_command_line
> utility.execute()
>   File "C:\Python27\lib\site-packages\django\core\management\__init__.py",
> line 345, in execute
> self.fetch_command(subcommand).run_from_argv(self.argv)
>   File "C:\Python27\lib\site-packages\django\core\management\__init__.py",
> line 195, in fetch_command
> klass = load_command_class(app_name, subcommand)
>   File "C:\Python27\lib\site-packages\django\core\management\__init__.py",
> line 39, in load_command_class
> module = import_module('%s.management.commands.%s' % (app_name, name))
>   File "C:\Python27\lib\importlib\__init__.py", line 37, in import_module
> __import__(name)
>   File
> "C:\Python27\lib\site-packages\django\core\management\commands\makemigrations.py",
> line 8, in 
> from django.db.migrations.autodetector import MigrationAutodetector
>   File
> "C:\Python27\lib\site-packages\django\db\migrations\autodetector.py", line
> 13, in 
> from django.db.migrations.questioner import MigrationQuestioner
>   File "C:\Python27\lib\site-packages\django\db\migrations\questioner.py",
> line 12, in 
> from .loader import MigrationLoader
>   File "C:\Python27\lib\site-packages\django\db\migrations\loader.py",
> line 10, in 
> from django.db.migrations.recorder import MigrationRecorder
>   File "C:\Python27\lib\site-packages\django\db\migrations\recorder.py",
> line 12, in 
> class MigrationRecorder(object):
>   File "C:\Python27\lib\site-packages\django\db\migrations\recorder.py",
> line 26, in MigrationRecorder
> class Migration(models.Model):
>   File "C:\Python27\lib\site-packages\django\db\migrations\recorder.py",
> line 27, in Migration
> app = models.CharField(max_length=255)
>   File
> "C:\Python27\lib\site-packages\django\db\models\fields\__init__.py", line
> 1072, in __init__
> super(CharField, self).__init__(*args, **kwargs)
>   File
> "C:\Python27\lib\site-packages\django\db\models\fields\__init__.py", line
> 166, in __init__
> self.db_tablespace = db_tablespace or settings.DEFAULT_INDEX_TABLESPACE
>   File "C:\Python27\lib\site-packages\django\conf\__init__.py", line 55,
> in __getattr__
> self._setup(name)
>   File "C:\Python27\lib\site-packages\django\conf\__init__.py", line 43,
> in _setup
> self._wrapped = Settings(settings_module)
>   File "C:\Python27\lib\site-packages\django\conf\__init__.py", line 120,
> in __init__
> raise ImproperlyConfigured("The SECRET_KEY setting must not be empty.")
> django.core.exceptions.ImproperlyConfigured: The SECRET_KEY setting must
> not be empty.
>
> On Wed, Aug 8, 2018 at 6:22 AM, Gerald Brown  wrote:
>
>> Just delete the code in models.py and run ./manage.py makemigrations and
>> ./manage.py migrate.
>>
>> On Wednesday, 08 August, 2018 01:14 AM, Ramandeep Kaur wrote:
>>
>> My question is that how to delete models in django?
>> --
>> 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/42e646fa-af94-4250-b04a-5765e2975c3e%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 https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/ebb428c7-b1cd-46e2-e139-9fe96a884353%40gmail.com
>> .
>>
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> You received this messa

RE: django models

2018-08-08 Thread Matthew Pava
Well, you could generate a SECRET KEY here:
https://www.miniwebtool.com/django-secret-key-generator/

Then in your settings.py file you need to add this line:
SECRET_KEY = “[insert secret key here]”

https://docs.djangoproject.com/en/dev/ref/settings/#secret-key


From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On 
Behalf Of Ramandeep Kaur
Sent: Wednesday, August 8, 2018 8:50 AM
To: django-users@googlegroups.com
Subject: Re: django models

I am new at Django so I don't know how to create secret key. please explain me.

On Wed, Aug 8, 2018, 1:20 PM Gerald Brown 
mailto:gsbrow...@gmail.com>> wrote:

The last line of the error message tells you what to do.  Create a Secret Key 
in your settings.py file because it says it is now empty.

On Wednesday, 08 August, 2018 02:43 PM, Ramandeep Kaur wrote:
when i run this ./manage.py makemigrations it gives some error. Don't know what 
to do.

Traceback (most recent call last):
  File "manage.py", line 10, in 
execute_from_command_line(sys.argv)
  File "C:\Python27\lib\site-packages\django\core\management\__init__.py", line 
353, in execute_from_command_line
utility.execute()
  File "C:\Python27\lib\site-packages\django\core\management\__init__.py", line 
345, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
  File "C:\Python27\lib\site-packages\django\core\management\__init__.py", line 
195, in fetch_command
klass = load_command_class(app_name, subcommand)
  File "C:\Python27\lib\site-packages\django\core\management\__init__.py", line 
39, in load_command_class
module = import_module('%s.management.commands.%s' % (app_name, name))
  File "C:\Python27\lib\importlib\__init__.py", line 37, in import_module
__import__(name)
  File 
"C:\Python27\lib\site-packages\django\core\management\commands\makemigrations.py",
 line 8, in 
from django.db.migrations.autodetector import MigrationAutodetector
  File "C:\Python27\lib\site-packages\django\db\migrations\autodetector.py", 
line 13, in 
from django.db.migrations.questioner import MigrationQuestioner
  File "C:\Python27\lib\site-packages\django\db\migrations\questioner.py", line 
12, in 
from .loader import MigrationLoader
  File "C:\Python27\lib\site-packages\django\db\migrations\loader.py", line 10, 
in 
from django.db.migrations.recorder import MigrationRecorder
  File "C:\Python27\lib\site-packages\django\db\migrations\recorder.py", line 
12, in 
class MigrationRecorder(object):
  File "C:\Python27\lib\site-packages\django\db\migrations\recorder.py", line 
26, in MigrationRecorder
class Migration(models.Model):
  File "C:\Python27\lib\site-packages\django\db\migrations\recorder.py", line 
27, in Migration
app = models.CharField(max_length=255)
  File "C:\Python27\lib\site-packages\django\db\models\fields\__init__.py", 
line 1072, in __init__
super(CharField, self).__init__(*args, **kwargs)
  File "C:\Python27\lib\site-packages\django\db\models\fields\__init__.py", 
line 166, in __init__
self.db_tablespace = db_tablespace or settings.DEFAULT_INDEX_TABLESPACE
  File "C:\Python27\lib\site-packages\django\conf\__init__.py", line 55, in 
__getattr__
self._setup(name)
  File "C:\Python27\lib\site-packages\django\conf\__init__.py", line 43, in 
_setup
self._wrapped = Settings(settings_module)
  File "C:\Python27\lib\site-packages\django\conf\__init__.py", line 120, in 
__init__
raise ImproperlyConfigured("The SECRET_KEY setting must not be empty.")
django.core.exceptions.ImproperlyConfigured: The SECRET_KEY setting must not be 
empty.

On Wed, Aug 8, 2018 at 6:22 AM, Gerald Brown 
mailto:gsbrow...@gmail.com>> wrote:

Just delete the code in models.py and run ./manage.py makemigrations and 
./manage.py migrate.

On Wednesday, 08 August, 2018 01:14 AM, Ramandeep Kaur wrote:
My question is that how to delete models in django?
--
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/42e646fa-af94-4250-b04a-5765e2975c3e%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 
d

Re: Django Generic Date Views

2018-08-08 Thread Jason
are you sure your url is in admin/visit?

path('today/', PaymentTodayArchiveView, name="today"),

404 says you have a url routing issue, not a view issue.

On Wednesday, August 8, 2018 at 8:42:06 AM UTC-4, Gerald Brown wrote:
>
>
>
> On Wednesday, August 8, 2018 at 8:15:21 PM UTC+8, Jason wrote:
>>
>> what have you tried so far?  What issues are you having with the 
>> documentation examples?
>>
>> "can't get them to work" is really uninformative,  RIGHT.
>>
>
> What I tried was the TodayArchiveView by following the docs. When I enter 
> http://127.0.0.1:8000/admin/visit/today/ in my browser I get a 404 error
>
> The code in my views.py file is:
> class PaymentTodayArchiveView(TodayArchiveView):
> vi = Visit.objects.all()
> date_field = "visit_date"
>
> The code in my URLS.py file is:
> path('today/', PaymentTodayArchiveView, name="today"),
>
> In the docs is says ".as_view()" should be added to 
> PaymentTodayArchiveView. When I add that I get "AttributeError: 'function' 
> object has no attribute 'as_view'" error.
>
> Guess I will have to dig more into the docs as I just discovered this 
> tonight and "MAYBE" I didn't read all of the  docs thoroughly enough.
>
> Thanks for your reply.  I have discovered that by discussing my problem I 
> am then able to come up with a solution.
>

-- 
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/1c0ee6e7-5463-45e6-bbf8-7c49ace576cb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django Generic Date Views

2018-08-08 Thread Jason
also, I note you don't set the queryset field in your view class.  you set 
it to `vi`.  that's probably an issue there

eg 

from django.views.generic.dates import TodayArchiveView
from myapp.models import Article
class ArticleTodayArchiveView(TodayArchiveView):
queryset = Article.objects.all()  <-- 
date_field = "pub_date"
allow_future = True

-- 
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/067458f4-6bf2-4ada-a18f-a904d72fa81d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Select "class" attributes are not updated

2018-08-08 Thread Luis Polanco
Hi

If you are only updating the class attribute you can do a direct assignment 
to the class attribute on the dictionary like:

self.fields['attendant_authority'].widget.attrs['class'] = 
'select_autoridad'
self.fields["prodotti_var"].widget.attrs["class"] = "form-control 
m-bootstrap-select m_selectpicker"


El miércoles, 8 de agosto de 2018, 6:47:31 (UTC-7), matteo gassend escribió:
>
> Hello everyone,
>
> I am trying to personalize my select fields in a django modelform, however 
> the changes are not reflected when I try to render the field. Anyone else 
> ever had this problem?
>
> self.fields["prodotti_var"].widget.attrs.update({"class" : 
> "form-control 
> m-bootstrap-select m_selectpicker", "data-live-search" : "true"})
>
>
> Can you help me?
>
>
>
>
>
>
>

-- 
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/9b61f397-677e-4368-8514-3ef7546bc913%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django Generic Date Views

2018-08-08 Thread Gerald Brown
As far as I know both "vi" and "queryset" are variable names and can be 
called "anything"

On Thursday, August 9, 2018 at 12:08:07 AM UTC+8, Jason wrote:
>
> also, I note you don't set the queryset field in your view class.  you set 
> it to `vi`.  that's probably an issue there
>
> eg 
>
> from django.views.generic.dates import TodayArchiveView
> from myapp.models import Article
> class ArticleTodayArchiveView(TodayArchiveView):
> queryset = Article.objects.all()  <-- 
> date_field = "pub_date"
> allow_future = True
>
>

-- 
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/4f740c1b-2352-4d64-aeb9-ffbaa7d73db4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: django models

2018-08-08 Thread Ramandeep Kaur
i set the secret key but its again giving me the same errror.
django.core.exceptions.ImproperlyConfigured: The SECRET_KEY setting must
not be empty.

On Wed, Aug 8, 2018 at 7:24 PM, Matthew Pava  wrote:

> Well, you could generate a SECRET KEY here:
>
> https://www.miniwebtool.com/django-secret-key-generator/
>
>
>
> Then in your settings.py file you need to add this line:
>
> SECRET_KEY = “[insert secret key here]”
>
>
>
> https://docs.djangoproject.com/en/dev/ref/settings/#secret-key
>
>
>
>
>
> *From:* django-users@googlegroups.com [mailto:django-users@
> googlegroups.com] *On Behalf Of *Ramandeep Kaur
> *Sent:* Wednesday, August 8, 2018 8:50 AM
> *To:* django-users@googlegroups.com
> *Subject:* Re: django models
>
>
>
> I am new at Django so I don't know how to create secret key. please
> explain me.
>
>
>
> On Wed, Aug 8, 2018, 1:20 PM Gerald Brown  wrote:
>
> The last line of the error message tells you what to do.  Create a Secret
> Key in your settings.py file because it says it is now empty.
>
>
>
> On Wednesday, 08 August, 2018 02:43 PM, Ramandeep Kaur wrote:
>
> when i run this ./manage.py makemigrations it gives some error. Don't
> know what to do.
>
>
>
> Traceback (most recent call last):
>
>   File "manage.py", line 10, in 
>
> execute_from_command_line(sys.argv)
>
>   File "C:\Python27\lib\site-packages\django\core\management\__init__.py",
> line 353, in execute_from_command_line
>
> utility.execute()
>
>   File "C:\Python27\lib\site-packages\django\core\management\__init__.py",
> line 345, in execute
>
> self.fetch_command(subcommand).run_from_argv(self.argv)
>
>   File "C:\Python27\lib\site-packages\django\core\management\__init__.py",
> line 195, in fetch_command
>
> klass = load_command_class(app_name, subcommand)
>
>   File "C:\Python27\lib\site-packages\django\core\management\__init__.py",
> line 39, in load_command_class
>
> module = import_module('%s.management.commands.%s' % (app_name, name))
>
>   File "C:\Python27\lib\importlib\__init__.py", line 37, in import_module
>
> __import__(name)
>
>   File 
> "C:\Python27\lib\site-packages\django\core\management\commands\makemigrations.py",
> line 8, in 
>
> from django.db.migrations.autodetector import MigrationAutodetector
>
>   File "C:\Python27\lib\site-packages\django\db\migrations\autodetector.py",
> line 13, in 
>
> from django.db.migrations.questioner import MigrationQuestioner
>
>   File "C:\Python27\lib\site-packages\django\db\migrations\questioner.py",
> line 12, in 
>
> from .loader import MigrationLoader
>
>   File "C:\Python27\lib\site-packages\django\db\migrations\loader.py",
> line 10, in 
>
> from django.db.migrations.recorder import MigrationRecorder
>
>   File "C:\Python27\lib\site-packages\django\db\migrations\recorder.py",
> line 12, in 
>
> class MigrationRecorder(object):
>
>   File "C:\Python27\lib\site-packages\django\db\migrations\recorder.py",
> line 26, in MigrationRecorder
>
> class Migration(models.Model):
>
>   File "C:\Python27\lib\site-packages\django\db\migrations\recorder.py",
> line 27, in Migration
>
> app = models.CharField(max_length=255)
>
>   File "C:\Python27\lib\site-packages\django\db\models\fields\__init__.py",
> line 1072, in __init__
>
> super(CharField, self).__init__(*args, **kwargs)
>
>   File "C:\Python27\lib\site-packages\django\db\models\fields\__init__.py",
> line 166, in __init__
>
> self.db_tablespace = db_tablespace or settings.DEFAULT_INDEX_
> TABLESPACE
>
>   File "C:\Python27\lib\site-packages\django\conf\__init__.py", line 55,
> in __getattr__
>
> self._setup(name)
>
>   File "C:\Python27\lib\site-packages\django\conf\__init__.py", line 43,
> in _setup
>
> self._wrapped = Settings(settings_module)
>
>   File "C:\Python27\lib\site-packages\django\conf\__init__.py", line 120,
> in __init__
>
> raise ImproperlyConfigured("The SECRET_KEY setting must not be empty.")
>
> django.core.exceptions.ImproperlyConfigured: The SECRET_KEY setting must
> not be empty.
>
>
>
> On Wed, Aug 8, 2018 at 6:22 AM, Gerald Brown  wrote:
>
> Just delete the code in models.py and run ./manage.py makemigrations and
> ./manage.py migrate.
>
>
>
> On Wednesday, 08 August, 2018 01:14 AM, Ramandeep Kaur wrote:
>
> My question is that how to delete models in django?
>
> --
> 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/42e646fa-af94-4250-b04a-5765e2975c3e%40googlegroups.com
> 
> .
> For more opti

Re: how to convert django query objects in blow formal json

2018-08-08 Thread arvind yadav
ye



 Thanks Regards
   Arvind Kumar Yadav
   Mobile:9873451821
  Software Engineer (python/Django)
Email: developer.arvind2...@gmail.com 
*Arvind Yadav On Linkedin*



On Wed, Aug 8, 2018 at 4:26 PM, SACHIN CHAVAN  wrote:

> use Django rest framework, user 
> serializers
> for
> converting queryset into the JSON format
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Django users" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/django-users/U2QYU6ClMR0/unsubscribe.
> To unsubscribe from this group and all its topics, 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/CAJ288WWrJr-vyh%3DxeDi-KwzYr-
> qODANbV6PhY-foxsj5Rg%3DU%2Bg%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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHZqHzhiDhXxbjGmGdcjYUXa%3DWeDaxkJQQ%2BPeuORJWM8p_BWNg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Upgrading from Django 1.7: render_to_response and context_instance

2018-08-08 Thread Hanne Moa
This is only used in one app, and one views.py out of 38. There's only
this one views.py remaining that uses render_to_response with
context_instance. If this was modern Django code written by me I would
have used class-based views and a mixin modifying get_context_data
(Thank $deity for CBVs).

There is one other view that used something similar, through a
subclass of RequestContext instead of a local context processor. It
added two keys to every context in every view for that app/views.py.
There was never any overlap with what was put in the explicit context
so the fix was almost seddable.

This is a very lava flow heavy project so asking the original
developer about what the point was is out, and the point isn't
commented/documented either. (But who remembers 5 year old code at
that level of detail anyway?)

On 8 August 2018 at 15:42, Matthew Pava  wrote:
> If you are simply adding something to most every request, I would add a 
> context processor in the TEMPLATE settings.
>
> Check out 
> https://docs.djangoproject.com/en/2.1/topics/templates/#context-processors
>
> In this example, I have an app called general.  Within that is a py file 
> called context_processors.  In that file is a function called extra_context 
> that takes request as an argument.  I just return a dictionary that all of my 
> templates have access to.
>
> TEMPLATES = [
> {
> 'BACKEND': 'django.template.backends.django.DjangoTemplates',
> 'DIRS': [
> # insert your TEMPLATE_DIRS here
> os.path.join(BASE_DIR, 'templates'),
> ],
> 'APP_DIRS': True,
> 'OPTIONS': {
> 'debug': True,
> 'context_processors': [
> # Insert your TEMPLATE_CONTEXT_PROCESSORS here or use this
> # list if you haven't customized them:
> 'django.contrib.auth.context_processors.auth',
> 'django.template.context_processors.debug',
> 'django.template.context_processors.i18n',
> 'django.template.context_processors.media',
> 'django.template.context_processors.static',
> 'django.template.context_processors.tz',
> 'django.contrib.messages.context_processors.messages',
> 'django.template.context_processors.request',
> 'general.context_processors.extra_context',
> ],
> },
> },
> ]
>
>
>
> -Original Message-
> From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On 
> Behalf Of Hanne Moa
> Sent: Wednesday, August 8, 2018 7:56 AM
> To: django-users@googlegroups.com
> Subject: Upgrading from Django 1.7: render_to_response and context_instance
>
> I'm upgrading a rather large code base from django 1.7, with the ultimate 
> goal to have it run on 1.11, as the code isn't fully verified to run on 
> python 3 yet.
>
> I'm replacing `render_to_response()` with `render()` everywhere a 
> RequestContext is used, and came upon this (simplified) oddity:
>
> return render_to_response(
>template,
>{'important': 1},
>context_instance=RequestContext(
>request, processors=[important_processor])
> )
>
> What important_processor() does is return a dictionary {''important":
> FOO} where the value of FOO depends on something in the request.
>
> Many other views' render_to_response() had this as its context_instance, but 
> they did not define 'important" in the dictionary before the 
> context_instance, so I replaced them with:
>
> return render(
>   request,
>   template,
>   important_processor(request) + {'whatever': 'was', 'in': 'here'}
> )
>
> In the first example I'm having some trouble figuring out which value for 
> "important" is visible to the template: is it 1, or whatever
> important_processor() generates?
>
> If I print what I think is context that is used to render the template, I get 
> a list of multiple dictionaries. The last two both have a "important"-key, 
> but with different values. {'important': 1} comes first of the two.
>
> I am neck deep in the template rendering code right now and I'm quite lost.
>
>
> HM
>
>
> (For statistics' sake , some 95% of the render_to_response()s looked like 
> this:
>
> return render_to_response(
>   some_template,
>   some_dict,
>   context_instance=RequestContext(request)
> )
>
> )
>
> --
> 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/CACQ%3DrrfLhhHrtKVSvcwJ7SmNyePdybEhO50%2Bepd8hcuLEG5sgg%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this 

Re: django models

2018-08-08 Thread Mike Dewhirst
Ok. If it is saying the secret key is empty and you have spelled 
SECRET_KEY correctly and it is not empty then manage.py is loading the 
wrong settings.


Does manage.py runserver work?

On 9/08/2018 3:48 PM, Ramandeep Kaur wrote:

Thanks but again getting same error.
PS C:\Users\Dell\vms2> python manage.py makemigrations 
--settings=vms2.settings

Traceback (most recent call last):
  File "manage.py", line 10, in 
    execute_from_command_line(sys.argv)
  File 
"C:\Python27\lib\site-packages\django\core\management\__init__.py", 
line 353, in execute_from_command_line

    utility.execute()
  File 
"C:\Python27\lib\site-packages\django\core\management\__init__.py", 
line 345, in execute

self.fetch_command(subcommand).run_from_argv(self.argv)
  File 
"C:\Python27\lib\site-packages\django\core\management\__init__.py", 
line 195, in fetch_command

    klass = load_command_class(app_name, subcommand)
  File 
"C:\Python27\lib\site-packages\django\core\management\__init__.py", 
line 39, in load_command_class

    module = import_module('%s.management.commands.%s' % (app_name, name))
  File "C:\Python27\lib\importlib\__init__.py", line 37, in import_module
    __import__(name)
  File 
"C:\Python27\lib\site-packages\django\core\management\commands\makemigrations.py", 
line 8, in 

    from django.db.migrations.autodetector import MigrationAutodetector
  File 
"C:\Python27\lib\site-packages\django\db\migrations\autodetector.py", 
line 13, in 

    from django.db.migrations.questioner import MigrationQuestioner
  File 
"C:\Python27\lib\site-packages\django\db\migrations\questioner.py", 
line 12, in 

    from .loader import MigrationLoader
  File "C:\Python27\lib\site-packages\django\db\migrations\loader.py", 
line 10, in 

    from django.db.migrations.recorder import MigrationRecorder
  File 
"C:\Python27\lib\site-packages\django\db\migrations\recorder.py", line 
12, in 

    class MigrationRecorder(object):
  File 
"C:\Python27\lib\site-packages\django\db\migrations\recorder.py", line 
26, in MigrationRecorder

    class Migration(models.Model):
  File 
"C:\Python27\lib\site-packages\django\db\migrations\recorder.py", line 
27, in Migration

    app = models.CharField(max_length=255)
  File 
"C:\Python27\lib\site-packages\django\db\models\fields\__init__.py", 
line 1072, in __init__

    super(CharField, self).__init__(*args, **kwargs)
  File 
"C:\Python27\lib\site-packages\django\db\models\fields\__init__.py", 
line 166, in __init__
    self.db_tablespace = db_tablespace or 
settings.DEFAULT_INDEX_TABLESPACE
  File "C:\Python27\lib\site-packages\django\conf\__init__.py", line 
55, in __getattr__

    self._setup(name)
  File "C:\Python27\lib\site-packages\django\conf\__init__.py", line 
43, in _setup

    self._wrapped = Settings(settings_module)
  File "C:\Python27\lib\site-packages\django\conf\__init__.py", line 
120, in __init__
    raise ImproperlyConfigured("The SECRET_KEY setting must not be 
empty.")
django.core.exceptions.ImproperlyConfigured: The SECRET_KEY setting 
must not be empty.
PS C:\Users\Dell\vms2> python manage.py makemigrations 
--settings=vms2.settings

Traceback (most recent call last):
  File "manage.py", line 10, in 
    execute_from_command_line(sys.argv)
  File 
"C:\Python27\lib\site-packages\django\core\management\__init__.py", 
line 353, in execute_from_command_line

    utility.execute()
  File 
"C:\Python27\lib\site-packages\django\core\management\__init__.py", 
line 345, in execute

self.fetch_command(subcommand).run_from_argv(self.argv)
  File 
"C:\Python27\lib\site-packages\django\core\management\__init__.py", 
line 195, in fetch_command

    klass = load_command_class(app_name, subcommand)
  File 
"C:\Python27\lib\site-packages\django\core\management\__init__.py", 
line 39, in load_command_class

    module = import_module('%s.management.commands.%s' % (app_name, name))
  File "C:\Python27\lib\importlib\__init__.py", line 37, in import_module
    __import__(name)
  File 
"C:\Python27\lib\site-packages\django\core\management\commands\makemigrations.py", 
line 8, in 

    from django.db.migrations.autodetector import MigrationAutodetector
  File 
"C:\Python27\lib\site-packages\django\db\migrations\autodetector.py", 
line 13, in 

    from django.db.migrations.questioner import MigrationQuestioner
  File 
"C:\Python27\lib\site-packages\django\db\migrations\questioner.py", 
line 12, in 

    from .loader import MigrationLoader
  File "C:\Python27\lib\site-packages\django\db\migrations\loader.py", 
line 10, in 

    from django.db.migrations.recorder import MigrationRecorder
  File 
"C:\Python27\lib\site-packages\django\db\migrations\recorder.py", line 
12, in 

    class MigrationRecorder(object):
  File 
"C:\Python27\lib\site-packages\django\db\migrations\recorder.py", line 
26, in MigrationRecorder

    class Migration(models.Model):
  File 
"C:\Python27\lib\site-packages\django\db\migrations\recorder.py", line 
27, in Migration

    app = models.CharField(max_length=255)
  File