Re: django formset

2017-04-30 Thread vicalloy
I think you can select the field by class. Or $('name$=-fieldname')
On Fri, 28 Apr 2017 at 19:15 shahab emami  wrote:

> hello
> i search for my question on google and this group by i couldn't find the
> answer.
> maybe I am not a good searcher.D
>
> i have a formset.
> there is a field for birth date in my form then as you know there are a
> few birth date field in my formset. I use this jquery plugin to add form
> dynamically:
>
> https://github.com/elo80ka/django-dynamic-formset
>
> every thing is good until now.  but because I have a date field in my form
> i want to
>
> use this jquery plugin :
>
> Datepicker | jQuery UI
>
>
>
> then user can select date from this calendar .
> but i don't now the id of date field in the form.
> how can i select it with jquery  when i don't now the id of it?
> I tried to find it with inspect element but i understood the id is
> different in every form.
> if you can tell me the idea to solving this problem or
> introduce somewhere that i can read about this i will be thankful.
>
>
> --
> 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/26a172d0-cd75-45e3-aa0c-f795dd40d754%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>
-- 
Blog: https://haoluobo.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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAATL4yxHNnBESuaFRW4skObCkjTpuBLe3%2B%2B_TD%3DbmOjjCp5M6w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django Tutorial | sqlmigrate command ending in error

2017-04-30 Thread Nikhil Reddy
Can anyone kindly help me on this issue?

Thanks,
Nikhil

On Friday, 21 April 2017 18:40:43 UTC+5:30, Nikhil Reddy wrote:
>
> Hi,
>
> I am going through this tutorial 
> . When I execute 
> the command: "python manage.py sqlmigrate polls 0001" it is ending in below 
> error.
>
> Please help resolve the issue.
>
>
> *Error:*
>
> Traceback (most recent call last):
>   File "manage.py", line 22, in 
> execute_from_command_line(sys.argv)
>   File 
> "/scratch/njakkula/NJ/py_Oracle/bugdb/triage/lib/python2.7/site-packages/django/core/management/__init__.py",
>  line 363, in execute_from_command_line
> utility.execute()
>   File 
> "/scratch/njakkula/NJ/py_Oracle/bugdb/triage/lib/python2.7/site-packages/django/core/management/__init__.py",
>  line 355, in execute
> self.fetch_command(subcommand).run_from_argv(self.argv)
>   File 
> "/scratch/njakkula/NJ/py_Oracle/bugdb/triage/lib/python2.7/site-packages/django/core/management/base.py",
>  line 283, in run_from_argv
> self.execute(*args, **cmd_options)
>   File 
> "/scratch/njakkula/NJ/py_Oracle/bugdb/triage/lib/python2.7/site-packages/django/core/management/commands/sqlmigrate.py",
>  line 33, in execute
> return super(Command, self).execute(*args, **options)
>   File 
> "/scratch/njakkula/NJ/py_Oracle/bugdb/triage/lib/python2.7/site-packages/django/core/management/base.py",
>  line 330, in execute
> output = self.handle(*args, **options)
>   File 
> "/scratch/njakkula/NJ/py_Oracle/bugdb/triage/lib/python2.7/site-packages/django/core/management/commands/sqlmigrate.py",
>  line 62, in handle
> sql_statements = executor.collect_sql(plan)
>   File 
> "/scratch/njakkula/NJ/py_Oracle/bugdb/triage/lib/python2.7/site-packages/django/db/migrations/executor.py",
>  line 219, in collect_sql
> with self.connection.schema_editor(collect_sql=True, 
> atomic=migration.atomic) as schema_editor:
>   File 
> "/scratch/njakkula/NJ/py_Oracle/bugdb/triage/lib/python2.7/site-packages/django/db/backends/sqlite3/schema.py",
>  line 25, in __enter__
> self._initial_pragma_fk = c.fetchone()[0]
> TypeError: 'NoneType' object has no attribute '__getitem__'
>
>
> *Versions:*
>
> Python 2.7.13
>
> Django 1.11
>
> sqlite3 2.6.0
>
>

-- 
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/c2854687-dced-4527-90e9-2c0de618b92e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django Tutorial | sqlmigrate command ending in error

2017-04-30 Thread Daniel Roseman
You haven't given nearly enough information to help you. You need at least to 
post the contents of your polls/migrations/0001_initial.py, and your DATABASES 
settings.
-- 
DR.

-- 
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/1bf9059a-082f-4dcd-8f15-816ee598b9e4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Error was: cannot import name 'GDALRaster in Window 8.1

2017-04-30 Thread Prashant Verma
C:\User\.\Desktop\Geolocation>*python manage.py makemigrations*
Traceback (most recent call last):
  File 
"C:\Users\Prashant\Desktop\Geolocation\casino_locater\lib\site-packages\django\db\utils.py",
 
line 115, in load_backend
return import_module('%s.base' % backend_name)
  File 
"C:\Users\Prashant\Desktop\Geolocation\casino_locater\lib\importlib\__init__.py",
 
line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
  File "", line 978, in _gcd_import
  File "", line 961, in _find_and_load
  File "", line 950, in _find_and_load_unlocked
  File "", line 655, in _load_unlocked
  File "", line 677, in exec_module
  File "", line 205, in 
_call_with_frames_removed
  File 
"C:\Users\Prashant\Desktop\Geolocation\casino_locater\lib\site-packages\django\contrib\gis\db\backends\postgis\base.py",
 
line 7, in 
from .operations import PostGISOperations
  File 
"C:\Users\Prashant\Desktop\Geolocation\casino_locater\lib\site-packages\django\contrib\gis\db\backends\postgis\operations.py",
 
line 7, in 
from django.contrib.gis.gdal import GDALRaster
ImportError: cannot import name 'GDALRaster'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "manage.py", line 22, in 
execute_from_command_line(sys.argv)
  File 
"C:\Users\Prashant\Desktop\Geolocation\casino_locater\lib\site-packages\django\core\management\__init__.py",
 
line 363, in execute_from_command_line
utility.execute()
  File 
"C:\Users\Prashant\Desktop\Geolocation\casino_locater\lib\site-packages\django\core\management\__init__.py",
 
line 337, in execute
django.setup()
  File 
"C:\Users\Prashant\Desktop\Geolocation\casino_locater\lib\site-packages\django\__init__.py",
 
line 27, in setup
apps.populate(settings.INSTALLED_APPS)
  File 
"C:\Users\Prashant\Desktop\Geolocation\casino_locater\lib\site-packages\django\apps\registry.py",
 
line 108, in populate
app_config.import_models()
  File 
"C:\Users\Prashant\Desktop\Geolocation\casino_locater\lib\site-packages\django\apps\config.py",
 
line 202, in import_models
self.models_module = import_module(models_module_name)
  File 
"C:\Users\Prashant\Desktop\Geolocation\casino_locater\lib\importlib\__init__.py",
 
line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
  File "", line 978, in _gcd_import
  File "", line 961, in _find_and_load
  File "", line 950, in _find_and_load_unlocked
  File "", line 655, in _load_unlocked
  File "", line 677, in exec_module
  File "", line 205, in 
_call_with_frames_removed
  File 
"C:\Users\Prashant\Desktop\Geolocation\casino_locater\lib\site-packages\django\contrib\auth\models.py",
 
line 4, in 
from django.contrib.auth.base_user import AbstractBaseUser, 
BaseUserManager
  File 
"C:\Users\Prashant\Desktop\Geolocation\casino_locater\lib\site-packages\django\contrib\auth\base_user.py",
 
line 52, in 
class AbstractBaseUser(models.Model):
  File 
"C:\Users\Prashant\Desktop\Geolocation\casino_locater\lib\site-packages\django\db\models\base.py",
 
line 124, in __new__
new_class.add_to_class('_meta', Options(meta, app_label))
  File 
"C:\Users\Prashant\Desktop\Geolocation\casino_locater\lib\site-packages\django\db\models\base.py",
 
line 330, in add_to_class
value.contribute_to_class(cls, name)
  File 
"C:\Users\Prashant\Desktop\Geolocation\casino_locater\lib\site-packages\django\db\models\options.py",
 
line 214, in contribute_to_class
self.db_table = truncate_name(self.db_table, 
connection.ops.max_name_length())
  File 
"C:\Users\Prashant\Desktop\Geolocation\casino_locater\lib\site-packages\django\db\__init__.py",
 
line 33, in __getattr__
return getattr(connections[DEFAULT_DB_ALIAS], item)
  File 
"C:\Users\Prashant\Desktop\Geolocation\casino_locater\lib\site-packages\django\db\utils.py",
 
line 211, in __getitem__
backend = load_backend(db['ENGINE'])
  File 
"C:\Users\Prashant\Desktop\Geolocation\casino_locater\lib\site-packages\django\db\utils.py",
 
line 134, in load_backend
raise ImproperlyConfigured(error_msg)
django.core.exceptions.ImproperlyConfigured: 
'django.contrib.gis.db.backends.postgis' isn't an available database 
backend.
Try using 'django.db.backends.XXX', where XXX is one of:
'mysql', 'oracle', 'postgresql', 'sqlite3'
Error was: cannot import name 'GDALRaster'

-- 
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/685aa07a-b912-4945-9494-60991791ba89%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
INSTALLED_APPS = [
'django.contri

about tutorial "app reusable section" issue

2017-04-30 Thread Xuanbei Lu
Hi Django experts,

I'm new to django. I followed up the tutorial and everything is right on 
the way until the re-use app section. According to the tutorial, after 
packaging and installing the polls app using pip, I removed the directory 
'polls' in 'mysite'. Then when I try to run "python manage.py runserver", 
it reported error as "No module named 'polls'". I just do exactly the same 
things as the tutorial said, could any one share me with some experience 
about the root cause?

thank you in advance!!

xuanbei

-- 
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/9e719510-613d-42a8-9250-9c058d5b3ad3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Why do I get this error "context must be a dict rather than Context." ?

2017-04-30 Thread Pubudu Goonetilleke
Thank you very much.

On Saturday, April 29, 2017 at 2:44:57 PM UTC-7, Pubudu Goonetilleke wrote:
>
> My code : I am following tutorial on Django site and this is where I got 
> stuck 
> 
>
> 
> "current_datetime"
> I am not sure why I get the Type Error at line 20. Its same as tutorial. 
>
>
> 
>
> When
>  
> I run the server, I get the following error :  
> 
>
> 
> TypeError at /time/
>
> context must be a dict rather than Context.
>
> Request Method: GET
> Request URL: http://127.0.0.1:8000/time/
> Django Version: 1.11
> Exception Type: TypeError
> Exception Value: 
>
> context must be a dict rather than Context.
>
> Exception Location: 
> D:\Users\Pubudu\AppData\Local\Programs\Python\Python36\lib\site-packages\django\template\context.py
>  
> in make_context, line 287
> Python Executable: 
> D:\Users\Pubudu\AppData\Local\Programs\Python\Python36\python.exe
> Python Version: 3.6.1
> Python Path: 
>
> ['C:\\Users\\Pubudu\\workspace\\hello',
>  
> 'D:\\Users\\Pubudu\\AppData\\Local\\Programs\\Python\\Python36\\python36.zip',
>  'D:\\Users\\Pubudu\\AppData\\Local\\Programs\\Python\\Python36\\DLLs',
>  'D:\\Users\\Pubudu\\AppData\\Local\\Programs\\Python\\Python36\\lib',
>  'D:\\Users\\Pubudu\\AppData\\Local\\Programs\\Python\\Python36',
>  
> 'D:\\Users\\Pubudu\\AppData\\Local\\Programs\\Python\\Python36\\lib\\site-packages']
>
> Server time: Sat, 29 Apr 2017 21:35:31 +
> Traceback Switch to copy-and-paste view 
>
>- 
>
> D:\Users\Pubudu\AppData\Local\Programs\Python\Python36\lib\site-packages\django\core\handlers\exception.py
> in inner
>1. 
>   
>   response = get_response(request)
>   
>   ...
>▶ Local vars 
>- 
>
> D:\Users\Pubudu\AppData\Local\Programs\Python\Python36\lib\site-packages\django\core\handlers\base.py
> in _get_response
>1. 
>   
>   response = self.process_exception_by_middleware(e, 
> request)
>   
>   ...
>▶ Local vars 
>- 
>
> D:\Users\Pubudu\AppData\Local\Programs\Python\Python36\lib\site-packages\django\core\handlers\base.py
> in _get_response
>1. 
>   
>   response = wrapped_callback(request, *callback_args, 
> **callback_kwargs)
>   
>   
>
> 
>
> 
>

-- 
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/cd46c770-0d77-4010-ba39-515c58df2bf4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


After upgrading 1.1 to 1.6 users with old passwords can log on new users can not log on.

2017-04-30 Thread NoviceSortOf


After upgrading from 1.1 to 1.6  all of our older registrants can logon but
new registrants can not using their new passwords.

Its as if Django will read the old passwords, but somehow it no longer
encrypts new passwords that are readable. 

I do see a structural difference in the new passwords

The old passwords looked like this
sha1$c9289$7c6d5430101f10bab8fe5f1991fcaaa7630b36b1

the new passwords look like this

pbkdf2_sha256$12000$joygsrjfs4s8$hL3Fo+g3DxWgZkgZEGonVXJzo+EWm7AuYjA39IAlMNo=

It appears to be in order to be backwards compatible somewhere in Django I 
need to switch
back to the whatever was creating the sha passwords.

Where in the can I do that?

Please advise 

-- 
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/2930ae48-8614-40ec-8895-e406cf5cf08f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: After upgrading 1.1 to 1.6 users with old passwords can log on new users can not log on.

2017-04-30 Thread m1chael
Hi,

This explains your issue in detail:

https://docs.djangoproject.com/en/1.11/releases/1.10/#removed-weak-password-hashers-from-the-default-password-hashers-setting

..and talks about a very easy workaround

Mike

On Sun, Apr 30, 2017 at 4:25 PM, NoviceSortOf 
wrote:

>
>
> After upgrading from 1.1 to 1.6  all of our older registrants can logon but
> new registrants can not using their new passwords.
>
> Its as if Django will read the old passwords, but somehow it no longer
> encrypts new passwords that are readable.
>
> I do see a structural difference in the new passwords
>
> The old passwords looked like this
> sha1$c9289$7c6d5430101f10bab8fe5f1991fcaaa7630b36b1
>
> the new passwords look like this
>
> pbkdf2_sha256$12000$joygsrjfs4s8$hL3Fo+g3DxWgZkgZEGonVXJzo+
> EWm7AuYjA39IAlMNo=
>
> It appears to be in order to be backwards compatible somewhere in Django I
> need to switch
> back to the whatever was creating the sha passwords.
>
> Where in the can I do that?
>
> Please advise
>
> --
> 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/2930ae48-8614-40ec-8895-e406cf5cf08f%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/CAAuoY6OP9N5h11ciPLofrGFSYFrn6pJhN4Okkdn%3DKbzTVyr_zw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.