Re: Django bootstrap calendar

2020-01-20 Thread Muhammed Rafi A
Refer this

https://simpleisbetterthancomplex.com/tutorial/2019/01/03/how-to-use-date-picker-with-django.html

On Mon, Jan 20, 2020 at 8:15 PM Perceval Maturure 
wrote:

> Dear All
> Is there anyone who has used the djangobootrstrap calendar in Django 2.xxx
> project?
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/9C8AB979-2DC4-4B6B-9D1D-FD9144E9F014%40gmail.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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CADwyzwo9HS3w%3D5npK%2BTn9ToEMTOOqVY-mdW%2Br951Uf9sy9dGnw%40mail.gmail.com.


Re: Primary Key

2020-01-20 Thread Muhammed Rafi A
import uuid
uuid.uuid4().hex[:8]

or


from django.utils.crypto import get_random_string
get_random_string(8).lower()

def get_random_string(length=12,
allowed_chars='abcdefghijklmnopqrstuvwxyz'
'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'):

On Mon, Jan 20, 2020 at 2:31 PM Soumen Khatua 
wrote:

> Hi Folks,
>
> I want to generate unique 6 digit primary key for django models and I want
> to generate this for 10 billon users. So guys please could you tell me How
> I can do that?
>
> I tried UUID module but it's generating some big numbers.
>
> Thank you
>
> Regards,
> Soumen
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAPUw6WZSz%3D0sPRJ40VTVHQRD8GtHh3m2zb64Te4ti8RF2f23Vg%40mail.gmail.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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CADwyzwo6LUiedx4b%3D0T9mEn%3DurULxfy%2BYvOMMXKeUMZyX0TfLw%40mail.gmail.com.


Re: select field(s) from myytable;

2020-01-10 Thread Muhammed Rafi A
Mytable.objects.values('f1', 'f2')

On Fri, Jan 10, 2020, 7:22 PM Klaus Laube  wrote:

> I'm not sure if I got your question right, but I guess `values()` is what
> you are looking for:
> https://docs.djangoproject.com/en/3.0/ref/models/querysets/#values
>
> From the documentation:
>
>> The values() method takes optional positional arguments, *fields, which
>> specify field names to which the SELECT should be limited. If you specify
>> the fields, each dictionary will contain only the field keys/values for the
>> fields you specify. If you don’t specify the fields, each dictionary will
>> contain a key and value for every field in the database table.
>
>
> Em sex., 10 de jan. de 2020 às 09:37, Mohsen Pahlevanzadeh <
> m.pahlevanza...@gmail.com> escreveu:
>
>> Hello everybody,
>>
>>
>> I can write a query with django if I have : "select * from mytable;"
>> But if I have a field , I can write, such as "select f1,f2 from mytable;"
>>
>> Please 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 view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/dda9aa1f-6f6b-451a-84b6-626397d2d95f%40googlegroups.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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAE89-bdNrrXzPN%2BSO7TFiYhrfpaHdKotftJaJfVacFy7L6m1Nw%40mail.gmail.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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CADwyzwoipjzJewbDA7MEjx%3DAW-dwO3T1%3D0jQGhp7T9FhHB44mg%40mail.gmail.com.


Django integration with node js

2020-01-09 Thread Muhammed RAFI A
Django integration with node js for any reference

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/e97b41e8-4529-434d-a61c-043b164c66e1%40googlegroups.com.


Re: Multi return values in single function

2020-01-04 Thread Muhammed Rafi A
return render(request, 'index.html', content)


On Sat, Jan 4, 2020, 8:09 PM nrupesh08  wrote:

> hi,
> I design cms design on the company profile website.
> 5 pages on the website:
>  index, about, services, projects, contact.
>
> the problem is,
> to display easily DB to frontend expect index page. because. all mixed
> retrieve DB. just main or sample of the display index page. like., about,
> service, project and contact.
>
> like,.: def index(request):
> content = {}
> return render(request, 'index.html', {})
>
> I want, like return values
>  def index(request):
> content = {
>about, services(4 services displayed), projects(2 project
> displayed), contact
> }
>  return render(request, 'index.html', {})
>
>
> but, *how to so many return values in one function?*
>
> please 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/915fc8da-b03f-4404-8007-803e520f68fe%40googlegroups.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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CADwyzwq8F6fgF6ysehw66c_EZLnvS7Erkd5F%2BQusPVCRqB9fQg%40mail.gmail.com.


Re: Hi everyone I am new in django and postgresql. Actually I am getting following error when i run the project, Although I am putting right password and username. Please Help me....

2020-01-03 Thread Muhammed Rafi A
password is not correct, check them or reset the password ones more

On Fri, Jan 3, 2020 at 2:58 PM shailendra singh 
wrote:

> The above exception was the direct cause of the following exception:
>
> Traceback (most recent call last):
>   File
> "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/threading.py",
> line 932, in _bootstrap_inner
> self.run()
>   File
> "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/threading.py",
> line 870, in run
> self._target(*self._args, **self._kwargs)
>   File
> "/Applications/Projects/venv/lib/python3.8/site-packages/django/utils/autoreload.py",
> line 53, in wrapper
> fn(*args, **kwargs)
>   File
> "/Applications/Projects/venv/lib/python3.8/site-packages/django/core/management/commands/runserver.py",
> line 120, in inner_run
> self.check_migrations()
>   File
> "/Applications/Projects/venv/lib/python3.8/site-packages/django/core/management/base.py",
> line 458, in check_migrations
> executor = MigrationExecutor(connections[DEFAULT_DB_ALIAS])
>   File
> "/Applications/Projects/venv/lib/python3.8/site-packages/django/db/migrations/executor.py",
> line 18, in __init__
> self.loader = MigrationLoader(self.connection)
>   File
> "/Applications/Projects/venv/lib/python3.8/site-packages/django/db/migrations/loader.py",
> line 49, in __init__
> self.build_graph()
>   File
> "/Applications/Projects/venv/lib/python3.8/site-packages/django/db/migrations/loader.py",
> line 212, in build_graph
> self.applied_migrations = recorder.applied_migrations()
>   File
> "/Applications/Projects/venv/lib/python3.8/site-packages/django/db/migrations/recorder.py",
> line 76, in applied_migrations
> if self.has_table():
>   File
> "/Applications/Projects/venv/lib/python3.8/site-packages/django/db/migrations/recorder.py",
> line 56, in has_table
> return self.Migration._meta.db_table in
> self.connection.introspection.table_names(self.connection.cursor())
>   File
> "/Applications/Projects/venv/lib/python3.8/site-packages/django/utils/asyncio.py",
> line 26, in inner
> return func(*args, **kwargs)
>   File
> "/Applications/Projects/venv/lib/python3.8/site-packages/django/db/backends/base/base.py",
> line 260, in cursor
> return self._cursor()
>   File
> "/Applications/Projects/venv/lib/python3.8/site-packages/django/db/backends/base/base.py",
> line 236, in _cursor
> self.ensure_connection()
>   File
> "/Applications/Projects/venv/lib/python3.8/site-packages/django/utils/asyncio.py",
> line 26, in inner
> return func(*args, **kwargs)
>   File
> "/Applications/Projects/venv/lib/python3.8/site-packages/django/db/backends/base/base.py",
> line 220, in ensure_connection
> self.connect()
>   File
> "/Applications/Projects/venv/lib/python3.8/site-packages/django/db/utils.py",
> line 90, in __exit__
> raise dj_exc_value.with_traceback(traceback) from exc_value
>   File
> "/Applications/Projects/venv/lib/python3.8/site-packages/django/db/backends/base/base.py",
> line 220, in ensure_connection
> self.connect()
>   File
> "/Applications/Projects/venv/lib/python3.8/site-packages/django/utils/asyncio.py",
> line 26, in inner
> return func(*args, **kwargs)
>   File
> "/Applications/Projects/venv/lib/python3.8/site-packages/django/db/backends/base/base.py",
> line 197, in connect
> self.connection = self.get_new_connection(conn_params)
>   File
> "/Applications/Projects/venv/lib/python3.8/site-packages/django/utils/asyncio.py",
> line 26, in inner
> return func(*args, **kwargs)
>   File
> "/Applications/Projects/venv/lib/python3.8/site-packages/django/db/backends/postgresql/base.py",
> line 185, in get_new_connection
> connection = Database.connect(**conn_params)
>   File
> "/Applications/Projects/venv/lib/python3.8/site-packages/psycopg2/__init__.py",
> line 126, in connect
> conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
> django.db.utils.OperationalError: FATAL:  password authentication failed
> for user "postgres"
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/fdcdb68e-ce8d-4326-a519-7ae07a51ee2f%40googlegroups.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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CADwyzwrGjjao35efTZ6euL%2BYx%2BvV6VQkyUbPU2dd0o4UQyo6mA%40mail.gmail.com.