Re: HOW TO PROTECT SOURCE CODE DEPLOYED TO A REMOTE SERVER

2020-05-20 Thread Mike Dewhirst

On 20/05/2020 4:17 pm, Derek wrote:
Yes - short answer is you cannot really "protect" Python code directly 
(see: https://python-compiler.com/post/how-to-distribute-python-program )


Long answer - don't sell your code to anyone that you do not trust 
with it.  Obviously, there is a legal route, but there is also the 
"name and shame" option.  Sometimes open source is better; you get 
paid for your time to work on the code rather than trying to sell it 
as a product - which then you have to try and protect.  The open 
source option prevents the company from "selling" the code (well, they 
would look very silly if they tried to do that) and establishes you as 
the "go to" person for creating and maintaining that type of system. 
If they do make changes to the open source code, you'd get the benefit 
as well.


In general, try and create partnerships with your clients so they want 
to include you in the development process, rather than treating each 
as other as competitors.



On Tuesday, 19 May 2020 15:22:13 UTC+2, Andréas Kühne wrote:

You can't really do that with Python - however - IF you want to go
down that route, you can just use the pyc files - you can
theoretically backwards compile them, but I think this is the most
you can do

Regards,

Andréas


Den tis 19 maj 2020 kl 03:36 skrev Sunday Iyanu Ajayi
>:

I get your point but my solution is kind of a  SaaS
Application. the client wants to host it on his controlled
server  and if they get the source code, they can replicate,
modify and maybe sell it.  Is there a way to host the compiled
file or lock the directory to the project.



Maybe you need to discuss the client's requirements and license them to 
do what you agree is OK and you retain whatever control over the source 
you want.


I'm guessing that might be expensive getting a lawyer to do it.

Otherwise, as Andréas said, just deploy the pyc files.

Mike


*AJAYI Sunday *
(+234) 806 771 5394
/sunne...@gmail.com /



On Mon, May 18, 2020 at 9:28 PM Jim Armstrong
> wrote:

When I work on client projects, I deploy to a test server
that is under my control. Once the project is complete and
they have paid the invoice, I deploy to the production
server under their control. At that point, I don't care if
they have access to the code - my contracts give the
clients all rights to the project code upon completion of
the project.


On Friday, May 15, 2020 at 9:22:33 AM UTC-4, Sunday Iyanu
Ajayi wrote:

I am working for a client that wants to deploy a
project I am working on in a remote server and I will
like to project my source code when deployed so that
they will not be able to mess with it.

How can  I  go about it please?

*AJAYI Sunday *
(+234) 806 771 5394
/sunne...@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...@googlegroups.com
.
To view this discussion on the web visit

https://groups.google.com/d/msgid/django-users/636f0636-30df-4ce2-8629-2be8b208ec37%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...@googlegroups.com .
To view this discussion on the web visit

https://groups.google.com/d/msgid/django-users/CAKYSAw3Hqjuz5rD_AsZ5Wa%2B3WBzQ9LN0GzZKHx3D-irztJ1G0A%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/021a40fa-a755-4d77-addf-dfd112597dbc%40googlegroups.com 
.


--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To unsubscribe from this group and stop

Getting the except django.core.exceptions.ImproperlyConfigured while querying DB

2020-05-20 Thread ratnadeep ray
I am trying to fetch a few rows from the DB using the following code in my 
views.py:

from django.http import HttpResponsefrom django.shortcuts import renderfrom 
fusioncharts.models import QRC_DB
def display_data(request,component):
query_results = QRC_DB.objects.get(component_name__contains=component)
return HttpResponse("You're looking at the component %s." % component)

For the above, I am getting the following exception:

django.core.exceptions.ImproperlyConfigured: The included URLconf 
'Piechart_Excel.urls' does not appear to have any patterns in it. If you see 
valid patterns in the file then the issue is probably caused by a circular 
import.

However whenever I am *removing/commenting out* the below line, the above 
exception disappears:

query_results = QRC_DB.objects.get(component_name__contains=component)


Can anyone say what can be going wrong here? 

urls.py file under app is as follows: 

from django.urls import path from fusioncharts import views urlpatterns 
urlpatterns 
> = [
> path('push-data/', views.push_data, name='push-data'),
> path('home/', views.home, name='home'),
> path('display_data/', views.display_data, name=
> 'display_data'),
> ]

The url under the main project is as follows: 

from django.contrib import adminfrom django.urls import path,include
>
> urlpatterns urlpatterns = [
> path('admin/', admin.site.urls),
> path('', include('fusioncharts.urls'))
> ]

So please advise what's going wrong. 

-- 
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/0acc7888-9e25-43fd-8a50-64fe43086190%40googlegroups.com.


Re: HOW TO PROTECT SOURCE CODE DEPLOYED TO A REMOTE SERVER

2020-05-20 Thread John McClain
Hello Sunday,

I wonder if you could deploy to git and use one of the licenses there to
protect the code. I think they would be bound by the use the license
permits. Have you looked at this as a possibility?

John

On Tue, 19 May 2020 at 02:35, Sunday Iyanu Ajayi 
wrote:

> I get your point but my solution is kind of a  SaaS Application. the
> client wants to host it on his controlled server  and if they get the
> source code, they can replicate, modify and maybe sell it.  Is there a way
> to host the compiled file or lock the directory to the project.
> *AJAYI Sunday *
> (+234) 806 771 5394
> *sunnexaj...@gmail.com *
>
>
>
> On Mon, May 18, 2020 at 9:28 PM Jim Armstrong 
> wrote:
>
>> When I work on client projects, I deploy to a test server that is under
>> my control. Once the project is complete and they have paid the invoice, I
>> deploy to the production server under their control. At that point, I don't
>> care if they have access to the code - my contracts give the clients all
>> rights to the project code upon completion of the project.
>>
>>
>> On Friday, May 15, 2020 at 9:22:33 AM UTC-4, Sunday Iyanu Ajayi wrote:
>>>
>>> I am working for a client that wants to deploy a project I am working on
>>> in a remote server and I will like to project my source code when deployed
>>> so that they will not be able to mess with it.
>>>
>>> How can  I  go about it please?
>>>
>>> *AJAYI Sunday *
>>> (+234) 806 771 5394
>>> *sunne...@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/636f0636-30df-4ce2-8629-2be8b208ec37%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/CAKYSAw3Hqjuz5rD_AsZ5Wa%2B3WBzQ9LN0GzZKHx3D-irztJ1G0A%40mail.gmail.com
> 
> .
>


-- 
John McClain

Cell: 085-1977-823
Skype: jmcclain0129
Email: jmcclain0...@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/CAN-hv_pbGUu7Qjm%2BZO7fOmT2H1W2C8Xy%2BhTk_6_BQcUcwc-XbA%40mail.gmail.com.


Re: how to use youtube links in my website

2020-05-20 Thread Christian Ledermann
I would retrieve the RSS from YouTube, and process it server side with
feedparser and render it in django

https://pypi.org/project/feedparser/
https://feeder.co/knowledge-base/rss-feed-creation/youtube-rss/


On Sat, 16 May 2020 at 01:35, John McClain  wrote:

> Can't you just use the script in the body section for this on the html
> page you want the video in view on.
>
> On Fri, 15 May 2020 at 20:17, Bunti  wrote:
>
>> I want to make website to show the all the videos of my Youtube channel
>>  PLAYLISTS. I mean to say that all of my Youtube videos should be linked to
>> my website.
>>
>>
>> Can I get any  video tutorial of such type of project with Django?
>>
>> (I have learned Django upto some level. I can do CURD by function and
>> Generic Views, user registration, password update by email etc.)
>>
>>
>> --
>> 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/96d8272e-7b5e-4e04-94ad-7b80f9a0ed87%40googlegroups.com
>> 
>> .
>>
>
>
> --
> John McClain
>
> Cell: 085-1977-823
> Skype: jmcclain0129
> Email: jmcclain0...@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/CAN-hv_qsELgRoZDTwS0HU2i9AWFSgBQLE0XcVRuY7GAADHo25w%40mail.gmail.com
> 
> .
>


-- 
Best Regards,

Christian Ledermann

Newark-on-Trent - UK
Mobile : +44 7474997517

https://uk.linkedin.com/in/christianledermann
https://github.com/cleder/


<*)))>{

If you save the living environment, the biodiversity that we have left,
you will also automatically save the physical environment, too. But If
you only save the physical environment, you will ultimately lose both.

1) Don’t drive species to extinction

2) Don’t destroy a habitat that species rely on.

3) Don’t change the climate in ways that will result in the above.

}<(((*>

-- 
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/CABCjzWpFDyDY%2BJoESkV_ND8QGFWE8T1mU%2BX9KEnBuAhC7SBSqQ%40mail.gmail.com.


RE: Re: how to use youtube links in my website

2020-05-20 Thread Vishesh Mangla
 Why just you not use the html5 video tag?Sent from Mail for Windows 10 From: Christian LedermannSent: 20 May 2020 15:16To: django-users@googlegroups.comSubject: Re: how to use youtube links in my website I would retrieve the RSS from YouTube, and process it server side with feedparser and render it in django https://pypi.org/project/feedparser/https://feeder.co/knowledge-base/rss-feed-creation/youtube-rss/  On Sat, 16 May 2020 at 01:35, John McClain  wrote:Can't you just use the script in the body section for this on the html page you want the video in view on. On Fri, 15 May 2020 at 20:17, Bunti  wrote:I want to make website to show the all the videos of my Youtube channel  PLAYLISTS. I mean to say that all of my Youtube videos should be linked to my website.  Can I get any  video tutorial of such type of project with Django?(I have learned Django upto some level. I can do CURD by function and Generic Views, user registration, password update by email etc.)  -- 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/96d8272e-7b5e-4e04-94ad-7b80f9a0ed87%40googlegroups.com. -- John McClainCell: 085-1977-823Skype: jmcclain0129Email: jmcclain0...@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/CAN-hv_qsELgRoZDTwS0HU2i9AWFSgBQLE0XcVRuY7GAADHo25w%40mail.gmail.com. -- Best Regards,Christian LedermannNewark-on-Trent - UKMobile : +44 7474997517https://uk.linkedin.com/in/christianledermannhttps://github.com/cleder/<*)))>{If you save the living environment, the biodiversity that we have left,you will also automatically save the physical environment, too. But Ifyou only save the physical environment, you will ultimately lose both.1) Don’t drive species to extinction2) Don’t destroy a habitat that species rely on.3) Don’t change the climate in ways that will result in the above.}<(((*>-- 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/CABCjzWpFDyDY%2BJoESkV_ND8QGFWE8T1mU%2BX9KEnBuAhC7SBSqQ%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/5ec51059.1c69fb81.24e0b.69ae%40mx.google.com.


Re: Can't Fix the No Reverse Error in Ajax

2020-05-20 Thread Hella Nick
是的,正确的写法为
  Like 

Motaz Hejaze  于2020年5月20日周三 下午2:06写道:

> Change your ajax method from "post" to "get" , you are not submitting any
> data to use post .
>
> Also change the method in your form too , and share the error message
> please.
>
> On Wed, 20 May 2020, 6:18 am Ahmed Khairy, 
> wrote:
>
>> Do you mean that this line should be changed?
>>
>> > 'post_id' class= "btn btn-danger btn-sm" value="{{post.id}}"
>> > No ! Don't Print it 
>>
>> On Tuesday, May 19, 2020 at 11:11:12 PM UTC-4, Hella Nick wrote:
>>>
>>> button标签中的type属性设置为button,
>>>
>>> Ahmed Khairy  于2020年5月20日周三 上午1:54写道:
>>>
 I am trying to use Ajax to submit a like button, I believe everything
 is in order but I keep getting django.urls.exceptions.NoReverseMatch:
 Reverse for 'like_post' with arguments '('',)' not found. 1 pattern(s)
 tried: ['score/like/(?P[0-9]+)$']


 I am not sure what is the reason. Need help to identify the error.


 Here is the view


 class PostDetailView(DetailView):
 model = Post
 template_name = "post_detail.html"

 def get_context_data(self, *args, **kwargs):
 context = super(PostDetailView, self).get_context_data()
 stuff = get_object_or_404(Post, id=self.kwargs['pk'])
 total_likes = stuff.total_likes()
 liked = False
 if stuff.likes.filter(id=self.request.user.id).exists():
 liked = True
 context["total_likes"] = total_likes
 context["liked"] = liked
 return context


 def LikeView(request, pk):
 # post = get_object_or_404(Post, id=request.POST.get('post_id'))
 post = get_object_or_404(Post, id=request.POST.get('id'))
 like = False
 if post.likes.filter(id=request.user.id).exists():
 post.likes.remove(request.user)
 like = False
 else:
 post.likes.add(request.user)
 like = True
 context["total_likes"] = total_likes
 context["liked"] = liked

 if request.is_ajax:
 html = render_to_string('like_section.html', context, request=
 request)
 return JsonResponse({'form': html})

 Here is the url.py updated

 urlpatterns = [
 path('user/', UserPostListView.as_view(), name=
 'user-posts'),
 path('', PostListView.as_view(), name='score'),
 path('who_we_Are/', who_we_are, name='who_we_are'),
 path('/', PostDetailView.as_view(), name='post-detail'),
 path('like/', LikeView, name='like_post'),
 path('new/', PostCreateView.as_view(), name='post-create'),
 path('/update/', PostUpdateView.as_view(), name=
 'post-update'),
 path('/delete/', PostDeleteView.as_view(), name=
 'post-delete')
 ]

 here is the template

 
 {% csrf_token %}
  Likes: {{total_likes}} 
 {% if user.is_authenticated %}
 {% if liked %}
 >>> 'post_id' class= "btn btn-danger btn-sm"
 value="{{post.id}}"> Unlike 
 {% else %}
 >>> 'post_id' class= "btn btn-primary btn-sm"
 value="{{post.id}}"> Like 
 {% endif  %}
 {% else %}
 >>> > Login to Like 
 {% endif %}
 

 here is the ajax

 https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js";>