Can I use the Node.js packages along with Django?

I think I haven't understood this concept right . If I am using Django as a backend to run server side code , is there a way to include the packages of Node.js also . Isn't Node.js kind of another environment or language for server side code ? If...
more »

2017-12-03 20:12 (2) Answers

Address sanitizing Boost.Python modules

My project includes a large C++ library and Python bindings (via Boost.Python). The test suite is mostly written on top of the Python bindings, and I would like to run it with sanitizers, starting with ASAN. I'm running macOS (10.13.1 FWIW, but I h...
more »

2017-12-03 14:12 (1) Answers

Creating a .gitignore file for a Django website

I'm ready to push my existing Django project (which i've been running in a local environment) to a Bitbucket repository so I can run it on a public server. At the moment I feel like there's a lot of files created in local development that needs to be...
more »

2017-12-03 09:12 (2) Answers

Python - Confused about inheritance

I write the test code with 3 classes , and using Chain of Responsibility design pattern , the code below and I print print(c._abc is b._abc), the answer is True , but my original think is that the two are different. Then , Round 2 , I uncomment sel...
more »

2017-12-03 06:12 (1) Answers

Is the search package in python outdated

I'm trying to figure out the exact utility of the Search package in python There is hardly any documentation and I can't find anything online or on youtube that describes what this package does. On top of th...
more »

2017-12-03 02:12 (0) Answers

python django: login with office 365

I am trying to implement a office365/azureAD/MS graph authentication system for a Django website. My University has a office365 account system for all students. If you log in using your ID for that you get access to all MS Office software and other ...
more »

2017-12-03 01:12 (1) Answers

Python list to tuple

I have this : (([75, 0], [100, 0], [100, 370]), ([75, 0], [100, 370], [75, 370])) that come from this : [(array([75, 0]), array([100, 0]), array([100, 370])), (array([75, 0]), array([100, 370]), array([ 75, 370]))] and I want to have : ...
more »

2017-12-02 23:12 (4) Answers

Counting instructors in a database

I think I have the right idea to solve this function, but I'm not sure why I get this error when I try to test it. Can anyone please help me fix this? cur.execute(q) sqlite3.OperationalError: near "HAVING": syntax error Courses Table: ID, Course, S...
more »

2017-12-02 21:12 (1) Answers

Sorting integers into 3 equal (almost) groups

So I have this problem which I need to solve, I have a group of integers which I want to sort into 3 equal groups. The data which I need to sort is: 3169, 3063, 3061, 3054, 3018, 3013, 2979, 2943, 2833, 2824, 2794, 2759, 2722, 2701, 2602, 2594, 2...
more »

2017-12-02 20:12 (2) Answers

django too many values to unpack error

i have stored a list in django and now i want to convert that list to query set . ques=list(sorted(Upload.objects.filter(unique_id=tdetail), key=lambda x: random.random())) platform=Platform() platform.user=request.user platform.test_...
more »

2017-12-02 15:12 (0) Answers

Sphinx and inherited functions

I'm trying to use Sphinx to document my Python code and I'm new to Sphinx. I'm in the following situation: from abc import ABCMeta from abc import abstractmethod class AbstractClass1(): __metaclass__ = ABCMeta def __init__(self): ...
more »

2017-12-02 14:12 (0) Answers

Django image form isn't saving the image

I have a form that involves uploading a profile picture. I have it working so that I can upload images in the /admin/ interface and display them correctly, but I cannot get my Modelform to save the image. Here is what I have: class Cand...
more »

2017-12-02 10:12 (1) Answers

Searching and appending rows to a new dataframe

I'm trying to search for a particular string in Dataframe - 'df' and choose that corresponding row and append it to a new data frame - 'X'. Below is my code for one search instance. I need to perform different search instanced as I go through 'df' Da...
more »

2017-12-02 06:12 (0) Answers