a Python web framework

learn more… | top users | synonyms

0
votes
1answer
25 views

Is there a way to control a looping Python script with Heroku?

I have a Python script that continuously makes GET and POST requests to a third-party API at about 1 request per second. It uses a while loop, so the requests all come from the same process. Currently,...
0
votes
2answers
299 views

How to approach hours forecasting

I need to forecast budgeted hours for 2 departments to help them schedule staff as currently the best they can do is just wing it. When we receive a job proposal I'll have the person submitting the ...
-2
votes
0answers
16 views

django module not found error while running manage.py [closed]

I'm using Ubuntu 16.04LTS dual-booted with Windows 10. I just started getting familiar with Django framework and setup a virtual environment for the tutorial project. I followed djangogirls tutorial ...
3
votes
1answer
647 views

Merge two different API calls into One

I have two different apps in my django project. One is "comment" and an other one is "files". A comment might save some file attached to it. The current way of creating a comment with attachments is ...
0
votes
0answers
21 views

Finding the nearest location to a user-specified location

For my application, I need to find a point in my database that is the nearest to the point specified by user. And I am trying this code to find all points within a small radius (in this case o.oo5 ...
0
votes
1answer
49 views

Is it a bad idea to use Facebook friendships as sole source of filtering content?

I'm writing a social app in Django where all users sign up through Facebook using Python Social Auth. All content that a user sees will be content created by her Facebook friends. Initially, I planned ...
1
vote
0answers
46 views

Facebook Login vs Python Social Auth (or django-allauth, etc.)

Background: I'm creating a mobile app using an API built with Django using Django REST Framework and hosted on Heroku. In the past, I've used Python Social Auth with this setup to authenticate users ...
-2
votes
0answers
43 views

What are Python .pyc files and how can one use them in django project and is there any way to open them? [closed]

.pyc contain Python bytecode for .py file(Please make a correction if i am wrong here). I have gone through this link.. < http://www.network-theory.co.uk/docs/pytut/CompiledPythonfiles.html>
0
votes
0answers
11 views

How to segregate data between user groups in Django?

django.contrib.auth has User and Group models. I'm using the User model for my users, and the Group model to manage their broad permissions (access to admin site, access logs, etc). I also have my ...
13
votes
4answers
38k views

How to develop front end (UI) for my Django website

I am learning Django and new to web development. Please excuse me if you find this question too dumb. So, I am creating a Facebook application using Django which I would like to host in Google App ...
0
votes
0answers
20 views

Difference between RAISE and RETURN HTTPResponse in bottle framwork

I am using Bottle framework to implement API's. There is code return before I started, and they use from bottle import HTTPResponse @api.get('/some/api/url') def some_method(...): ... ... ...
1
vote
0answers
38 views

Building back end for iOS/Android app using Django and Heroku

Background: I'm currently building a music streaming app (many requests per second) for a friend and am second-guessing my approach to it. The plan is to have an iOS app and an Android app, though I ...
0
votes
0answers
43 views

Modeling a cookbook recipe with django

I'm trying to model recipes in a cookbook. Here's what I have so far: class Recipe(models.Model): title = models.CharField(max_length=255) class Ingredient(models.Model): class Meta: ...
0
votes
0answers
46 views

How and where should I put a version number in my Django project?

I'm making a Django project consisting of several apps and I want to use a version number for the whole project, which would be useful for tracking the status of the project between each time it comes ...
3
votes
1answer
102 views

Django Migrations: Binds data to code?

If you have custom code for models (custom validators and custom fields are examples), Django Migrations will import them directly into the migration files. An example: file web/models.py def ...
-2
votes
1answer
135 views

Is this unprofessional when “Wappalyzer” sees all my technology? [closed]

After I installed "Wappalyzer", extension wich display technology, wich site using. I checked many sites and in most of cool projects, like "Youtube", "Github","stackoverflow" etc, wappalyzer display ...
2
votes
1answer
94 views

Roadmap to create a scientific computing website [closed]

I am a theoretical physicist starting my Ph.D. shortly. As a side project, I would like to create a scientific computing website in the field of General Relativity. It should be an interactive ...
10
votes
2answers
5k views

Django application strategy

I have been working a while on a Django project which has been growing a bit lately. I have been think a bit about what strategy to use to make it easier to handle. One thing I would like to get some ...
2
votes
2answers
178 views

Does RESTful response always return a 404 and empty content when an array is expected but the result is empty?

I worked with Ruby on Rails and RESTful api before and now with Django Rest framework. For this question let's say we only consider the case of JSON but not XML. It seems that when we expect an ...
-1
votes
1answer
109 views

Developing an app using Django. Do I design front-end after app? Or develop Django to fit UI? [duplicate]

Edit: this differs from a similar question because I'm interested specifically in how Django works with the front-end. I.e. what is considered best practice when developing using the Django framework. ...
1
vote
0answers
34 views

How do I minimize the number of database queries in a GeoJson API (of countries, and smaller areas) with custom data?

The general version of the question is above - a a little more detail, I am using Django Rest Framework, but am happy for answers to be dealing with the problem in abstract. So, I have data with ~200 ...
8
votes
6answers
8k views

Execute code every hour [closed]

I need to create a web service that executes every hour. It will be used to review data in a database and add alerts to a table in the same database if certain conditions are met/not met. What we ...
-4
votes
2answers
152 views

Am i looking at HTML / Django the wrong way? [closed]

So I'm comfortable programming in Python, I love the minimalist nature of the language. However, I haven't been exposed to any Django yet. I do know html, css etc for web design but when making ...
0
votes
1answer
68 views

Turning an HTML template into a Django template

When you purchase an HTML template, usually everything is mixed in together... html, css, images and js. An example template may look like this: account.html category.html contact.html /fonts /img ...
0
votes
0answers
24 views

What is preferred in an MVC framework, having each string defined as a variable in the Controller or generating them in the Template?

In a clear separation of the MVC layers, having each variable in the view seems to be the right way, but in practice in can be more "natural" (at least for me) to put them in the template. for example,...
0
votes
0answers
256 views

Django and the new Postgresql Array field

I recently got a chance to create a new Django app with the current stable version which exposes some Postgresql specific data types for models (docs) and got excited to have an Array. According the ...
6
votes
4answers
2k views

Front-end structure of large scale Django project

Few days ago, I started to work in new company. Before me, all front-end and backend code was written by one man. As you know, Django app contains two main directories for front-end: /static - for ...
2
votes
1answer
160 views

Multiple different versions of similar apps in one project

I need some help to improve the architecture of a site I've built. What I want to achieve within a single Django project is the following: I want a site that comes in several versions (one per year),...
19
votes
5answers
14k views

How difficult is Python and Django to pick up for a Java/.NET web developer? [closed]

I just started a new job a couple months ago at a small company where I am currently leading all development efforts present and future. I personally have years of experience in software design and ...
1
vote
1answer
206 views

Add arguments to mysql in Django's “dbshell”

I'd like to add a couple of command-line arguments to my Django's ./manage.py dbshell command, and I can't figure out how. In specific I'd like to add -A to prevent MySQL from scanning every table ...
1
vote
2answers
298 views

How do I prevent people from abusing my endpoint that accepts files? [duplicate]

So I have a Django app hosted on Heroku that has an endpoint which accepts image uploads. The images are saved to my AWS bucket, which is charged to me. Right now, I am able to upload images by making ...
1
vote
0answers
245 views

the right way to generate my Django model/db_table

I went through the Django tutorial with in mind to go through it again using it to set up my small app. So now I am making a simple app where users can search a large set of strings and get a subset ...
2
votes
1answer
145 views

what the best practice in REST to append or delete to a list

Suppose GET /users/<id> { user_id : "asdasdas-da-sd-asd-as-d", firs_name : "asdasd", .... department : [{ id : "asdas-da-sdasd-asd", name : "asdasdasdasd", ... }...
0
votes
0answers
122 views

Server-Side MVCs vs Client Side MVCs

Recently I was asked to do a project as a technical assessment. The assignment is to create a website using Twitters API. The assessment recommended using Django. When I quickly looked up Django I ...
1
vote
0answers
62 views

Django API design

I recently followed the Django API tutorial. http://www.django-rest-framework.org/tutorial/6-viewsets-and-routers/ When I initiate a POST request my intent is that after inserting the record into ...
0
votes
1answer
314 views

Django urls.py runs only once. Why? How does it call views on next request?

While testing django cashing on our development server, one of our senior asked if is it possible to change the value of caching timeout on urls.py without restarting the http service. On first note, ...
3
votes
1answer
106 views

How to handle Django get-single-instance-in-view pattern?

A lot of my Django views start a little bit like this: try: # here request.POST could also be request.GET or a captured URL parameter MyModel.objects.get(user = request.user, some_attr = int(...
5
votes
1answer
3k views

What are your techniques for storing numpy structures in django database fields and how do you serialize them for http? [closed]

I want to publish a small web project that is supposed to contain some of my research results to present it to the scientific community. All my analysis I ran so far have been written in python ...
4
votes
4answers
727 views

Multiple sites with the same codebase in Python

I am trying to run a large amount of sites which share about 90% of their code. They are simply designed to query an API and return the results. They will have a common userbase / database but will be ...
2
votes
1answer
90 views

Using Django to Create Child Sites

I am creating a series of small sites, I'm using the django framework. The theory goes a user comes to a master site, signs up, then he gets his own child site. Example: navigate to example.com ...
2
votes
1answer
199 views

Is it good practise to have the class name as a prefix in Django model?

I wrote a model in this format in Django: class Block(models.Model): block_id = models.AutoField(primary_key=True) block_name = models.CharField(max_length=200) block_code = models....
0
votes
1answer
66 views

How Do I Securely Edit a Database Entry Based On ID in an Admin System?

This is more of a conceptual question because the way that I am doing it would be secure enough for my purposes (educational). I created a simple admin panel that displays a stock picks database as ...
0
votes
1answer
96 views

How to API design architecture for long delay process

Im trying to start an API design using Django Rest Framework, and the problem Im trying to solve is the following: Request endpoint is like this: POST http://server:8080/api/v1/device attribute: ...
3
votes
1answer
361 views

Separating Django models for SOA

First of all, the goal of this exercise is to create a SOA with Django. I am trying to understand what the implications would be if I decided to separate and insulate models into apps, provide a REST ...
2
votes
0answers
297 views

Separating AngularJs and Django into individual Apps?

I am building a web application using AngularJs and our web server is built in Python Django Rest Framework. I would like to have the two projects separated and not coupled. In my current setup the ...
0
votes
1answer
59 views

Should I have all models done before I syncdb?

I'm not sure if I want to add more attributes to my models or create another model. I've coded up to the point where I need to syncdb to start using some data in the site, but I'm hesitant to do it. ...
1
vote
1answer
289 views

How would a modern website like Reddit divide up its website into Django apps? [closed]

Django uses apps to divide projects into manageable and reusable chunks. All examples in tutorials use polls or articles in unrelatable circumstances. In a modern example like Reddit (or even Amazon ...
1
vote
0answers
278 views

How can I use protected Tastypie resources within Angular?

I have a working Django 1.7 project with an API (Tastypie) made available for mobile clients (ApiKeyAuthentication). I am using Angular with Chart.js, and so I need to GET some queryset using $http....
3
votes
2answers
1k views

Django CBVs vs FBVs

For creating a large Django project with many apps, my first initial thought was to used Class Based Views (as the Django tutorials seem to emphasize). However, I noticed that due to a lot of the ...
2
votes
0answers
123 views

Scoring algorithm implementation with Django and Redis

I use DjangoREST & MySQL as a backend for a mobiel app. I have two models, User and Feed and for any call to api/feeds/ returns all feeds for authenticated user ordered by created_at parameter of ...