a Python web framework

learn more… | top users | synonyms

-1
votes
0answers
21 views

What is Python Django and Flask? [on hold]

I understand the role of HTML, CSS and JavaScript in making Websites. One is for styling and the other makes it interactive... But what does Python Django and Flask do?
0
votes
0answers
16 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
23 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
39 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: ...
-3
votes
0answers
88 views

PyPy vs. Cython pure python mode vs. CPython for Django

Cython has a pure Python mode and PyPy is an implementation of Python with a JIT compiler. How do Cython, PyPy, or CPython compare for a Django application's speed if I use type annotations in 90% of ...
-2
votes
1answer
122 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 ...
0
votes
0answers
42 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 ...
2
votes
1answer
86 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 ...
2
votes
2answers
134 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 ...
0
votes
2answers
269 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 ...
-1
votes
1answer
98 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
32 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 ...
-4
votes
2answers
141 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 ...
3
votes
1answer
99 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 ...
0
votes
1answer
58 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 ...
0
votes
0answers
228 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 ...
1
vote
2answers
287 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
218 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
159 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 ...
0
votes
0answers
113 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
57 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 ...
2
votes
1answer
135 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
1answer
300 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, ...
2
votes
1answer
179 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 = ...
0
votes
1answer
65 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 ...
3
votes
1answer
99 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 = ...
0
votes
1answer
95 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
341 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 ...
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. ...
2
votes
0answers
292 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 ...
1
vote
1answer
282 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
273 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 ...
2
votes
0answers
114 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 ...
0
votes
1answer
54 views

Django Project Logic Solution

I'm starting to develop my first webapp, and I'm using django. Before anything I'm working on the software logic, how it should work, the links and objects it needs. The problem is: I need the app ...
1
vote
0answers
145 views

Django Project with Multiple Apps on Heroku

A newbie question: I've been able to deploy a few simple Django apps on Heroku very easily. However, now I am tackling a much larger project that consists of several apps (all Django and all with ...
1
vote
2answers
591 views

How to handle configuration of Python modules, especially when used standalone and in frameworks like Django

I am trying to package a Python module for pip, following the guide here. One area I would like feedback on is best practices or convention for making my module configurable. The module is a library ...
0
votes
1answer
189 views

How to implement a RESTful API that updates a list which might have exclusion and addition of related resources?

We have an application where there is an API to create a document with a POST and update it with a PUT. There is a separate API to share document with users. Now, How should we approach updating the ...
0
votes
1answer
73 views

Sessions in cloud applications dangerous?

We have a django app hosted on heroku. I had a situation: A user entered an email in a form on page1. If the email existed in the database he was redirected to Login page otherwise to register ...
0
votes
1answer
196 views

Repurpose MySQL as a mutex

My application needs to perform an operation once every 10 minutes, but that operation is triggered many times more frequently. Occasionally it is triggered three or four times a second in different ...
4
votes
2answers
390 views

How to layer if statements when order of logic is irrelevant?

Basically I have a series of logic in my website that can lead to 5 total outcomes. Basically two different if tests and then a catch all else statement. For example: if cond1: if mod1: ...
2
votes
1answer
853 views

What is the Controller in Django MVC?

Learning Django MVC and the way I thought of it is: Models are the database tables represented in Django as Python classes. Views are the HTML returned from function in views.py. Controllers are the ...
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 ...
0
votes
1answer
2k views

Javascript function should call python logic in django web development without additional triiger

I have been trying to solve this problem for sometime now. This is regarding django web development. I have an HTML page which has a Javascript function to upload an image file from the users local ...
1
vote
1answer
358 views

Outsourcing functionality from Django view to C/C++

I'm developing a Django project that basically boils down to: A user submits a form. The Django view parses the form and compiles a representation of that form which is readable by some other ...
5
votes
2answers
2k views

where exactly should python business logic be placed in django

I have just begun to learn Django/Python/Web Development. This problem has been troubling me for a while now. I am creating an application with multiple templates in Django. I have a views.py which ...
1
vote
1answer
189 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
168 views

Is it ok to start with templates in MVC development?

I'm new to web development and I've started working on a project in my company that uses DJANGO. I feel it flexible to start my development straight first from the templates. I think it will be easier ...
3
votes
3answers
161 views

Should custom data elements be stored as XML or database entries?

There are a ton of questions like this, but they are mostly very generalized, so I'd like to get some views on my specific usage. General: I'm building a new project on my own in Django. It's focus ...
1
vote
1answer
721 views

Storing primary keys of objects in Redis and then querying them in Postgres through Django

This is probably my second time posting in programmers. I'm usually on stackoverflow but this question is more fit for the community here. All suggestions, advice and insight on this matter is ...