Re: Location identification with login

2022-12-27 Thread tristant
Appreciate everyone's pointers!

Cheers,

On Sunday, December 25, 2022 at 9:26:50 PM UTC-7 yebo...@gmail.com wrote:

> This can be done GeoIP but it can be done in a different way I have done 
> one before that was with REST API, all you have to do if you don't want to 
> depend on any third library is to have a device model which stores the user 
> and IP then whenever the user login saves it.
> So with this, you have all the user's IPs so when they log in again then 
> you compare their previous IPs with the current if different you can send a 
> warning mail or you just send an OTP to verify before logging in.
> What I did was for one company I worked with so I can share the code I am 
> sorry for that.
>
> On Sun, 25 Dec 2022 at 20:58, 'Kasper Laudrup' via Django users <
> django...@googlegroups.com> wrote:
>
>> On 25/12/2022 20.52, tristant wrote:
>> > Is there a mechanism in Django where we can identify the location of 
>> > login? Any reading sources regarding this functionality would be much 
>> > appreciated.
>> >
>>
>> What you're looking for is something called geoip. To the best of my 
>> knowledge there's no such thing build into Django (wouldn't really make 
>> much sense anyway) but it should be trivial to query some geoip database 
>> from your code and get a somewhat reliable idea on where that IP is 
>> coming from.
>>
>> There's no way that can be accurate but it might be useful for something 
>> like detecting a locale (that the user can then change) or similar.
>>
>>
>> > Along the same line, is there a way to prevent a login attempt if the 
>> > location is within certain blacklisted IP subnets?
>> > 
>>
>> It is trivial to spoof a source IP address once you reach the Django 
>> application part of the communication. That's more of a feature than a 
>> bug actually because of things like proxies etc.
>>
>> If you want to blacklist IPs you have to do that on a lower level. For a 
>> single server running Linux something like netfilter/iptables might be 
>> used but I'm sure there are some more convenient scripts/services etc. 
>> that might be used. The main point is that you cannot do this from your 
>> Django code.
>>
>> Hope that helps you in the right direction.
>>
>> 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...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/e83a7b85-6fd3-ced8-b4bf-fdf77650cfe8%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/5f7cf341-d2fb-448e-86e9-5b828f67afa7n%40googlegroups.com.


Location identification with login

2022-12-25 Thread tristant
Is there a mechanism in Django where we can identify the location of login? 
Any reading sources regarding this functionality would be much appreciated.

Along the same line, is there a way to prevent a login attempt if the 
location is within certain blacklisted IP subnets?

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/76a1fcf2-99cc-4b6a-a55e-c5e4776dad05n%40googlegroups.com.


Deploy Django app with Apache2

2021-06-24 Thread tristant
I was looking to turn a a laptop into a standing webserver to deploy a 
Django app within an intranet. This tutorial here shows how to doing with 
Apache2:  Hands-On How to Host Django with Apache2 | by Muhammad Ryan | 
Level Up Coding (gitconnected.com) 
.
 
But it only shows how to deploy locally without using a real DNS (i.e 
instead of using "localhost:8000", it uses "localhost/project_name" as the 
address).

Suppose I have secured a DNS, how should I proceed or what steps need to 
deviate from this tutorial? Or if anyone has better educating sources for 
this purpose, that would be much appreciated. I work with Ubutu. 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/0925c4ae-1d27-4221-a2d6-c2188b66d096n%40googlegroups.com.


Creating dynamic chart / graphs with Django

2021-04-12 Thread tristant
I am looking to build site with a variety of charts and graphs. A quick 
search shows quite a lot of packages out there, as listed here Django 
Packages : Charts 

Has anyone used any of these packages and could provide some advice on 
which is better? For my task, I am looking to create both typical 2D charts 
as well as possible 3D plots. The charts need to be interactive ( as in 
user can tweak inputs and expect the charts to respond).

I have done similar charts with R Shiny. I am wondering which of these 
packages can do similar things?

I notice in the link, some packages mention "offline". Does this mean they 
cannot create interactive charts?

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/efe61d41-1e8c-4c56-899f-8164c0384bf3n%40googlegroups.com.


Deploy Django website internally within company network

2021-03-31 Thread tristant
So I am trying to propose building an internal website site at work with 
Django. But I have no idea what is needed from an IT perspective. I know 
how to deploy one on the internet through Heroku or such. But what are the 
steps/resource requirements if I was to deploy within an intranet? The IT 
department has not done this with Django before ( although they have done 
so with other framework such as Angular, etc).

If someone could give me some pointers on this process.

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/36ef7600-4f4c-47f2-9bce-66425716a232n%40googlegroups.com.


Re: Can Django template extend dynamic content in child or grandchild template?

2020-10-14 Thread tristant
Sorry for the badly formatted html code. My question on Stackoverflow here: 
https://stackoverflow.com/questions/64359521/djang-multiple-levels-of-template-extension-while-keeping-the-elements-of-the-up

Thanks,

On Wednesday, October 14, 2020 at 1:03:43 PM UTC-6 tristant wrote:

>
>   ...   {% block content 
> %} {% endblock %}   
>
> category.html :
> {% extends "base.html" %} {% block content %}  <
> div id="menu_category_display"> {% for category in menu_categories %} {% 
> with category_button="menu_"|add:category.name|lower %}  "showItem('{{category_button}}','category_buttons')"> {{category}}  button> {% endwith %} {% endfor %}
> {% block level_2_content %} {% endblock %}   {% endblock %} 
>
> and item.htlm
> {% extends "category/category.html" %} {% block level_2_content %}  id="test_div"> {% for item in menu_items %} {{item.name}} {% 
> endfor %}  {% endblock %} 
>
> When item.html is rendered, all the elements that were rendered by 
> category.html are gone. Only the elements of the base.html are retained. 
>
> In the code above, the entire category_row div does not appear in 
> item.html. How do I retain them?
>
> How do I retain all elements in all parent templates instead of just 
> base.html? A general method to do this for more than 3 levels of 
> extension like in my case?
>
>
>

-- 
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/8a63dea0-5d37-4cd7-bc7d-c035410c89b8n%40googlegroups.com.


Can Django template extend dynamic content in child or grandchild template?

2020-10-14 Thread tristant

  ...   {% block content %} 
{% endblock %}   

category.html :
{% extends "base.html" %} {% block content %}  <
div id="menu_category_display"> {% for category in menu_categories %} {% 
with category_button="menu_"|add:category.name|lower %}  {{category}}  
{% endwith %} {% endfor %}{% block 
level_2_content %} {% endblock %}   {% endblock %} 

and item.htlm
{% extends "category/category.html" %} {% block level_2_content %}  {% for item in menu_items %} {{item.name}} {% endfor %} 
 {% endblock %} 

When item.html is rendered, all the elements that were rendered by 
category.html are gone. Only the elements of the base.html are retained. 

In the code above, the entire category_row div does not appear in item.html. 
How do I retain them?

How do I retain all elements in all parent templates instead of just 
base.html? A general method to do this for more than 3 levels of extension 
like in my case?


-- 
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/5c52b701-9a60-4ac6-ae90-072a1d9ae2bbn%40googlegroups.com.


Virtual keyboard popup for running web app on touch-screen device

2020-09-28 Thread tristant
Hi,

What package available in Django that I can use to create a popup on-screen 
keyboard for the user to type on a touch-screen device? I know Tkinter has 
this GUI capability. But I would like to stick with a web-based app.

If you have built something like that and could share the end result, that 
would be great.

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/1135c1b8-db87-44ac-8528-f1aad5d32b99n%40googlegroups.com.


Re: Has anyone created eCommerce website with Django?

2020-08-05 Thread tristant
Thanks, guys.

I did some research on pricing for freelancing. I am about to commit to one 
freelance job, building a small ecommerce website. Features include: adding 
product, updating quantity, payment with cards or PayPal, full website has 
about 10 pages max.

What is a reasonable price here? I don't want to scare the client off with 
ridiculous numbers, given that this is my first project. But I also would 
like to have decent income. The internet suggests such a wide range. I am 
in the US.

On Wednesday, August 5, 2020 at 12:51:45 PM UTC-7 kovy@gmail.com wrote:

> I would recommend using shopify over wix, as it is meant for e-commerce, 
> but django will give you many advantages.
> - Highly customizable, you can add on anything you want, easily
> - WAY cheaper, you can host a django site for a few dollars a month
> - It gives you unlimited expansion, a day will hopefully come where you 
> want to expand your site, and you don't want to be restrained by the 
> limitations of a drag-and-drop-website, or have to make your website from 
> scratch on a different service/in django
> - You will learn django and a bit of python, which is very useful.
>
> On Wed, Aug 5, 2020 at 3:45 PM ola neat  wrote:
>
>> yes i have,
>> u charge base on the requirement and feature that is needed on the website
>>
>> On Wed, Aug 5, 2020 at 8:15 PM tristant  wrote:
>>
>>> Hi,
>>> I am wondering if anyone here has created one for real, maybe for a 
>>> small business. If so, how do you price your work, say, as compared to 
>>> other available web-building services such as Wix.com where small 
>>> businesses pay subscription fee and no need to do any coding?
>>>
>>>
>>> -- 
>>> 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/4abb0de1-685d-4124-887a-31c4b3a85f03n%40googlegroups.com
>>>  
>>> <https://groups.google.com/d/msgid/django-users/4abb0de1-685d-4124-887a-31c4b3a85f03n%40googlegroups.com?utm_medium=email_source=footer>
>>> .
>>>
>> -- 
>> 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/CAHLKn738oMsaK%2BOXGQWFmiZ75bjwtgtA243FHD58M1Cstvn8ig%40mail.gmail.com
>>  
>> <https://groups.google.com/d/msgid/django-users/CAHLKn738oMsaK%2BOXGQWFmiZ75bjwtgtA243FHD58M1Cstvn8ig%40mail.gmail.com?utm_medium=email_source=footer>
>> .
>>
>

-- 
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/f351b46d-04cf-4afe-95e3-d04d22808bfen%40googlegroups.com.


Has anyone created eCommerce website with Django?

2020-08-05 Thread tristant
Hi,
I am wondering if anyone here has created one for real, maybe for a small 
business. If so, how do you price your work, say, as compared to other 
available web-building services such as Wix.com where small businesses pay 
subscription fee and no need to do any coding?


-- 
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/4abb0de1-685d-4124-887a-31c4b3a85f03n%40googlegroups.com.


Intensive access and modification of database table

2020-07-19 Thread tristant
Hi,

I am wondering if anyone could point me to any documents or readings on how 
to big eCommerce sites such as Amazon or eBay implements the following 
situation:
- A seller posts a product with an initial quantity, 'init_qty'.
- An unknown number of clients access the product concurrently, add it to 
their shopping cart.
- The site needs to manage the contemporary available quantity, 
"avail_qty", and all times. And switch the product to "unavailable" if the 
quantity drop to zero.
- However, the effective "avail_qty" is only updated permanently in the 
database if and only if the client checks out and pays.

For small eCommerce sites, updating the database frequently is not a big 
deal. But if the product count and client count is large, what is the 
efficient way to implement this?

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/dd2b979b-6f63-465b-b6e7-8a831e53bf28n%40googlegroups.com.