Re: django cms beginner app issue

2019-03-26 Thread Avraham Serour
you model doesn't have app_config On Tue, Mar 26, 2019 at 1:07 AM Keegen Knapp wrote: > I'm trying to write a custom app where you can add new plants in the > admin. Then create a list view, category view and detailed view. You can > see my error and code below. Any help is greatly

Re: Best option for wrapping a wsgi app

2019-02-20 Thread Avraham Serour
I recommend nginx+uwsgi On Tue, Feb 19, 2019 at 3:09 PM Anton Melser wrote: > Hi, > > I searched high and low but my Google-foo must be lacking. I want to wrap > a wsgi app (https://github.com/tsudoko/anki-sync-server) and serve it > under my Django site. After wasting large amounts of time

Re: Using {% include %} and getting context with me

2019-02-13 Thread Avraham Serour
Maybe you can solve this using a templatetag? On Wed, 13 Feb 2019, 16:47 Mikkel Kromann Hi. > > I have a collection of apps where I find repeating myself when rendering > tables in the templates. > In the stylised example below I have three types of tables, foo, bar and > baz. > Each app is

Re: Django on IIS

2018-12-18 Thread Avraham Serour
I feel your pain, once I had to deploy a django project on windows, after trying many different options I installed cygwin and form there nginx+uwsgi like any other normal person. Today microsoft have WSL, I think you may use that too, you can still use IIS to route traffic and forward the http

Re: How to delete least recently used not expired django sessions?

2018-08-20 Thread Avraham Serour
maybe something like this could be useful for your use case: https://pypi.org/project/django-session-timeout/ it has an option for SESSION_EXPIRE_AFTER_LAST_ACTIVITY maybe this could also be useful for you: https://django-session-security.readthedocs.io/en/latest/ On Mon, Aug 20, 2018 at 8:34

Re: django wamp

2018-07-08 Thread Avraham Serour
yes, it is possible. You are correct, they need to listen to a different port On Sun, Jul 8, 2018 at 9:24 AM Gerald Brown wrote: > Is it possible to run 2 servers (Apache & Nginx) on the same system? > > Maybe if they listen on different ports i.e. 80 & 81 > > On Sunday, 08 July, 2018 01:09

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

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 > >

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

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

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

Re: Django blocking on writing logs

2018-04-10 Thread Avraham Serour
port to 8080 > the same problem > > 2018-04-09 20:27 GMT+01:00 Avraham Serour <tovm...@gmail.com>: > >> 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-dj

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. >

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

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

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

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

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 > >

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

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

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

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 >

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

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

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

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,

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 <tkad...@yandex.com> wrote: > Hi Avraham > > On Tuesday, 23 January 2018 17:18:19 UTC-5, Avraham Serour wrote: >> >> Did you

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 < >

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

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

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

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

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: 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,

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

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

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

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

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: Big data

2017-09-29 Thread Avraham Serour
That doesn't sound that big. Maybe you can tune mysql, but I have worked with postgres handling more than that, it works fine without tuning, I changed a couple of settings (like work_mem) and improved On Fri, Sep 29, 2017 at 4:48 AM, Larry Martell wrote: > I am taking

Re: submit form as superuser vs regular user

2017-09-19 Thread Avraham Serour
not sure if related, but the docs suggest to inherit from AbstractUser, not User https://docs.djangoproject.com/en/1.11/topics/auth/customizing/ On Mon, Sep 18, 2017 at 12:58 PM, Danae Vogiatzi wrote: > In my django app I have a Myuser(User) class. It inherits the User

Re: Install uWSGI on cygwin

2017-09-13 Thread Avraham Serour
try using pip: 'pip install uwsgi' On Wed, Sep 13, 2017 at 11:35 AM, Dick Pan wrote: > Hi, > > When I install uWSGI on cygwin by command: python2.7 uwsgiconfig.py > --build > > one strange problem occur, undefined reference to `uuid_generate' on > cygwin. > but uuid.h

Re: regarding virtualenv and python version 3.5 or 3.4 or other versions

2017-08-16 Thread Avraham Serour
teError: module 'importlib._bootstrap' has no attribute > 'SourceFileLoader' > --- > > > and i tried to upgrade the pip3 and still the same error. > > Please help to figure it out. > > Thanks > > Ross > > > > On Sunday, August 13, 2017 at 8:1

Re: regarding virtualenv and python version 3.5 or 3.4 or other versions

2017-08-13 Thread Avraham Serour
I suggest using 3.6, which is the current stable release if your machine or the server doesn't have this version installed you may compile it yourself and create the virtualenv for the project from there There are some projects that help you with that, I like pythonz

Re: deploying on windows

2017-08-12 Thread Avraham Serour
I had to deploy django on windows once, after trying some different options I ended up installing cygwin and compiling uwsgi and nginx inside cygwin. Bonus you can use the same scripts to manage, you can ssh to the machine and run bash You could also try WSL, which is the same as cygwin but new

Re: Multiple DB - Accessing another app's table/model?

2017-07-18 Thread Avraham Serour
import the Model and query it. from appB.models import Table Table.objects.all() On Tue, Jul 18, 2017 at 6:01 PM, miguel vfx wrote: > Hello, > > After following through the documentation, I was able to query data from > another database. However, I was only able to access

Re: What Way is best to extend User in Django 1.11?

2017-07-18 Thread Avraham Serour
I suggest creating a profile, leave the auth.User only for auth, all else specific to you application use your own model and reference to that On Tue, Jul 18, 2017 at 9:48 AM, 李余通 wrote: > How to extend User?I find many ways; > 1. Use Profile > eg: > > class

Re: Use one correspondig database user for each application user

2017-07-11 Thread Avraham Serour
Where would you store the password hashes? This would mean that no data ever could have relations between users On Tue, Jul 11, 2017 at 12:40 PM, guettli wrote: > I guess most applications have exactly one database user. > > Why not use one database for each application

Re: Django-oscar ModuleNotFoundError 'apps\\checkout'

2017-07-06 Thread Avraham Serour
│ └───frobshop > │ └───__pycache__ > └───requirements > > On Thursday, July 6, 2017 at 10:03:04 AM UTC+2, Avraham Serour wrote: >> >> The double backslash is probably because you are on Windows >> >> Can you post your directory structure? >> >> You may

Re: Django-oscar ModuleNotFoundError 'apps\\checkout'

2017-07-06 Thread Avraham Serour
The double backslash is probably because you are on Windows Can you post your directory structure? You may try printing the cwd on settings.py to see what the relative path should be On Jul 5, 2017 9:10 PM, "Bernard Oosthuizen" wrote: > I am trying to *fork* one of

Re: Deprecating model field (Deleting model field, but keeping DB column)

2017-07-05 Thread Avraham Serour
r to change the RemoveField operation > into the custom DeprecateField operation. It would be great if > makemigrations created the correct operations automatically. Is there a way > to do that? > > On Wednesday, July 5, 2017 at 7:27:22 AM UTC-4, Avraham Serour wrote: >>

Re: Deprecating model field (Deleting model field, but keeping DB column)

2017-07-05 Thread Avraham Serour
you can remove the field and don't run migrations until you are ready to actually remove the column, or you may run migrations fake and leave the column there forever https://docs.djangoproject.com/en/1.11/ref/django-admin/#cmdoption-migrate-fake On Wed, Jul 5, 2017 at 6:39 AM,

Re: django webframework

2017-07-04 Thread Avraham Serour
I recommend against trying to make python run inside the JVM, specially if you are not familiar with python. Just use the normal python 3.6 and be happy On Mon, Jul 3, 2017 at 5:33 PM, Vinicius Assef wrote: > Hi Arun. > > Certainly you can learn Python and Django at the

Re: Need to connect to django test database from out side of django(celery worker)

2017-06-27 Thread Avraham Serour
nected to by the > django testing code. > > > > On Monday, June 26, 2017 at 9:42:50 AM UTC-7, Avraham Serour wrote: >> >> I don't think you need to create a custom TestRunner, I believe it would >> be enough to use setUp and tearDown to start and stop an external

Re: Need to connect to django test database from out side of django(celery worker)

2017-06-26 Thread Avraham Serour
ry- >> use-djangos-test-database-without-task-always-eager >> >> But couldn't figure out how to implement/do the Advanced: Step 3 that is >> suggested there. >> >> >> >> On Thursday, June 22, 2017 at 11:44:23 AM UTC-7, Avraham Serour wrote: >>> >>> Any s

Re: Need to connect to django test database from out side of django(celery worker)

2017-06-22 Thread Avraham Serour
Any special reason you are not using eager=true for celery under test? On Jun 22, 2017 7:17 PM, "sarvi" wrote: > > Can someone help me with how can I get my celery worker process(standalone > app outside of djanog) to talk to a django test database ? > > I am trying to test

Re: Legitimate way to allow uploading of folders

2017-06-22 Thread Avraham Serour
The server can accept files, the frontend may allow the user to select a folder and send multiple files On Jun 22, 2017 8:32 PM, "Mandeep Tondak" wrote: > As per my experience we can not upload folder but we can upload zip folder > to server. You can unzip that folder and

Re: New functionalities expected in Django 2.

2017-06-13 Thread Avraham Serour
https://docs.djangoproject.com/en/dev/releases/2.0/ On Tue, Jun 13, 2017 at 7:49 AM, Rohan Purekar wrote: > Is django 2 going to have inbuilt package for creating API's to cater to > ajax requests and JSON responses for which we use DRF. Another thing which > was on my

Re: Django+Haystack+Elastic issue

2017-05-24 Thread Avraham Serour
it sounds like elastic is paginating, did you check that? On Tue, May 23, 2017 at 12:41 AM, Nick Gilmour wrote: > Hi all, > > > > I'm following an example to setup Django with Haystack and ES from here: > >

Re: Most efficient and scalable search strategy

2017-05-24 Thread Avraham Serour
take a look at the postgres fulltext search capabilities, I can't make any promises for your old postgres version another common approach is to index the search into elasticsearch and querying elasticsearch for the searches, it should handles misspellings and return the search results fast, but

Re: Multiplex results from (Django-Channels)

2017-04-27 Thread Avraham Serour
You should just get the room object attribute you need, like name or id, instead of concatenating the whole object On Apr 27, 2017 5:26 AM, "Yarnball" wrote: > I do appreciate the bit of direction youve provided. And if you're asking > to be paid, then sorry but I'm working

Re: Alternative to celery

2017-04-20 Thread Avraham Serour
try googling 'python task queue' see https://www.fullstackpython.com/task-queues.html On Thu, Apr 20, 2017 at 12:25 PM, Andréas Kühne wrote: > I don't know anything about the python-rq stuff - however redis can be > configured to save to disk (see

Re: How to get a mentor

2017-04-04 Thread Avraham Serour
Hi, I suggest going to local meetups, you may meet people that could mentor or help you on specific issues, or help you to find a mentor, they could either know someone or know of local mentorship programs. Where are you located? On Tue, Apr 4, 2017 at 4:26 PM, Joe Landrigan

Re: Login/Logout, single instance only

2017-04-03 Thread Avraham Serour
You could probably have a custom session management to only have one session per user, when a user log in you can invalidate all the other user sessions On Mon, Apr 3, 2017 at 11:30 AM, miguel vfx wrote: > Good day! I was wondering if there's a way to limit a user account

Re: Is it possible to write generic module?

2017-03-27 Thread Avraham Serour
yes, table name can a parameter to your function what do you mean by "import this table"? On Mon, Mar 27, 2017 at 3:41 PM, Det S. Pillner wrote: > Hi all, > > I work on tools for my job based on Django 1.8.17. In different projects > (with different databases) I use same

Re: , received 404

2017-03-23 Thread Avraham Serour
Do you really have to use Apache for any reason? If not I recommend using nginx+ uwsgi to deploy django, the killer feature that convinced me to leave Apache was the simpler config file nginx have. There are plenty of tutorials on how to deploy django like this, if you don't find anything

Re: Testing a Django library

2017-03-21 Thread Avraham Serour
What are the different approaches you found? I created a simple minimal project inside the tests folder On Mar 21, 2017 9:59 PM, "bobhaugen" wrote: > Very interesting topic. We will be facing the same problem soon, and will > hope to learn from your experience. Got a

Re: Updating files without web server restart

2017-03-13 Thread Avraham Serour
you may use uwsgi and tell uwsgi to gracefully reload, it won't even close any eventual tcp sockets, they will wait until the new code is loaded, users will never now you reloaded the application On Mon, Mar 13, 2017 at 3:25 PM, Thiago Parolin wrote: > We have a small

Re: Channels - slow with limited number of connections

2017-03-05 Thread Avraham Serour
I don't think you need 500 workers, the number of workers depends on how long will message will take to be processed not the number of concurrent connections. The worker job is to get a message and send to a bunch of clients, the ASGI server, meaning the process actually holding the websocket, in

Re: Web-based Voting System for our capstone project

2017-02-01 Thread Avraham Serour
I recommend instead of tweaking the admin app to just making your own dashboard template. You can start learning django by doing the official tutorial at djangoproject.com On Tue, Jan 31, 2017 at 2:44 PM, Genaro Lubong wrote: > I just want to ask, how can I customize my

Re: Wiring django-channels to html without javascript?

2017-01-29 Thread Avraham Serour
Yes, the client application connecting to the websocket server can be an user using an interactive console, a python application or any other software in any language. But if your objective is to have a webpage then no, unfortunately web browsers can only run javascript, if you really dislike

Re: Django channels on IIS

2017-01-26 Thread Avraham Serour
if you are stuck on windows but not necessarily IIS you may try cygwin, I once had to deploy on windows and after investigating some possibilities I just installed cygwin and put nginx with uwsgi. On Thu, Jan 26, 2017 at 9:55 AM, Алексей Кузуб wrote: > Thank you for your

Re: Django channels, running uwsgi and awsgi

2017-01-19 Thread Avraham Serour
I think you can do conditionals on your server block and proxy pass to the correct upstream depending on your logic On Thu, Jan 19, 2017 at 2:18 PM, Dev App wrote: > There's not individual documentation for every situation because people's >> choice of webserver and

Re: Access Celery's subprocess in my Django app

2017-01-14 Thread Avraham Serour
Hi, In my opinion the celery task should just write to the DB the relevant data, no need to pass around and reprocess just to write the relevant data from the result, the celery task can just import the django model and save directly to the DB. Usually you don't need to set the

Re: Migration issue on Webfaction

2017-01-05 Thread Avraham Serour
> which to my understanding is saying that migration 0033 is looking for content within migration 0032, which it can't find. yes, check that you committed the file, I've had this kind of error too many times just because after creating the migration I forgot to git add If you removed your

Re: Dynamic Models

2017-01-05 Thread Avraham Serour
name. >> >> >> On Thursday, 5 January 2017 17:33:07 UTC+2, Guilherme Leal wrote: >>> >>> My idea was to build an user interface for the model definition, so the >>> developer (or in this case, the user) could define the model using a >>> r

Re: Dynamic Models

2017-01-05 Thread Avraham Serour
I guess you could play with metaclasses and generate the class definition on runtime using information from the database But why? You can save the model definition on files, why saving them to database and complicate your life? On Wed, Jan 4, 2017 at 10:38 PM, Guilherme Leal

Re: good pratices to write many lines on database

2017-01-04 Thread Avraham Serour
can you elaborate on this scenario? how and why can your database shutdown? I second the suggestion about returning error and telling the client to try later, but it should be >=500 not 400. 4xx Are for client errors, 5xx are for server errors. see

Re: request.read() is empty in POST

2017-01-04 Thread Avraham Serour
e feeling bad with it, sorry, but I have to give value to my > clients, not lose my time with children complaining because I gave up with > a product that can't attend me. > > Wont you point a solution instead of being a crying baby? > > > Em quarta-feira, 4 de janeiro de 2017

Re: DateField default value in SQLite and Postgres

2017-01-04 Thread Avraham Serour
te: > I use SQLite locally for development and Postgres in production. So when > my migration runs fine locally I expect it to also work fine when I upload > it 5 minutes later and try to apply it to my Postgres database. > > > On Wednesday, January 4, 2017 at 3:59:52 PM UTC+1, Av

Re: request.read() is empty in POST

2017-01-04 Thread Avraham Serour
That's an incredibly childish response and I hope future people trying to learn python or django don't give up upon a roadblock, any future people reading this don't ever feel that you are helpless, the community has many resources to help including this mailing list. Sometimes it is difficult to

Re: DateField default value in SQLite and Postgres

2017-01-04 Thread Avraham Serour
gt; > > On Wednesday, January 4, 2017 at 1:02:07 PM UTC+1, Avraham Serour wrote: >> >> Well this is the reality right now, if you think the framework is acting >> wrong you may file a bug report. >> >> In my opinion the wrong side of the equation is you, the framework

Re: DateField default value in SQLite and Postgres

2017-01-04 Thread Avraham Serour
nt. Maybe > the migrations engine should always force a datetime object (or at least a > -MM-DD notation) to make it work consistently on all backends. > > > On Wednesday, January 4, 2017 at 11:35:38 AM UTC+1, Avraham Serour wrote: >> >> DateField is a representation of

Re: DateField default value in SQLite and Postgres

2017-01-04 Thread Avraham Serour
ep_value > return self.to_python(value) > File "/webapps/mzg/venv/lib/python3.5/site-packages/ > django/db/models/fields/__init__.py", line 1250, in to_python > params={'value': value}, > django.core.exceptions.ValidationError: ["'17/06/2017' waarde heeft e

Re: DateField default value in SQLite and Postgres

2017-01-03 Thread Avraham Serour
please post your migration file and the error On Tue, Jan 3, 2017 at 12:00 PM, wrote: > I recently set a default value in my local date format on a DateTimeField > while I was using SQLite. The migration ran fine on my SQLite dev database, > but when trying to apply the

Re: can anyone tell django deployment process with apache, mod_wsgi using aws ec2 hosting requirements

2017-01-03 Thread Avraham Serour
https://www.digitalocean.com/community/tutorials/how-to-serve-django-applications-with-uwsgi-and-nginx-on-ubuntu-16-04 On Tue, Jan 3, 2017 at 1:58 PM, chowdam1992 wrote: > So i can thankfull. > > -- > You received this message because you are subscribed to the Google

Re: Just added Python, Django and MySQL integration template for easier data visualization with AnyChart JS

2016-12-29 Thread Avraham Serour
I have no idea what anychartjs does, in any case I don't understand why a js lib would need django integration. Also it seems they have no idea what they are doing, the guthub repo linked has .pyc files commited, anyone needing to use don't copy paste code from there and take it with a kilo of

Re: Define Django Base Model Class

2016-12-28 Thread Avraham Serour
You could monkeypatch django to accomplish this, but I would advise against it. Instead of having implicit or hidden behaviour you should instruct your developers to use from myproject import models instead of from django.db import models On Wed, Dec 28, 2016 at 7:13 PM, Guilherme Leal

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: >

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

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).

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

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.

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: 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

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

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

Re: Opinions on permissions stategy

2016-12-14 Thread Avraham Serour
t; always rule that situation? > > The object's "floor" is important. > > -- > Vinicius > > > On Tuesday, 13 December 2016, Avraham Serour <tovm...@gmail.com> wrote: > >> Hi, >> >> Thanks for taking your time on this. >> >> > Co

Re: Opinions on permissions stategy

2016-12-12 Thread Avraham Serour
:34 AM, Vinicius Assef <vinicius...@gmail.com> wrote: > Considerations follow inline... > > On 11 December 2016 at 03:34, Avraham Serour <tovm...@gmail.com> wrote: > > ... > > > > So should I check the parent object permissions? or just checking the

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

  1   2   3   4   5   >