Re: can we integrate html views that look far better then what is available with django

2021-03-05 Thread sridhar vumma
Does using bootstrap improve the view of each page,
Thanks & Regards,
Sridhar.V
+91-9591729335


On Fri, Feb 19, 2021 at 12:21 PM sridhar vumma 
wrote:

> The look and feel with typical example flows possible for html were not
> looking similar to websites like stackoverflow.com so i had a doubt if
> they all look very image free. I am a starter with Django.
>
> Thanks & Regards,
> Sridhar.V
> +91-9591729335
>
>
> On Thu, Feb 18, 2021 at 8:07 PM Andréas Kühne 
> wrote:
>
>> Hi,
>>
>> This is a very strange question? You can create anything you want with
>> Django. For example Instagram and Youtube are built with Django. The
>> framework allows for any design that you really want yourself - you just
>> need to design the HTML the way you want - I have personally used Django
>> for many different projects and they all look different. There is no
>> default layout for Django - so I think I don't really understand your
>> question :)
>>
>> Regards,
>>
>> Andréas
>>
>>
>> Den tors 18 feb. 2021 kl 14:43 skrev sridhar vumma > >:
>>
>>> we see better html views with websites like stackoverflow.com can we
>>> integrate such high end html websites along with django is that possible
>>>
>>> --
>>> 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/e771045b-907f-479a-80c0-dd5f0079593cn%40googlegroups.com
>>> 
>>> .
>>>
>> --
>> 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/lRQXOzu-qps/unsubscribe.
>> To unsubscribe from this group and all its topics, 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/CAK4qSCekgAb3CAW4sKF3r8wcujUOmtA9xtnMSqY%2B%3DLZzT9Gw%3DA%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/CANoZYUoZN-Y-xH2_J6NWe3yB2XgOzROhOqYFgNL%2B3G_eZZvkVg%40mail.gmail.com.


Re: Smaller project that would be payed

2021-03-05 Thread Sebastian Jung
Hello Ahmed,

I am well but implementation new widget is not so easy. I hope that you
want to help me.

Regards

Am Fr., 5. März 2021 um 11:11 Uhr schrieb Ahmed omar miladi <
ahmedomarmil...@gmail.com>:

> hello sebasty how are you?
>
>
> On Fri, 5 Mar 2021 at 16:31, sebasti...@gmail.com <
> sebastian.ju...@gmail.com> wrote:
>
>> Hello,
>>
>>  i need a freelancer that implement me a new widget bzw. modelclass that
>> can represent a select with hierarichal structure like this:
>>
>> http://embed.plnkr.co/BRQtUKbxZdZItLslHflM/
>>
>> i know that a implementation like django-mptt can store this in database.
>> I am beginner so i want in my existing model:
>>
>> class adress(model.Model):
>>   name = model.CharField()
>>
>> insert a new field with a new model class and then django render in
>> template a new widget like: http://embed.plnkr.co/BRQtUKbxZdZItLslHflM/
>> and when i save it also the tree ist stored. When i open update view then
>> the widget is filled.
>>
>> Please make me an offer to give me this implementation inkl. new widget.
>>
>> 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 view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/1e75a653-a24f-46c2-bb89-38f9bcb2aef2n%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/CAE3Dc2OXE7c4SRrQogUBSgKETsBXCczA5eCD_tRPr716VR8W1Q%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/CAKGT9mxUwOHemj4UYRTuPK1YjMu%3Dqbu_mERETKUu2r%2B4K%3DYuNw%40mail.gmail.com.


Re: A very easy problem that I couldn't figure it out! PLEASE HELP^^

2021-03-05 Thread Gabriel Araya Garcia
Kasper is right, we need more clear.
But anyway, here is one example. In settings.py:

from pathlib import Path
import os

ROOT_URLCONF = 'sclub.urls'

TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': ['sclub/appsclub/templates'],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]

sclub is my project and appsclub is my App





Gabriel Araya Garcia
GMI - Desarrollo de Sistemas Informáticos




El vie, 5 mar 2021 a las 11:16, NB DEV () escribió:

>
> Environment:
>
>
> Request Method: GET
> Request URL: http://127.0.0.1:8000/
>
> Django Version: 3.1.7
> Python Version: 3.9.1
> Installed Applications:
> ['django.contrib.admin',
>  'django.contrib.auth',
>  'django.contrib.contenttypes',
>  'django.contrib.sessions',
>  'django.contrib.messages',
>  'django.contrib.staticfiles',
>  'pages.apps.PagesConfig']
> Installed Middleware:
> ['django.middleware.security.SecurityMiddleware',
>  'django.contrib.sessions.middleware.SessionMiddleware',
>  'django.middleware.common.CommonMiddleware',
>  'django.middleware.csrf.CsrfViewMiddleware',
>  'django.contrib.auth.middleware.AuthenticationMiddleware',
>  'django.contrib.messages.middleware.MessageMiddleware',
>  'django.middleware.clickjacking.XFrameOptionsMiddleware']
>
> Template loader postmortem
> Django tried loading these templates, in this order:
>
> Using engine django:
> * django.template.loaders.filesystem.Loader:
> C:\Users\napil\Desktop\dev\btre_project\templates\pages\index.html (Source
> does not exist)
> * django.template.loaders.app_directories.Loader:
> C:\Users\napil\Desktop\dev\btre_project\venv\lib\site-packages\django\contrib\admin\templates\pages\index.html
> (Source does not exist)
> * django.template.loaders.app_directories.Loader:
> C:\Users\napil\Desktop\dev\btre_project\venv\lib\site-packages\django\contrib\auth\templates\pages\index.html
> (Source does not exist)
>
>
>
> Traceback (most recent call last):
>   File
> "C:\Users\napil\Desktop\dev\btre_project\venv\lib\site-packages\django\core\handlers\exception.py",
> line 47, in inner
> response = get_response(request)
>   File
> "C:\Users\napil\Desktop\dev\btre_project\venv\lib\site-packages\django\core\handlers\base.py",
> line 181, in _get_response
> response = wrapped_callback(request, *callback_args, **callback_kwargs)
>   File "C:\Users\napil\Desktop\dev\btre_project\pages\views.py", line 6,
> in index
> return render(request, 'pages/index.html')
>   File
> "C:\Users\napil\Desktop\dev\btre_project\venv\lib\site-packages\django\shortcuts.py",
> line 19, in render
> content = loader.render_to_string(template_name, context, request,
> using=using)
>   File
> "C:\Users\napil\Desktop\dev\btre_project\venv\lib\site-packages\django\template\loader.py",
> line 61, in render_to_string
> template = get_template(template_name, using=using)
>   File
> "C:\Users\napil\Desktop\dev\btre_project\venv\lib\site-packages\django\template\loader.py",
> line 19, in get_template
> raise TemplateDoesNotExist(template_name, chain=chain)
>
> Exception Type: TemplateDoesNotExist at /
> Exception Value: pages/index.html
>
> --
> 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/9f6202d4-5ab8-4c58-a7c6-1d55a9d2fb7an%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/CAKVvSDBqY555Y4sUxTXnVQp5SibfPbjrLb0acr35HMkwozxwEw%40mail.gmail.com.


Re: A very easy problem that I couldn't figure it out! PLEASE HELP^^

2021-03-05 Thread Mohammad Anarul
[image: Screenshot_7.png]

On Fri, Mar 5, 2021 at 9:36 PM Kasper Laudrup  wrote:

> If you want someone to help you, please do take the time to write a
> proper question.
>
> Just posting an error message and screaming for help will most likely
> not get you a lot of help.
>
> Learning how to communicate with other people is an important part of
> being a developer.
>
> Kind regards,
>
> Kasper Laudrup
>
> --
> 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/0eefd4d6-2d23-ce61-f694-f07b30c9a4ed%40stacktrace.dk
> .
>

-- 
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/CAE59x8d6ob666k13D_V05LkSwbXNjsvyp4xqjZeVgh9h_a%3D7qg%40mail.gmail.com.


Re: Smaller project that would be payed

2021-03-05 Thread Ahmed omar miladi
hello sebasty how are you?


On Fri, 5 Mar 2021 at 16:31, sebasti...@gmail.com 
wrote:

> Hello,
>
>  i need a freelancer that implement me a new widget bzw. modelclass that
> can represent a select with hierarichal structure like this:
>
> http://embed.plnkr.co/BRQtUKbxZdZItLslHflM/
>
> i know that a implementation like django-mptt can store this in database.
> I am beginner so i want in my existing model:
>
> class adress(model.Model):
>   name = model.CharField()
>
> insert a new field with a new model class and then django render in
> template a new widget like: http://embed.plnkr.co/BRQtUKbxZdZItLslHflM/
> and when i save it also the tree ist stored. When i open update view then
> the widget is filled.
>
> Please make me an offer to give me this implementation inkl. new widget.
>
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/1e75a653-a24f-46c2-bb89-38f9bcb2aef2n%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/CAE3Dc2OXE7c4SRrQogUBSgKETsBXCczA5eCD_tRPr716VR8W1Q%40mail.gmail.com.


Re: login and signup form in one view

2021-03-05 Thread uma shankar
please tell me how to do that 

On Friday, 5 March 2021 at 22:21:54 UTC+5:30 uma shankar wrote:

> I want to connect my Html input  tags with fields created in models .py 
> using the name attribute of each input tag
>
> def user_login(request): 
> if request.method=='POST':
> if request.POST.get('submit') == 'checkform1':
> user_form = SignupForm(data = request.POST) # i want this to 
> connect with html input tags using the name attribute but they are 
> overlapping each other
>
> return render(request,'first_app/Login.html')
> On Friday, 5 March 2021 at 21:34:02 UTC+5:30 Kasper Laudrup wrote:
>
>> On 05/03/2021 16.39, Eugene TUYIZERE wrote: 
>> > Then, what is the problem 
>> > 
>>
>> I have no idea. Doesn't seem like there is any. 
>>
>> I guess Uma just wanted to share what he's currently working with for 
>> some reason. Would be nice if he shared it if he's come up with some 
>> clever solution though. 
>>
>> Kind regards, 
>>
>> Kasper Laudrup 
>>
>

-- 
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/6d27cf6e-9e8a-4ada-83b4-42738943a40cn%40googlegroups.com.


Re: login and signup form in one view

2021-03-05 Thread uma shankar
I want to connect my Html input  tags with fields created in models .py 
using the name attribute of each input tag

def user_login(request): 
if request.method=='POST':
if request.POST.get('submit') == 'checkform1':
user_form = SignupForm(data = request.POST) # i want this to 
connect with html input tags using the name attribute but they are 
overlapping each other

return render(request,'first_app/Login.html')
On Friday, 5 March 2021 at 21:34:02 UTC+5:30 Kasper Laudrup wrote:

> On 05/03/2021 16.39, Eugene TUYIZERE wrote:
> > Then, what is the problem
> > 
>
> I have no idea. Doesn't seem like there is any.
>
> I guess Uma just wanted to share what he's currently working with for 
> some reason. Would be nice if he shared it if he's come up with some 
> clever solution though.
>
> Kind regards,
>
> Kasper Laudrup
>

-- 
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/ed93ac8e-198a-4366-989b-4fb94e23c312n%40googlegroups.com.


how to fix in Missing statements in pytest

2021-03-05 Thread Salima Begum
Hi all,
I am using pytest for testing my django application. I have written test
cases for models, views, urls all test cases are running successfully but
In the coverage report of pytest I am getting some missing statements. Is
there any packages or plugin to resolve this missing statements issue.

Thanks
~Salima

-- 
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/CAMSz6b%3DKGOTsJz0WqaonsBPcCMowunK%3DCE062jAPoNF07f202A%40mail.gmail.com.


Re: custom list_display in admin - problem in production server

2021-03-05 Thread dupakoor kannan
>>>First of all, create a new thread instead of just highjacking an
existing one.

I have created this thread. I didn't use the existing thread.

>>>Second of all, set up some logging on your development server:

Thanks for the suggestion. I will add logging and look for the error
message.



Thanks
Kannan

On Fri, Mar 5, 2021 at 11:08 AM Kasper Laudrup 
wrote:

> On 05/03/2021 17.01, dupakoor kannan wrote:
> > I have a form where users submit protein sequences that are stored in
> > the user_submission model. In Django admin, I have added a custom list
> > display naming_algorithm (like below). It takes the obj. sequence and
> > runs an external script and displays the output in HTML. It works
> > locally well. When I try to use it on the production server it shows
> > nginx 502 Bad Gateway. FYI: I use nginx and uWSGI for deployment. Please
> > let me know if you need any other information.
> >
>
> First of all, create a new thread instead of just highjacking an
> existing one. As far as I can tell, your problem is no way related to
> the original thread.
>
> Second of all, set up some logging on your development server:
>
> https://uwsgi.readthedocs.io/en/latest/Logging.html
>
> Most likely there will be some error in the logs that should make it
> clear what the cause of the error is, if not, feel free to post the
> relevant error message here and I'm sure someone will be happy to help.
>
> Kind regards,
>
> Kasper Laudrup
>
> --
> 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/7f412a74-2204-b894-8f8e-18bacf489e17%40stacktrace.dk
> .
>

-- 
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/CADiZb_dQ3Ui9PEb%2BGL5SFZ2CuJFGeZJsRU_R6v9sRx0E6KffmA%40mail.gmail.com.


Re: custom list_display in admin - problem in production server

2021-03-05 Thread Kasper Laudrup

On 05/03/2021 17.01, dupakoor kannan wrote:
I have a form where users submit protein sequences that are stored in 
the user_submission model. In Django admin, I have added a custom list 
display naming_algorithm (like below). It takes the obj. sequence and 
runs an external script and displays the output in HTML. It works 
locally well. When I try to use it on the production server it shows 
nginx 502 Bad Gateway. FYI: I use nginx and uWSGI for deployment. Please 
let me know if you need any other information.




First of all, create a new thread instead of just highjacking an 
existing one. As far as I can tell, your problem is no way related to 
the original thread.


Second of all, set up some logging on your development server:

https://uwsgi.readthedocs.io/en/latest/Logging.html

Most likely there will be some error in the logs that should make it 
clear what the cause of the error is, if not, feel free to post the 
relevant error message here and I'm sure someone will be happy to help.


Kind regards,

Kasper Laudrup

--
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/7f412a74-2204-b894-8f8e-18bacf489e17%40stacktrace.dk.


Re: login and signup form in one view

2021-03-05 Thread Kasper Laudrup

On 05/03/2021 16.39, Eugene TUYIZERE wrote:

Then, what is the problem



I have no idea. Doesn't seem like there is any.

I guess Uma just wanted to share what he's currently working with for 
some reason. Would be nice if he shared it if he's come up with some 
clever solution though.


Kind regards,

Kasper Laudrup

--
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/05b1f52d-aa05-ed15-4f0d-f14ffc6ad242%40stacktrace.dk.


RE: custom list_display in admin - problem in production server

2021-03-05 Thread dupakoor kannan
I have a form where users submit protein sequences that are stored in the
user_submission model. In Django admin, I have added a custom list display
naming_algorithm (like below). It takes the obj. sequence and runs an
external script and displays the output in HTML. It works locally well.
When I try to use it on the production server it shows nginx 502 Bad
Gateway. FYI: I use nginx and uWSGI for deployment. Please let me know if
you need any other information.


class UserSubmissionAdmin(admin.ModelAdmin):

list_display = (
'submittersname',
'accession_url',
'naming_algorithm',
)

   def naming_algorithm(self, obj):
if ">" in str(obj.sequence).split('\n')[0]:
obj.sequence = '\n'.join(
str(obj.sequence).split('\n')[1:])
return format_html('Naming Algorithm'.format(obj.sequence, obj.id))

I have a few questions

1) In the production server if I change DEBUG=True the above function works
and displays the expected result. If I change it to DEBUG=False nginx
reports 502 Bad Gateway. I changed this to see a detailed traceback error.
Why this happens and how to approach the problem and fix it. Any pointers
will help.

2) As you can see in the screenshot, I am passing the protein sequence
through the URL. It seems to me there must be a better way to do it. I am
unaware of it. Do you have any suggestions or alternative ways or
source material to read?

Thank you
Kannan

-- 
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/CADiZb_dZLMPPr_guLvJQOGC7RLncjMwuNaQm8WhAXy--Td3DTg%40mail.gmail.com.


Re: login and signup form in one view

2021-03-05 Thread Eugene TUYIZERE
Then, what is the problem

Sent from my iPhone

> On 5 Mar 2021, at 17:31, Kasper Laudrup  wrote:
> 
>> On 05/03/2021 13.59, uma shankar wrote:
>> i have two forms in one html file and i want to write both of them in single 
>> view with and without submit buttons
>> 
> 
> OK. Sounds simple enough. Good luck.
> 
> Kind regards,
> 
> Kasper Laudrup
> 
> -- 
> 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/c1bbb435-a757-6491-459c-b84d9cc50b73%40stacktrace.dk.

-- 
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/9978AD6C-36AA-46E4-9B34-5D42ACB048BF%40gmail.com.


Re: A very easy problem that I couldn't figure it out! PLEASE HELP^^

2021-03-05 Thread Kasper Laudrup
If you want someone to help you, please do take the time to write a 
proper question.


Just posting an error message and screaming for help will most likely 
not get you a lot of help.


Learning how to communicate with other people is an important part of 
being a developer.


Kind regards,

Kasper Laudrup

--
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/0eefd4d6-2d23-ce61-f694-f07b30c9a4ed%40stacktrace.dk.


Re: login and signup form in one view

2021-03-05 Thread Kasper Laudrup

On 05/03/2021 13.59, uma shankar wrote:
i have two forms in one html file and i want to write both of them in 
single view with and without submit buttons




OK. Sounds simple enough. Good luck.

Kind regards,

Kasper Laudrup

--
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/c1bbb435-a757-6491-459c-b84d9cc50b73%40stacktrace.dk.


Smaller project that would be payed

2021-03-05 Thread sebasti...@gmail.com
Hello,

 i need a freelancer that implement me a new widget bzw. modelclass that 
can represent a select with hierarichal structure like this:

http://embed.plnkr.co/BRQtUKbxZdZItLslHflM/

i know that a implementation like django-mptt can store this in database. I 
am beginner so i want in my existing model: 

class adress(model.Model):
  name = model.CharField()

insert a new field with a new model class and then django render in 
template a new widget like: http://embed.plnkr.co/BRQtUKbxZdZItLslHflM/ and 
when i save it also the tree ist stored. When i open update view then the 
widget is filled.

Please make me an offer to give me this implementation inkl. new widget.

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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/1e75a653-a24f-46c2-bb89-38f9bcb2aef2n%40googlegroups.com.


Api's for another projects.

2021-03-05 Thread Sheldon Le Cooper
  Hi Experts,

I have requirement of Django Api's.

Brief about the requirement:

I have 2 projects (A and B), I did develop the API'S for Project A. The 
Project A has been deployed in CentOs with NGNIX server.  Now I wanna use 
the Project A Api's in Project B.

Kindly suggest me how to achieve this requirement.
Kindly suggest me any blogs or videos.

Note: Just  I wanna give Project A API"S Urls to project B.

Regards
Sheldon

-- 
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/b59f3672-9348-4bd7-ac64-2b54e73a3351n%40googlegroups.com.


login and signup form in one view

2021-03-05 Thread uma shankar
i have two forms in one html file and i want to write both of them in 
single view with and without submit buttons

-- 
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/edd43fc2-bb95-429e-bf20-b5821afa25cbn%40googlegroups.com.


Re: Bind device with login id and password

2021-03-05 Thread Benjamin Schollnick


> On Mar 5, 2021, at 12:52 AM, Sachin Kumar  wrote:
> 
> Hi Experts,
> 
> Is there any way or logic in Django where we can bind user login id and 
> password with first device login id.
> for example:- 
> If a user first time login into a PC A, he can't login into PC B using same 
> login id. He can only login into PC A with his login id. if he changes the PC 
> then from backend we can remove his old registration and he can login into 
> New PC.
> 
> Please help me with the logic or any tutorial on this.

Built-in?  I doubt it.

But create a database field in the user record that you’ll use to store the IP 
in.  If the field is None, then accept any and all logins.  On a successful 
login, if the field is not None, then only allow a login if it’s from the IP 
address in that field.

Now,  ask yourself, why this isn’t normal procedure?

Simply because IP Addresses change, and people need to login from multiple 
devices (eg. Facebook on Desktop computer, Facebook on mobile device, etc).

Instead if you are looking for a more secure method of logging in, look at SQRL 
- https://github.com/miki725/django-sqrl 


And that’s “Squirrel” SQRL, designed by Steve gibson of GRC 
https://www.grc.com/sqrl/sqrl.htm 

But I have to Thank you, since I didn’t realize that there was a Django SQRL 
implementation until I just looked.  I’m going to look at adding this into my 
app.

- Benjamin

 

-- 
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/043E5C63-5725-4E45-BF5E-2D7B8337B23D%40schollnick.net.


Re: How to hide/disable ModelAdmin

2021-03-05 Thread zvo...@seznam.cz
Seems I know the answer:

class HiddenAdmin(admin.ModelAdmin):
has_module_permission = lambda self, req: False

https://stackoverflow.com/questions/2431727/django-admin-hide-a-model
https://stackoverflow.com/questions/49293901/hide-model-from-main-admin-list-but-allow-creation-in-inline-editor
Dne čtvrtek 4. března 2021 v 21:22:41 UTC+1 uživatel zvo...@seznam.cz 
napsal:

> I want use Django 2+ autocomplete_fields.
> Adding them into (source) ModelAdmin will give lot of errors (see bellow).
> So I must add a (target) ModelAdmin with search_fields=...
>
> After that everything works.
> However I don't want to have such new ModelAdmin's visible/accessible.
> I have data of their models already much better accessible in Inlines.
>
> Is there a way how to give search_fields=.. and not show the new 
> ModelAdmin?
>
> Thank you.
>
> ```
> ERRORS: 
> : (admin.E039) An admin for model 
> "PartVariant" has to be registered to be referenced by 
> PartCodeInline.autocomplete_fields. 
> : (admin.E040) PartCodeTypeAdmin 
> must define "search_fields", because it's referenced by 
> PartCodeInline.autocomplete_fields. 
> : (admin.E039) An admin for model 
> "Size" has to be registered to be referenced by 
> PartSizeInline.autocomplete_fields. 
> : (admin.E039) An admin for 
> model "Size" has to be registered to be referenced by 
> PartSubGroupInline.autocomplete_fields.
> ```
>

-- 
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/98a443b2-15f7-4172-bd8e-1635dc98f30an%40googlegroups.com.


Re: Bind device with login id and password

2021-03-05 Thread Kasper Laudrup

On 05/03/2021 10.07, Sachin Kumar wrote:

HI Mike,

Thanks a lot for the reply I can capture the hostname of the localhost i 
also want to capture mac address of the local host. is there any way we 
can capture the Mac Address of the client?




In general no. If the client is on the same network you might be able to 
find its MAC address with ARP, but it's definitely not something you can 
rely on.


It is not really possible to uniquely identify a client without 
something like setting a cookie or similar. Even then, don't rely on 
that as it is trivial for the client the spoof anything it sends (in the 
case of HTTP that includes the client IP). Don't trust the client.


Kind regards,

Kasper Laudrup

--
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/bcb336ad-0c95-6c0a-367b-d7480afd3196%40stacktrace.dk.


Re: Bind device with login id and password

2021-03-05 Thread Sachin Kumar
HI Mike,

Thanks a lot for the reply I can capture the hostname of the localhost i 
also want to capture mac address of the local host. is there any way we can 
capture the Mac Address of the client?

On Friday, 5 March 2021 at 12:21:31 UTC+5:30 Mike Dewhirst wrote:

> On 5/03/2021 4:52 pm, Sachin Kumar wrote:
> > Hi Experts,
> >
> > Is there any way or logic in Django where we can bind user login id 
> > and password with first device login id.
> > for example:-
> > If a user first time login into a PC A, he can't login into PC B using 
> > same login id. He can only login into PC A with his login id. if he 
> > changes the PC then from backend we can remove his old registration
>
> Removing an old registration ... ie., a login, is likely to be 
> problematic with cascading deletion needing careful attention. It feels 
> like a sledghammer to crack a nut.
>
> Without knowing why it is difficult to suggest a reasonable approach.
>
> In any case, if you need a device ID you might look at ...
>
> from socket import gethostname
> device_id = gethostname()
>
>
> > and he can login into New PC.
> >
> > Please help me with the logic or any tutorial on this.
> >
> >
> > Regards
> > Sachin
> > -- 
> > 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...@googlegroups.com 
> > .
> > To view this discussion on the web visit 
> > 
> https://groups.google.com/d/msgid/django-users/85c94977-67b8-4e4f-8b50-c12a5a992aecn%40googlegroups.com
>  
> > <
> https://groups.google.com/d/msgid/django-users/85c94977-67b8-4e4f-8b50-c12a5a992aecn%40googlegroups.com?utm_medium=email&utm_source=footer
> >.
>
>
> -- 
> Signed email is an absolute defence against phishing. This email has
> been signed with my private key. If you import my public key you can
> automatically decrypt my signature and be sure it came from me. Just
> ask and I'll send it to you. Your email software can handle signing.
>
>
>

-- 
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/ff10cdb3-b68b-41f7-88f6-922498ebb6b4n%40googlegroups.com.