Re: Do I need an API?

2014-02-04 Thread Avraham Serour
I think it is dangerous to let users edit the HTML directly, in my opinion you should let them edit the content and maybe some formating On Feb 5, 2014 12:27 AM, "m1chael" wrote: > I think the point is: it's difficult for old-school tech people to > work with Django because there is a learning cu

Re: [JOB] $1,500 referral reward - Know anyone for Lead Python / Django Developer opening?

2014-02-12 Thread Avraham Serour
it is under my impression that recruiters like these don't read replies to the list, since they're not interested in the list but just in post rights, they may subscribe and opt to not receive emails. so all these replies and suggestions on how to improve them are between ourselves and never get to

Re: Video chat software in a django website

2014-04-03 Thread Avraham Serour
this is out of the scope for django, if you have a html5 js client for example, django would serve it but that's it, the client would actually do the chatting part On Thu, Apr 3, 2014 at 5:10 PM, Saransh Mehta wrote: > Hi, > I want to include a video chat software for the users in my django > we

Re: Best practice - evolving from one to several sites using Django

2014-04-30 Thread Avraham Serour
if I'm not mistaken having a multi tentant django deploy means they will share the same DB I suggest having separate deployments for each site, as for sharing code you should create an app which is the shared code and put in version control and all your deployments would update from the same reposi

Re: Model Objects and Updating db via XML

2014-05-13 Thread Avraham Serour
Fixtures are usually in json. Not sure if the is support for importing fixtures in XML In any case you can always parse them yourself and create the proper objects Don't forget that this is an open source project, you can code XML support and contribute On May 13, 2014 10:40 PM, "Sayth Renshaw" w

Re: django and oracle

2014-05-14 Thread Avraham Serour
it looks like your error occurs when using django ORM with oracle, but in the beginning of your email you mention that you don't want to use it, so what's the problem here? On Wed, May 14, 2014 at 5:54 PM, J. D. wrote: > Can someone help me with cx_Oracle and Django?! :) > > I have Oracle DB 11

Re: Is Django the best for my web app ?

2014-05-15 Thread Avraham Serour
follow the django tutorial On Thu, May 15, 2014 at 12:33 PM, Amelie Bacle wrote: > Hello everyone, > > I have to do a web application at my work. I use to program with Python > every day but never for web application. So I wanted to know if Django is > the best choice for my problem. Here it is,

Re: website statistics

2014-05-21 Thread Avraham Serour
You'll need to know what information you need and how you want it to be displayed. Do you need to know how many times buttons were clicked on your website? how many times a specific page was opened, how many times a picture was downloaded? the average times some page was opened each day during las

Re: Anyone interested in reviewing the code of a small project - BookMarker

2014-05-25 Thread Avraham Serour
any explanation you think would be necessary should be documented, either in code comments and/or on the project wiki/readme this is actually a very important part of the project, boring? yes, but this it the first (and maybe only) thing people will look On Sun, May 25, 2014 at 2:20 PM, Aseem Ban

Re: Question about minifying CSS and JS files.

2014-06-23 Thread Avraham Serour
There are django solutions for this, but personally I like to use Google Pagespeed On Jun 23, 2014 10:04 AM, "Chen Xu" wrote: > Hi Everyone, > I am writing a Django website, I am trying to minify my css and js files, > I wonder if there is a good Django package that does it well, or it does > not

Re: pre_save on password

2014-07-01 Thread Avraham Serour
you should only store the user password once, if you are trying to catch it just to register in another application then you now have two problems you should set django use the other system as authentication backend, new users should just register there and change their passwords there, on the cen

Re: Generating a unique 10 digit ID for each model instance

2017-10-22 Thread Avraham Serour
The database usually handles this and you don't need to worry, there are many corner cases and DB systems are able to handle them But they won't look like whatever format you would like, usually it is just a number Why do you need the IDs to look like that? On Oct 22, 2017 6:53 PM, "Jack Zhang"

Re: OSError: [Errno 13] Permission denied:... /_dummy_thread

2017-11-06 Thread Avraham Serour
don't use sudo to pip install packages, you should create a virtualenv for your project On Mon, Nov 6, 2017 at 8:24 AM, Vineet Kothari wrote: > try to update your python : https://stackoverflow.com/ > questions/2720014/upgrading-all-packages-with-pip > > On Mon, Nov 6, 2017 at 12:10 AM, Mel DeJe

Re: Url with optional arguments

2017-11-08 Thread Avraham Serour
I recommend putting two entries on urls.py, they can both point to the same view. Just be sure to set a default value for subpage_slug on the function argument On Wed, Nov 8, 2017 at 3:01 PM, wrote: > Hi everyone, > > I would like to make a documentation app with urls like this (not > flatpages)

Re: [ORM Foreign Keys][Performance] How to use Charfield Foreign Keys efficiently?

2017-11-21 Thread Avraham Serour
can you post your model? On Tue, Nov 21, 2017 at 3:31 PM, Dominik Szmaj wrote: > Hey, > > I have a very big performance problem with Django and Oracle db. > > This legacy db has lots of primary keys as strings from the time when > those id's were alphanumerical so it can't be simply converted to

Re: DJANGO NOT FOUND

2017-12-24 Thread Avraham Serour
did you create a virtualenv for the project? you shouldn't pip install stuff in the system python. can you import django using the python console? On Sun, Dec 24, 2017 at 2:22 AM, Jack wrote: > Hi, i've installed on my ubuntu 16.04 LTS python3.6 and django but django i > have installed with pip

Re: DRF JWT Token with Mobile

2017-12-29 Thread Avraham Serour
instead of: curl -X POST -d "mobile=1234567890" http://localhost:8000/api-token-auth/ could you just use: curl -X POST -d "username=1234567890" http://localhost:8000/api-token-auth/ In any case what's the use case here? This doesn't seem secure at all, to log in someone only using the username, e

Re: Wich OS for develop?

2018-01-02 Thread Avraham Serour
In my opinion ubuntu no, but I wouldn't say good either yes pycharm good luck On Tue, Jan 2, 2018 at 11:23 PM, Julián Melero Hidalgo < jul...@melerohidalgo.es> wrote: > Hi all. > I don't have experience with django, so I have so much questions. > The questions are: > Wich OS is better to develop

Re: Django storing byte string for image

2018-01-03 Thread Avraham Serour
I used this project once: http://django-db-file-storage.readthedocs.io/en/latest/ It seems it uses a TextField for the file bytes. I would expect django.contrib.postgres to implement a binary field, but it don't. I guess you can implement your own field type for bytea, psycopg maps bytes to byte

Re: Django test command with --parallel

2018-01-10 Thread Avraham Serour
does it work without the parallel flag? On Wed, Jan 10, 2018 at 10:57 AM, Yevhen Yevhen wrote: > The same traceback from the pastebin link: > > Creating test database for alias 'default'... > Cloning test database for alias 'default'... > Cloning test database for alias 'default'... > System che

Re: How to get two django rest framework to communicate with each other

2018-01-16 Thread Avraham Serour
This shouldn't be a problem, I work with several people on the same django app. We use git to share the code. you can use a hosted git service like gitlab, github or bitbucket On Tue, Jan 16, 2018 at 9:58 AM, wrote: > Oh, but the thing is i am doing 1 project, and another person is doing > othe

Re: How to autoGenerate C bindings for Django 1.11 ?

2018-01-23 Thread Avraham Serour
Did you try doing this and see what happens? On 23 Jan 2018 9:56 PM, "Etienne Robillard" wrote: > Can I create a file named libdjango.pyx with the following code: > > {{{ > > import django > > from django import * > > }}} > > Then compile the C file with gcc to access django in C ? > > Etienne >

Re: PostrgreSQL Inside Virtualenv

2018-01-24 Thread Avraham Serour
In any case you'll need to pip install the postgres drivers for python, I suggest doing that inside the env On Wed, Jan 24, 2018 at 11:32 AM, tango ward wrote: > Got it. Thanks Anoosha > > On Wed, Jan 24, 2018 at 5:29 PM, 'Anoosha Masood Keen' via Django users < > django-users@googlegroups.com>

Re: How to autoGenerate C bindings for Django 1.11 ?

2018-01-24 Thread Avraham Serour
please try and share your findings, I'm sure I'm not the only one curious about this On Wed, Jan 24, 2018 at 11:21 AM, Etienne Robillard wrote: > Hi Avraham > > On Tuesday, 23 January 2018 17:18:19 UTC-5, Avraham Serour wrote: >> >> Did you try doing this and s

Re: Will django include a simpler way to change username to email for registration in the future ?

2018-01-24 Thread Avraham Serour
someone posted an app for that here w while ago: http://django-improved-user.readthedocs.io/en/latest/index.html On Wed, Jan 24, 2018 at 1:23 AM, Vijay Khemlani wrote: > I have been using django-custom-user for that without any issues > > On Tue, Jan 23, 2018 at 6:43 PM, Daniel Cîrstea < > da

Re: django 2 under python 2

2018-01-25 Thread Avraham Serour
> I wonder why this is happening... because django 2 doesn't support python 2 I suggest using python 3.6 On Thu, Jan 25, 2018 at 9:50 PM, Andy wrote: > Hi! > > pip inside a python2 virtualenv will try to install django 2, which aint > working and will fail. > I wonder why this is happening beca

Re: javascript transpilers

2018-01-28 Thread Avraham Serour
If you don't want and don't have the time to learn JS you may as well consider outsourcing the frontend work, I've worked in places that did just that and everybody was happy, the internal team liked python and the outsourced company people liked UX and JS. On Sun, Jan 28, 2018 at 6:09 PM, Jani Ti

Re: Django-hotsauce: Current status and roadmap

2018-01-31 Thread Avraham Serour
Why do you call it microframework? You should prove it is high performance, benchmark, measure, compare and show some cool graphs I already have a Django project, is it a drop in replacement? My project uses python 3.6 while you only have experimental support for 3.5. I'm not going back, you shou

Re: Django server and client communications

2018-03-04 Thread Avraham Serour
I suggest using DRF, It can autogenerate the schema which can be useful. It seems they also have a client to consume that, worth taking a look On 4 Mar 2018 21:58, "Richard Maceček" wrote: > Hello, I need help with client and server communications. Web Application > - Djang Server Side. The cli

Re: Error After Inspect db

2018-03-13 Thread Avraham Serour
it seems you wrote def_str_, if should be def (space) then the function name also the function str should probably be named with double underscores like this: __str__ not _str_ On Tue, Mar 13, 2018 at 5:27 PM, mansi thakkar wrote: > Hello , > Here is the attached files of my output and my error

Re: models that are not tables but not abstract

2018-03-29 Thread Avraham Serour
Currently for things like this I create a view and serializer that are not related to any model. Of course I lose some introspection code that expect a model, but for the most part I'm able to make an API endpoint with data not from the ORM. Can you elaborate more on your use case? On Thu, Mar 2

Re: I'm trying to edit address form for Saleor ecommerce platform

2018-04-08 Thread Avraham Serour
You seem to have pasted a line from your template, not the error you are getting, no way of helping you there. Please post the actual error you are getting On Sat, Apr 7, 2018 at 2:00 PM, ruslan.aldar wrote: > hello. > I'm trying to build an local merchant website. So I don't know how to edit >

Re: Reporting for Django 2

2018-04-09 Thread Avraham Serour
Do you have a question or just sharing? On Sat, 7 Apr 2018, 1:33 , wrote: > Hi > > I've been trying different django reporting packages with no success > > Apparently, all of them are developed for versions previous than Django 2.0 > > Any help will be appreciated > > José > > -- > You received

Re: Django blocking on writing logs

2018-04-09 Thread Avraham Serour
It seems you are right, I found this SO thread dealing with the same question: https://stackoverflow.com/questions/34349797/are-log-statements-blocking-in-django-python In pratical terms I use sentry, the python client claims to use a threaded async approach, I suggest taking a look at their imple

Re: Pant builds with django

2018-04-09 Thread Avraham Serour
what is pant builds? On Thu, Apr 5, 2018 at 11:24 PM, Allan Nava wrote: > Is possible use pant builds with django? > > -- > 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 a

Re: Help: 'django.utils.six.moves' is not a package

2018-04-09 Thread Avraham Serour
sounds like django 2 removed six and some library you are using still hopes it exists. what django version are you using? On Mon, Apr 9, 2018 at 3:39 AM, Derek Zeng wrote: > I got the following error when running pytest in django. Help is > appreciated. > > This is the test I run > > import pyt

Re: serializers

2018-04-09 Thread Avraham Serour
Can you phrase the question better? The way it is written makes it hard to understand exactly what you need here. On Thu, Apr 5, 2018 at 5:33 PM, siva.gatti wrote: > how to add created_by_id to serializers in django rest rest frame work and > created_by_id is stored in session when the user is l

Re: username and allowed alphanumeric, why?

2018-04-10 Thread Avraham Serour
It seems you read that wrong, usernames may contain alphanumeric and other characters. On Tue, Apr 10, 2018 at 12:10 PM, Stefano Tranquillini < stefano.tranquill...@gmail.com> wrote: > Hi all, > > mostly curiosity, why does the username https://docs.djangoproject. > com/en/1.11/ref/contrib/auth/

Re: Django blocking on writing logs

2018-04-10 Thread Avraham Serour
em > > 2018-04-09 20:27 GMT+01:00 Avraham Serour : > >> It seems you are right, I found this SO thread dealing with the same >> question: https://stackoverflow.com/questions/34349797/are- >> log-statements-blocking-in-django-python >> >> In pratical

Re: retain form data when a user session expires while filling a form

2018-04-13 Thread Avraham Serour
You may also always save to cookie before submitting the form and clear it on the thank you page On Thu, 12 Apr 2018, 14:20 Vijay Shanker, wrote: > I have to code this scenario: > > Some user comes to fill a form and while user is at it, session expires; > User tries to submit form, as session h

Re: Porting from Cookie based authentication to JWT (except admin portal)

2018-04-24 Thread Avraham Serour
I wouldn't use two settings to only achieve this, you can add multiple auth classes which django will try in a loop. You can add the JWT and a custom class which can baseclass the login/password auth and only allow superusers to login On Tue, Apr 24, 2018 at 6:18 PM, Prakash D wrote: > Hi I'm t

Re: Do you know good guides to use ajax in django

2018-04-26 Thread Avraham Serour
I suggest taking a look at http://intercoolerjs.org On Thu, Apr 26, 2018 at 7:36 AM, wrote: > Im starting a social network for my school and i need to show the coments > of my post without recharging the whole and for other things in my proyect > > -- > You received this message because you are

Re: Django dependecies

2018-05-02 Thread Avraham Serour
The admin app uses it, you can make your app without worrying about it, one won't affect the other On Wed, 2 May 2018, 14:09 Mauro Ribeiro, wrote: > Hi, > > Why does django include jquery? > > django/django/contrib/admin/static/admin/js/vendor/jquery/jquery.js > > What use does it make of it? >

Re: Django performances issue

2018-05-02 Thread Avraham Serour
How many workers do you have? What those requests do? Even 3 minutes sounds like too much, do they just query from the DB and render a template? How caching didn't help? did you count the cache miss/hit? What are you caching? On Wed, May 2, 2018 at 3:59 PM, prakash sharma wrote: > I have develop

Re: How do I design a user model for a Dating site

2016-04-25 Thread Avraham Serour
I personally would make a separate profile model either create a profile using signals or use something like get or create profile each time you want to get a profile for a user On Mon, Apr 25, 2016 at 2:11 PM, njan wrote: > Hello all, > > My first post here. > > I'm trying to make a Dating sit

Re: Using django login functionality in a non django app

2016-04-27 Thread Avraham Serour
You can just use the session id, call it a token instead of cookie and be happy On Wed, Apr 27, 2016, 6:53 PM Gergely Polonkai wrote: > I would create a separate view for this, like /falcon_login/, which could > give you a plain text result. But that’s totally up to you. > > > > Gergely Polonkai

Re: regarding Session ID and cookie validation

2016-05-01 Thread Avraham Serour
> 1. When cookies are used to carry authentication tokens or session IDs within a web application, and multiple such cookies are present, the django verify all such cookies before granting access to the user session. What kind of verification do you expect here? if the submited session id is a vali

Re: Complex content type

2016-05-01 Thread Avraham Serour
what's so special about your content type? It seems you are just storing text. On Fri, Apr 29, 2016 at 7:51 AM, Said Akhmedbayev wrote: > Need to build a content type that accepts inputs from users. Those inputs > must be stored in database alone with information who entered it (user's > inform

Re: Help Replicating a Django App Repo

2016-05-08 Thread Avraham Serour
if you are cloning a project it means you are not starting one from zero. so you already have a manage.py file, you don't need to run startproject On Sun, May 8, 2016 at 12:20 AM, Erin A wrote: > Hello, > > I am a junior software engineer and am quite new to Django. I built this > app

Re: python - handling HTTP requests asynchronously

2016-05-08 Thread Avraham Serour
so it seems that what you need is not to handle http requests asynchronously, but to process async jobs requested by http. if that is the case celery is a popular option and relatively easy to setup, I personally would use it for such things. buton the other hand you are saying that the task in ha

Re: django 1.8 or 1.9.2 is not installed in my window 7

2016-05-22 Thread Avraham Serour
did you try using pip to install? > pip install django On Sun, May 22, 2016 at 6:34 PM, Shivam Taneja wrote: > django 1.9.2 is not installed in my window 7 in python 2.7 its indicating > the error > > C:\Python27>python setup.py install > Traceback (most recent call last): > File "setup.py",

Re: Loading staticfiles in every single template file

2016-05-25 Thread Avraham Serour
template tag loading are not inherited On Tue, May 24, 2016 at 2:56 PM, Branko Zivanovic < international11...@gmail.com> wrote: > I'm not sure why I need to add following line *{% load staticfiles %} *in > every single template file if there is inheritance.Can I avoid this somehow? > > -- > You

Re: Reportlab no module named pdfgen

2016-05-25 Thread Avraham Serour
maybe you are using a version different from the documentation you are reading check the version you installed using 'pip freeze' or 'pip list' On Mon, May 23, 2016 at 11:33 PM, david rodgers wrote: > Hello All, > > I am trying to use reportlab to generate pdfs from html. When I pip > install r

Re: Installation Advice - Win/PostgreSQL/Django

2016-06-02 Thread Avraham Serour
For development you only really need django, you can develop with sqlite and deploy on a server using postgres, using postgres on the development machine is nice but not strictly necessary. If this is for a production machine you will also need a webserver On Jun 2, 2016 10:56 PM, "Rafael E. Ferrer

Re: Allow users to vote up, down or nothing

2016-06-06 Thread Avraham Serour
Maybe a nullable boolean field On Jun 6, 2016 6:27 PM, "Robin Lery" wrote: > Hello, > I have made an app to create article. This is the model: > > class Article(models.Model): > user = models.ForeignKey(settings.AUTH_USER_MODEL) > title = models.CharField(max_length=150) > body = mode

Re: django1.6 with uwsgi and nginx on RHEL 7

2016-06-06 Thread Avraham Serour
you should use isolated virtual environments for each python project, don't install packages on the system wide python, see https://virtualenv.pypa.io/en/stable/ On Mon, Jun 6, 2016 at 11:45 PM, Larry Martell wrote: > I figured this out - the problem turned out to be that the RHEL 7 > machine h

Re: django1.6 with uwsgi and nginx on RHEL 7

2016-06-07 Thread Avraham Serour
dedicated to > just running that one app. > > On Mon, Jun 6, 2016 at 4:54 PM, Avraham Serour wrote: > > you should use isolated virtual environments for each python project, > don't > > install packages on the system wide python, see > > https://virtualenv.pypa.

Re: Dynamic code analyzer for Django

2016-06-16 Thread Avraham Serour
you can run the code with coverage usually tests are run with coverage, not sure how this will impact on performance, other than that you can just check your logs and see what requests are being made and which aren't On Wed, Jun 15, 2016 at 11:41 PM, Raúl Quesada Pegalajar wrote: > Hello!! > >

Re: wsgi setup + django 1.9 + python 3.5.1 on mac os x

2016-06-28 Thread Avraham Serour
it seems it doesn't have cffi installed but why do you want to do this? are you using the mac as server of are you setting up your development environment? for development you may just use manage.py runserver, you don't need to setup apache for the server I recommend using nginx+uwsgi, the kille

Re: wsgi setup + django 1.9 + python 3.5.1 on mac os x

2016-06-28 Thread Avraham Serour
point me to the proper documentation to deploy using nginx+uwsgi > so i can try it > > > On Tue, Jun 28, 2016 at 4:49 PM, Avraham Serour wrote: > >> it seems it doesn't have cffi installed >> >> but why do you want to do this? are you using the mac as s

Re: What is the full testing toolkit any Python/Djang/JS developer?

2016-06-30 Thread Avraham Serour
> nose, pytest and unittests really? On Thu, Jun 30, 2016 at 9:33 AM, Seti Volkylany wrote: > Now, I am using: factory-boy, selenium, nose, pytest and unittests. > I have a plan use in future QUnit > and Continuous Integration. May be it is enough? > Who using yet tools?

Re: Best Practices URL Patterns

2016-07-06 Thread Avraham Serour
if not the id what do you suggest then? is this a general rule for you or do you apply this only for users? On Wed, Jul 6, 2016 at 6:46 PM, William Caruso wrote: > As far as putting the ID into the url, I would suggest not. Even though > the ID is secure and anonymous, django's urls allow for m

Re: Migrating an unmigrated database from 1.6 to 1.7

2016-07-07 Thread Avraham Serour
I believe you can checkout your project with a commit still using django 1.6 with south and run the south migration on the remaining database On Thu, Jul 7, 2016 at 2:05 PM, bobhaugen wrote: > We're upgrading an app from django 1.4 step-by-step through all the > versions at least to 1.8. Got a

Re: How make testing for a generated PDF file?

2016-07-21 Thread Avraham Serour
input -> function == expected output On Thu, Jul 21, 2016 at 4:37 PM, Seti Volkylany wrote: > > > -- > 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-u

Re: Advice on python version for new project

2016-08-15 Thread Avraham Serour
you should also create a virtualenv for the project On Tue, Aug 16, 2016 at 12:07 AM, Rich Shepard wrote: > On Mon, 15 Aug 2016, Rich Shepard wrote: > > I'll have to learn how to get it to install in -3.5.2, too. >> > > Found the answer: pip3. > > Rich > -- You received this message because

Re: nginx+uwsgi, cache somewhere but I don't know where

2016-08-16 Thread Avraham Serour
How do you know the query is cached? On Aug 16, 2016 6:33 PM, "술욱" wrote: > I forgot to say I reloaded (and restarted) nginx and uwsgi, but the query > is still cached > > > Thanks anyway! > > > > > 2016-08-16 12:24 GMT-03:00 M Hashmi : > >> Reload Nginx and see if still its loading cached query

Re: nginx+uwsgi, cache somewhere but I don't know where

2016-08-16 Thread Avraham Serour
did you checked if it cached in the browser? does nginx gets the request? if so what does it answers? On Tue, Aug 16, 2016 at 7:07 PM, 술욱 wrote: > Because this particular query runs in about 30 seconds and its result ends > up in an excel file, which is generated with openpyxl from a template.

Re: Advice on python version for new project

2016-08-16 Thread Avraham Serour
https://virtualenv.pypa.io/en/stable/ On Tue, Aug 16, 2016 at 1:36 AM, Rich Shepard wrote: > On Tue, 16 Aug 2016, Avraham Serour wrote: > > you should also create a virtualenv for the project >> > > Avraham, > > OK. Please point me to some docs for this. >

Re: Non relational databases (MongoDB) with Django

2016-08-17 Thread Avraham Serour
Why do you need to use mongodb? Why not just use postgres and all the tooling the django ORM provides? On Wed, Aug 17, 2016 at 3:32 PM, Deep Shah wrote: > How easy is it to use MongoDb without a Django ORM once the code base > increases? > > > > > On Wednesday, August 17, 2016 at 5:25:01 PM UTC

Re: Database data caching in Django?...

2016-08-17 Thread Avraham Serour
https://djangopackages.org/grids/g/caching/ On Wed, Aug 17, 2016 at 11:43 PM, Tim Graham wrote: > I did a quick search and found https://github.com/BertrandBordage/django- > cachalot. Does it meet your requirements? > > > On Wednesday, August 17, 2016 at 3:34:33 PM UTC-4, Fred Stluka wrote: > >

Re: Models of Speedy Net

2016-08-18 Thread Avraham Serour
It doesn't matter, you should decide on something and stick to it, consistency is more important than some suggestion you read somewhere. What your suggested seems fair, write on your documentation that you decided this and ask politely for contributions to follow this style On Aug 18, 2016 3:08

Re: Serving very large pdf files with django

2016-09-04 Thread Avraham Serour
if you need to server the pdf then it will be downloaded to the user computer, even if you are visualizing in browser with js. What you can do is show screenshots of the pdf pages, then you would be serving individual jpgs for each page and not a single 100mb file. You can create previews for eac

Re: Add rows in migrations?

2016-10-04 Thread Avraham Serour
which user? a user usually is known during a request, while running the migration there are no users, you can access all users the same way you may access all the database, but this is not a user requested operation like a view processing a template. In any case you still may add/remove/modify da

Re: Headless testing

2016-10-12 Thread Avraham Serour
Hi, In Linux you can just use selenium chrome or firefox or anything and set up xfvb for headless, I have no idea if such a thing is possible in windows. In either you can set up a selenium server so the machine running the tests will connect remotely to the machine running the browser, you can e

Re: Slow first request django

2016-10-13 Thread Avraham Serour
I will take a wild guess here and say that this is a modwsgi problem, it seems it will only load the django app after the first request. Honestly I suggest you to use nginx with uwsgi, the killer feature is that it is not apache, I ran with so many bumps with apache that I turned to nginx and neve

Re: Django + WSGI authentication

2016-10-13 Thread Avraham Serour
maybe the user is already logged in? it is sending the sessionid and the server is authenticating checking the sessionid On Thu, Oct 13, 2016 at 10:09 PM, Garry wrote: > Hi. > > I'm porting a legacy Django+mod_python application to Django+WSGI on > Apache httpd 2.4 (Linux) and cannot get user au

Re: Compiling/packing Django to one binary

2016-10-19 Thread Avraham Serour
using a virtualenv is common and suggested, but don't need to mess with LD_LIBRARY_PATH you can create the virtualenv in your home directory or the application directory and run the python executable from the virtualenv, no need to touch LD_LIBRARY_PATH On Wed, Oct 19, 2016 at 3:41 PM, GMail w

Re: Running django on demand via my PyQt4 Standalone app

2016-10-24 Thread Avraham Serour
> Q1: Is it good idea to start a new QThread who runs the script os.system("web/manage.py runserver")? No, don't do that. > Q3: If no - what is the best method to start a django server on demand via my PyQt4 App and to stop it? If the idea is to use django from within a desktop app, you don't need

Re: Running django on demand via my PyQt4 Standalone app

2016-10-24 Thread Avraham Serour
does this help? https://docs.djangoproject.com/en/1.10/topics/settings/#calling-django-setup-is-required-for-standalone-django-usage On Tue, Oct 25, 2016 at 12:13 AM, Vinicius Assef wrote: > On 24 October 2016 at 16:30, Avraham Serour wrote: > > > > Django is a webframework, b

Re: Downside of using shortuuid as primary key

2016-10-27 Thread Avraham Serour
why are you considering? On Thu, Oct 27, 2016 at 7:34 AM, Suren Sth wrote: > I am considering to use shortuuid > as the primary key > for my models. > > Is there any downside to this? > Does it severely affect db indexing? > > -- > You recei

Re: Migrating custom mysql application to django orm

2016-10-30 Thread Avraham Serour
SearchableText.objects.filter(searchterm__term__in=('is', 'another')).order_by('searchterm__term') is this what you need? On Sat, Oct 29, 2016 at 7:03 PM, Yaşar Arabacı wrote: > Hi, > > I am trying to migrate my mysql application into django orm. I need help > converting my sql statements into

Re: Why are view mixins not exported?

2016-11-01 Thread Avraham Serour
Which ones? What error are you getting? On Tue, Nov 1, 2016 at 3:05 PM, Frederik Creemers < frederikcreem...@gmail.com> wrote: > I'm trying to create my own generic view, and there are several mixins in > django.views.generic that would be very useful to me. When I try to import > them, PyCharm

Re: ORM PostgreSQL stuff

2016-11-26 Thread Avraham Serour
I didn't quite understood the question, you want to find the division of two prices for each item, but each item has only one price according to the model you posted. can you express what you want to accomplish in python or SQL? On Sat, Nov 26, 2016 at 10:15 PM, Artem Bernatskyy < artem.bernats..

Re: rewrite PostgreSQL query to Django ORM

2016-11-29 Thread Avraham Serour
I think you would still need some SQL, you could use annotate to add the field with the value of the calculation and then add .order_by() to the queryset https://docs.djangoproject.com/en/1.10/ref/models/expressions/#raw-sql-expressions On Tue, Nov 29, 2016 at 11:07 PM, Artem Bernatskyy < artem.b

Re: Django runserver, the header doesn't contain connection:keep-alive

2016-12-01 Thread Avraham Serour
Don't use runserver fur production, use nginx with uwsgi On Dec 1, 2016 11:42 AM, "韦然" wrote: > Dear all, > > The current header is: > > HTTP/1.0 200 OK > > Date: Thu, 01 Dec 2016 08:33:29 GMT > > Server: WSGIServer/0.1 Python/2.7.12 > > X-Frame-Options: SAMEORIGIN > > Content-Type: text/xml > >

Re: How can I access field values generically?

2016-12-06 Thread Avraham Serour
please format the code at the bottom On Tue, Dec 6, 2016 at 2:11 PM, Mike Dewhirst wrote: > Consider a chemical mixture with a bunch of ingredients. Both mixture and > ingredients are instances of the same class so they have the same fields. > They also have many related models, including 1:1, 1

Re: Help Needed: Django Server For High Frequent Requests

2016-12-10 Thread Avraham Serour
are you using manage.py runserver? On Fri, Dec 9, 2016 at 10:13 PM, Xiao Bo wrote: > I'm building a Django server for data collection. However, the program > seems not capable when the sensing network expands. As time goes on, the > program doesn't even enter the code piece and report broken pi

Re: Help Needed: Django Server For High Frequent Requests

2016-12-10 Thread Avraham Serour
s you can tweak On Sat, Dec 10, 2016 at 11:38 PM, Xiao Bo wrote: > Yes, I did. > > 在 2016年12月10日星期六 UTC-5下午3:37:17,Avraham Serour写道: >> >> are you using manage.py runserver? >> >> >> On Fri, Dec 9, 2016 at 10:13 PM, Xiao Bo wrote: >> >>> I&#

Opinions on permissions stategy

2016-12-10 Thread Avraham Serour
Hi, I'm using DRF and need to implement object based permissions, I sublassed BasePermission to create my own logic. Currently all models that make sense to have permission inherits from a base Object model, implementing common behaviour and fields. The object has two many to many fields to User

Re: Opinions on permissions stategy

2016-12-12 Thread Avraham Serour
Avraham On Tue, Dec 13, 2016 at 3:34 AM, Vinicius Assef wrote: > Considerations follow inline... > > On 11 December 2016 at 03:34, Avraham Serour wrote: > > ... > > > > So should I check the parent object permissions? or just checking the > > current object is enough

Re: Opinions on permissions stategy

2016-12-14 Thread Avraham Serour
; always rule that situation? > > The object's "floor" is important. > > -- > Vinicius > > > On Tuesday, 13 December 2016, Avraham Serour wrote: > >> Hi, >> >> Thanks for taking your time on this. >> >> > Could a child

Re: Error 500 'NoneType' object

2016-12-14 Thread Avraham Serour
it seems you have a bug on your error handling, it seems messages.error is None Can you reproduce this locally? your tests should also cover the error handling On Thu, Dec 15, 2016 at 1:45 AM, Zachary Sohovich < zacharyesohov...@gmail.com> wrote: > I created a simple contact form with Django for

Re: Django with MySQL DB for multitenancy

2016-12-19 Thread Avraham Serour
You are right, you may do the routing with nginx but will you have many isntances of django this way. You are also right that you should need to create a database router yourself taking in account whatever is needed to decide which database to use. You could for example use the domain from the req

Re: Criar aquivo urls.py

2016-12-19 Thread Avraham Serour
https://docs.djangoproject.com/en/1.10/intro/tutorial01/#creating-a-project 2016-12-19 23:27 GMT+02:00 Fabio C. Barrionuevo da Luz : > uai, desde que arquivos python simplesmente são arquivos de texto, abra um > editor de texto como o Notepad++, Gedit, SublimeTex e crie o arquivo com o > nome url

Re: Postgres SQL vs SQLite vs MS SQL vs MY SQL

2016-12-22 Thread Avraham Serour
I do not want to speak ill of sqlite, it is very useful for development, testing and other uses, but in short it is not a fully featured DBMS. Django can work with many different databases, not only sqlite and MSSQL. You will have license costs for the database and for the OS, I would personally

Re: Postgres SQL vs SQLite vs MS SQL vs MY SQL

2016-12-22 Thread Avraham Serour
if one really wants to pay for suport you can still use postgres and pay to enterpriseDB On Thu, Dec 22, 2016 at 2:45 PM, Sundararajan Seshadri wrote: > The situation justifies the data base. There are more data bases (like > Oracle and Firebird) than what you have specified. But, let me compare

Re: Django - save user in another table

2016-12-22 Thread Avraham Serour
I think you should create another table called Profile that will hold all the addtitional info the common users have that the admins do not. The auth.user table is useful for handling password, authentication, session and common features all users have. On Wed, Dec 21, 2016 at 11:45 PM, milad rana

Re: How do you recommend to use Hebrew gender-related translations?

2016-12-22 Thread Avraham Serour
maybe translation context? https://docs.djangoproject.com/en/dev/topics/i18n/translation/#contextual-markers On Thu, Dec 22, 2016 at 9:29 PM, Fergus Cameron wrote: > I personally try to use language agnostic message IDs and translate > everything (i.e. including English). Your idea of appendin

Re: What is the best combination of components to be used with Django on Windows 10?

2016-12-26 Thread Avraham Serour
http://lmgtfy.com/?q=django+deploy+iis On Mon, Dec 26, 2016 at 8:18 AM, Varuna Seneviratna < varunasenevira...@gmail.com> wrote: > What is the best combination of components to be used with Django on > Windows 10?. By components, I mean the database and the web server.Can > Django be employed wi

Re: What is the best combination of components when installing Django on Windows 10?

2016-12-28 Thread Avraham Serour
There's nothing recommending not to use uwsgi on windows. Deploying on windows may be not recommended, but if you must use it uwsgi may be compiled in cygwin. Actually even nginx may be compiled in cygwin and works fine On Wed, Dec 28, 2016 at 5:03 AM, roboslone wrote: > Both nginx and Apache ar

<    1   2   3   4   5   >