Re: Front End and Back End separation

2016-02-10 Thread Dheerendra Rathor
If you don't want FE guys to touch your Python code, I will suggest to go with option 1. DRF is a great library and creating REST API is dead simple. Data validation is pretty easy in DRF using serializers. I tend to write my own authorization methods with DRF but they are also easy. It is just

Re: mathematical function and django connect

2016-02-10 Thread Luis Zárate
I repeat you again OK, start with writing a view https://docs.djangoproject.com/en/1.9/intro/tutorial03/ Show something funny in your HTML and when you be able to see in your browser let me know. How to do that, see the tutorial, basically this are the steps create a django app (python

Re: mathematical function and django connect

2016-02-10 Thread Xristos Xristoou
THNX for response to help me,two questions,how to import list input on my def math(input,*listinput*) how to define this ? now i dont have model,on my html template how to connect on my scipt ? Τη Τρίτη, 9 Φεβρουαρίου 2016 - 9:47:30 μ.μ. UTC+2, ο χρήστης Xristos Xristoou έγραψε: > > hello, > >

Re: mathematical function and django connect

2016-02-10 Thread Luis Zárate
It's correct. A recomendation Try to get out all input() from the function, because django is a server side so user don't have a standard input. 2016-02-10 15:22 GMT-06:00 Xristos Xristoou : > if i dont want refactor my scipt,and use this > def my_math_func(input1,input2):

Re: How to update a live / deployed Django project?

2016-02-10 Thread Andrew Farrell
> I have been through several variations on what you are doing. The solution which has worked best for me is to use SaltStack to control the update. If you are interested in learning SaltStack, I just recently wrote a step-by-step tutorial

Re: mathematical function and django connect

2016-02-10 Thread Xristos Xristoou
if i dont want refactor my scipt,and use this def my_math_func(input1,input2): my code return list_output,output is that correct ? Τη Τρίτη, 9 Φεβρουαρίου 2016 - 9:47:30 μ.μ. UTC+2, ο χρήστης Xristos Xristoou έγραψε: > > hello, > > > i create some python mathematical function on

Problem installing fixtures

2016-02-10 Thread WST
Hi All, I am new to Django and am taking over a project which uses a Django server. Unfortunately, the host machine used in the previous development cycle went missing and I had to set up a new server. I am now having problems loading data onto the database. I have a JSON file from dumpdata

Problem installing fixtures

2016-02-10 Thread WST
Hi All, I am new to Django and would appreciate some help with the problem I am facing. I am setting up a new server as the previous host machine went missing! I have a JSON file from dumpdata on the now missing server and am trying to load this data to the newly set up server. However, I

Re: mathematical function and django connect

2016-02-10 Thread Luis Zárate
Maybe you need to refactor your script, I suggest you something like this: def my_math_func(your_input): your_input = your_input.replace(" ", "") # prevent "1, 2" list_input = [int(x) for x in your_input.split(",")] # others comprobations could be do list_output = [] for x in

Re: How to update a live / deployed Django project?

2016-02-10 Thread Vernon D. Cole
I have been through several variations on what you are doing. The solution which has worked best for me is to use SaltStack to control the update. It will pull your updates using git, apply as needed, and restart your servers. If you are building a new server (for testing or prototype

Re: how to deploy python/django application in debian/apache?

2016-02-10 Thread Michal Petrucha
On Wed, Feb 10, 2016 at 10:57:29AM -0800, James Schneider wrote: > On Wed, Feb 10, 2016 at 7:15 AM, Fred Stluka wrote: > > > On 2/10/16 4:37 AM, James Schneider wrote: > > > > ... make sure that the Apache system user has read access to that > > directory and all

Re: mathematical function and django connect

2016-02-10 Thread Xristos Xristoou
for example: myscipt that my input for example the user define the number to want for input and next input integer numbers on the list(NList) that list go to progress and exported one variable result outpout and list of variables results. i dont upload the progress code because i think not is

Re: how to deploy python/django application in debian/apache?

2016-02-10 Thread James Schneider
On Wed, Feb 10, 2016 at 7:15 AM, Fred Stluka wrote: > On 2/10/16 4:37 AM, James Schneider wrote: > > ... make sure that the Apache system user has read access to that > directory and all subdirectories, and no write access ... > > James, > > Won't that prevent Django from

Re: mathematical function and django connect

2016-02-10 Thread Luis Zárate
OK, start with writing a view https://docs.djangoproject.com/en/1.9/intro/tutorial03/ Show something funny in your HTML and when you be able to see in your browser let me know. El miércoles, 10 de febrero de 2016, Xristos Xristoou escribió: > i dont know how to start to

Re: mathematical function and django connect

2016-02-10 Thread Xristos Xristoou
i dont know how to start to give you an example,is confused i am newmbie and i dont find anythink on the internet Τη Τρίτη, 9 Φεβρουαρίου 2016 - 9:47:30 μ.μ. UTC+2, ο χρήστης Xristos Xristoou έγραψε: > > hello, > > > i create some python mathematical function on python idle, > i want to create

Re: ./manage.py runserver 0.0.0.0:8080 is not working, No module named django.core.management

2016-02-10 Thread Luis Zárate
Please made other thread for that You need to read the documentation https://docs.djangoproject.com/en/1.9/howto/deployment/ ohn Travolta escribió: > > > On Tuesday, February 9, 2016 at 7:28:31 PM UTC+1, Daniel Roseman wrote: >> >> Django is installed for Python 3.4,

Re: mathematical function and django connect

2016-02-10 Thread Luis Zárate
Someting like def myview(request): dev = mymathfunc(request. POST.get_list('mi_input', [])) return render(request, 'mytemplate.HTML', {'result': dev}) I am not sure if get_list it is a valid function, I know there is one that do the same, but can't remember how is called. If you can

Re: WHERE EXISTS / WHERE NOT EXISTS clause without using QuerySet.extra

2016-02-10 Thread John P.
I posted a ticket here: https://code.djangoproject.com/ticket/26194 which was marked as a duplicate of https://code.djangoproject.com/ticket/25789#comment:2 It was suggested that I try Parent.objects.filter(child=None).distinct() (but that it might perform worse than the WHERE NOT EXISTS

Re: AttributeError at /sitemap.xml

2016-02-10 Thread Michal Petrucha
On Wed, Feb 10, 2016 at 06:01:28AM -0800, Kelvin Jayanoris wrote: > It seems that django/contrib/sitemaps/__init__.py line 146 causes an > attribute error sometimes as such: > > AttributeError: 'list' object has no attribute 'filter' > > I think this is because it always expects a queryset and

Re: How to update a live / deployed Django project?

2016-02-10 Thread Radek Svarz
Tobias, I know I will not help you directly, but maybe my setup + process can help someone else. I am deploying towards Redhat Openshift 2 PaaS. I was in the similar situation choosing the best fit option for continuous deployment. Final process: - Merging the feature code to the master

Front End and Back End separation

2016-02-10 Thread Radek Svarz
Hi, I am deciding about the new architecture of the Django business app. The web frontend app constists of 1 highly interactive part - visual editor (using D3js) and several configuration pages. I am strong in the Django backend part, but outsourcing the JS front end to the freelancer.com

Re: how to deploy python/django application in debian/apache?

2016-02-10 Thread Fred Stluka
On 2/10/16 4:37 AM, James Schneider wrote: ... make sure that the Apache system user has read access to that directory and all subdirectories, and no write access ... James, Won't that prevent Django from creating *.pyc files from the deployed *.py files? Or do you suggest deploying *.pyc

AttributeError at /sitemap.xml

2016-02-10 Thread Kelvin Jayanoris
It seems that django/contrib/sitemaps/__init__.py line 146 causes an attribute error sometimes as such: AttributeError: 'list' object has no attribute 'filter' I think this is because it always expects a queryset and fails when a list is provided. Is this a known issue, or not an issue at

Re: How to update a live / deployed Django project?

2016-02-10 Thread Andreas Kuhne
The thing is, you should be able to catch those issues when migrating locally on you development machines. In that case, just fix the migration and then it should work perfectly in production. You can always add certain values in the migration scripts themselves. Regards, Andréas 2016-02-10

Re: How to update a live / deployed Django project?

2016-02-10 Thread Tobias Dacoir
Thanks for sharing your workflow. Sounds simple enough and is more or less a scripted version of what I had in mind all along. About the manual intervention: At some points during development we had to provide a one-time manual entry when Django was migrating the database, either by adding or

Re: How to update a live / deployed Django project?

2016-02-10 Thread Andreas Kuhne
Hi, What I tend to do when deploying is: 1. Create a fabric script that contains a reference to the server that should be updated (defaults to dev server). 2. Use git archive to zip the contents of a git tag to a local file. 3. Upload the file to the server 4. Stop the uwsgi process 5. Update

Re: How to update a live / deployed Django project?

2016-02-10 Thread Tobias Dacoir
Thanks for the reply. Thanks for the advice. We should include the migrate command into our git hook as well. But like I said, sometimes it's not always possible as manual interaction is required. At least for 1.0 our model should not change much, except for future extensions and new models.

Re: mathematical function and django connect

2016-02-10 Thread Xristos Xristoou
yes i want this and work with python list for input and output Τη Τρίτη, 9 Φεβρουαρίου 2016 - 9:47:30 μ.μ. UTC+2, ο χρήστης Xristos Xristoou έγραψε: > > hello, > > > i create some python mathematical function on python idle, > i want to create website where the user import value numbers on the

Re: Django saved instance model WITH ERROR

2016-02-10 Thread Tim Graham
It's expected behavior. If you don't want to save an invalid instance, then don't call save() after you call full_clean() and encounter errors. As documented [1], calling save() itself don't do any validation. [1]

Re: Send an object parameter from views.py to forms.py

2016-02-10 Thread Sergiy Khohlov
I've moved to CBV sometime ago and I can not write your code on fly: Let imagine: 1) User request page using "GET" 2) User set some values and send it using "POST" 3) New page is shown using new "GET" id_medioedit is set ant stage 2 and answer at 3 is ok. But you dont know how to set it

Re: how to deploy python/django application in debian/apache?

2016-02-10 Thread John Travolta
Hi James, thank you for so detailed answer in general about this problematic. 1) I am agreed with you that "root" folder is not the best place for my application. *I thought if I try to chose another location for python app, paths in app will be different and it will not work.* but I will try

Send an object parameter from views.py to forms.py

2016-02-10 Thread elcaiaimar
Hello, I have a problem because I don't know how could I send one specific parameter. I've sent other parameters sometimes in others apps but this time is more difficult. Below it's my code. I want to send '*p*', which is an object. The problem is that I can't send it in *else *because I've

Django saved instance model WITH ERROR

2016-02-10 Thread ylativ oknesyl
*models* --- import datetime from mimetypes import MimeTypes from django.db import models from django.utils import timezone from django.utils.translation import ugettext_lazy as _ from mutagen import mp3, mp4, oggvorbis, oggtheora import libs .

Re: Codec H.264 if Free?

2016-02-10 Thread ylativ oknesyl
Thanks С уважением В. Лысенко 2016-02-10 1:37 GMT+02:00 Luis Zárate : > I don't understand you question, but if you are looking for video support > > > https://developer.mozilla.org/en-US/docs/Web/HTML/Supported_media_formats > > > You maybe need to take a look to ffmpeg

Re: Writing your first Django app, part 1 - Can't Follow it

2016-02-10 Thread James Schneider
On Feb 9, 2016 4:22 PM, wrote: > > Hi, > > I am running into the same problem as this: > http://stackoverflow.com/questions/30493018/404-error-in-writing-your-first-django-app-tutorial > > Now I can just follow the Alasdair's recommendation and delete the polls/url.py

Re: Writing your first Django app, part 1 - Can't Follow it

2016-02-10 Thread michaelatnanocube
Hi, thank you that was it! On Wednesday, February 10, 2016 at 4:48:11 AM UTC+2, bipulr wrote: > > I remember doing the django tutorial long time back, it just works. > > The import error means that file polls/urls.py is not there. Check may be > you have left "s" in ulrs. You might have created

Re: How to update a live / deployed Django project?

2016-02-10 Thread James Schneider
On Feb 10, 2016 12:50 AM, "Tobias Dacoir" wrote: > > We've build a small web application using Django 1.8 over the past couple of months and we are going live with version 1.0 soon (one last closed beta test is coming up). > So far we have deployed it on an Ubuntu VM (in Azure)

Re: how to deploy python/django application in debian/apache?

2016-02-10 Thread James Schneider
On Feb 10, 2016 12:23 AM, "John Travolta" wrote: > > Hi, > > I succeeded to run development python application: python3 ./manage.py runserver 0.0.0.0:8080 > > but now I need to make deployment, honestly I didn't succed to do it from august. I hope here I will get help. > >

How to update a live / deployed Django project?

2016-02-10 Thread Tobias Dacoir
We've build a small web application using Django 1.8 over the past couple of months and we are going live with version 1.0 soon (one last closed beta test is coming up). So far we have deployed it on an Ubuntu VM (in Azure) using Apache / Nginx and a local MySQL Server. I've already found

Re: how to deploy python/django application in debian/apache?

2016-02-10 Thread John Travolta
I don't know how to edit message, if it is important, here is path from yesterday, location of Django: Requirement already satisfied (use --upgrade to upgrade): *Django==1.8.3* in */root/env/lib/python3.4/site-**packages* (from -r requirements.txt (line 1 )) -- You received this message

how to deploy python/django application in debian/apache?

2016-02-10 Thread John Travolta
Hi, I succeeded to run development python application: python3 ./manage.py runserver 0.0.0.0:8080 but now I need to make deployment, honestly I didn't succed to do it from august. I hope here I will get help. *first of all, settings.py had to be corrected from debug = true to DEBUG = False &