Re: Error uploading images

2016-07-02 Thread Vijay Khemlani
The typical problem is forgetting to add the enctype='multipart/form-data' attribute to the form tag On Sat, Jul 2, 2016 at 9:40 PM, Lee Hinde wrote: > Using django-storages to put user uploaded files on s3. > > Uploading images in the shell works fine. So, I assume I've got > django-storage

Re: Slow Django dev server reload

2016-07-04 Thread Vijay Khemlani
How many models are there in your project? On Mon, Jul 4, 2016 at 3:46 AM, Hildeberto Mendonça wrote: > Isn't it related to the amount of migration files in your project? > > On Mon, Jul 4, 2016 at 9:13 AM, Babatunde Akinyanmi > wrote: > >> This is a punch in the dark. It takes about 3 - 5 sec

Re: Slow Django dev server reload

2016-07-04 Thread Vijay Khemlani
Why... are you answering questions directed to Krishna? You are not the one with the slow loading server. On Mon, Jul 4, 2016 at 4:19 PM, Fred Stluka wrote: > Krishna, > > I'm using: > - Mac OSX 10.11.5 (El Capitan) > - 2.3GHz Intel Core i7 > - 16 GB 1333 MHz DDR3 > - 512GB SSD > - Python 2.7.3

Re: Any one tried of Django Postgres with Ngnix?

2016-07-14 Thread Vijay Khemlani
nginx + uwsgi + postgres here On Thu, Jul 14, 2016 at 10:43 AM, Rafael E. Ferrero < rafael.ferr...@gmail.com> wrote: > YES, I do !! > > > Rafael E. Ferrero > > 2016-07-14 11:16 GMT-03:00 : > >> >> Any one tried of Django Postgres with Ngnix? >> >> -- >> You received this message because you are

Re: django 1.9, migrations SUCK

2016-07-29 Thread Vijay Khemlani
File "/home/ariatel_web/dashboard.ariatel.com.co/apps/did/forms.py", line 12, in BuySearchForm country = forms.ChoiceField(choices=[ (d.country_name, d.country_name) for d in DidCountry.objects.filter(is_active=True) ], required=False) Theres your problem, you are trying to query the databas

Re: beginner . problem simple form.

2016-08-22 Thread Vijay Khemlani
Also, why do you have two form tags in your html? On Sun, Aug 21, 2016 at 10:40 AM, ludovic coues wrote: > Do you have any message in the console where you run "python manage.py > runserver" ? > > 2016-08-21 12:16 GMT+02:00 Jordi Fernandez : > > hi, > > > > I have my firts application django it'

Re: A Backup Model in Django?

2016-10-16 Thread Vijay Khemlani
For starters, why are you trying to backup a model to the same database instead of just dumping the whole database? On Sun, Oct 16, 2016 at 10:02 AM, Andromeda Yelton < andromeda.yel...@gmail.com> wrote: > I've found myself in the situation of needing to copy model data to new > model instances.

Re: Tutorial part 3 help: bulleted-list

2016-10-18 Thread Vijay Khemlani
You wrote "latest_quesion_list" in the context dictionary key, it should be "latest_question_list" On Tue, Oct 18, 2016 at 3:00 PM, Johnny McClung wrote: > I have gotten down to the part where the tutorial reads "Load the page by > pointing your browser at “/polls/”, and you should see a bullete

Re: Django can't find database

2016-10-22 Thread Vijay Khemlani
Can you connect to the database via command line? psql -U gary -d archivedb On Sat, Oct 22, 2016 at 3:48 PM, Jamie Lawrence wrote: > > > On Oct 22, 2016, at 11:35 AM, Gary Roach > wrote: > > > When I try to migrate, I get the following error: > > > >> psycopg2.OperationalError: FATAL: databa

Re: Updating mixin subclassed instances

2016-11-01 Thread Vijay Khemlani
You could use a metaclass to keep track of all the classes that inherit from a given one, in a pure Python way it would be something like this class PluginMeta(type): # we use __init__ rather than __new__ here because we want # to modify attributes of the class *after* they have been #

Re: How to delete a certain model instance in django after a given date

2016-11-05 Thread Vijay Khemlani
You could write a management command https://docs.djangoproject.com/en/1.10/howto/custom-management-commands/ and execute it regularly (for example using a cron job) On Sat, Nov 5, 2016 at 3:31 PM, YOGITHA A N wrote: > So here are my models: > > * class Mess(models.Model):* > muser =

Re: Django first example needs minor but significant improvement?

2016-11-06 Thread Vijay Khemlani
All the paths in that documentation are relative to the path of the project: polls/views.py polls/urls.py etc and at the beginning of the page it even shows the file tree mysite/ manage.py mysite/ __init__.py settings.py urls.py wsgi.py Also there are on

Re: Best practices for directories in which to store stuff in production

2016-11-09 Thread Vijay Khemlani
I prefer to keep everything in /home (at least the virtualenv, project code, settings and logs), that way you don't need special permissions to modify those files and it is more or less separated from the system files. static and media files in Amazon S3 Caching... I used memcached, so I have no

Re: How to access Django data with the field name in text?

2016-11-14 Thread Vijay Khemlani
If I understood it correctly, you might want to do it like this setattr(att, "fname", "value_to_be_set") and to get the value first_name = getattr(att, "fname") On Mon, Nov 14, 2016 at 8:38 AM, rmschne wrote: > I have a extracted all the field names from a Django model into a list > called "f

Re: Template Data

2016-11-18 Thread Vijay Khemlani
In your model a contact may have multiple phone numbers (multiple Contactnumber instances with foreign key to the same Contact instance) so your question is a bit vague. If you wanted to list all numbers for a given contact you could do somethinkg like {% for contact in practice.contacts.all %}

Re: Template Data

2016-11-18 Thread Vijay Khemlani
> What other infromation would you need to further advise me. > Thanks > > On 18 November 2016 at 13:42, Vijay Khemlani wrote: > >> In your model a contact may have multiple phone numbers (multiple >> Contactnumber instances with foreign key to the same Contact instance) so

Re: Django Migration Error in Heroku, but migrate correctly in heroku local

2016-12-03 Thread Vijay Khemlani
If you are versioning your migration files (most liketly) then you don't have to run makemigrations in the server again. On Fri, Dec 2, 2016 at 11:55 PM, zhangdb7 wrote: > Python 3.5, Django 1.10.3, Sqlite > I have deployed a django app in heroku.It ran without errors before. One > day I make so

Re: Compiling CSS to one single CSS file

2016-12-18 Thread Vijay Khemlani
django-compressor does the job On Sun, Dec 18, 2016 at 7:08 AM, ludovic coues wrote: > Yes, collectstatic copy static files scattered inside all your apps > inside a single directory. This make it easier to serve the files > directly from your apache or nginx or a different server from the one >

Re: validate_email returns None for any or format

2016-12-20 Thread Vijay Khemlani
As far as I know validators don't return anything, just raise an Exception if the parameters don't validate On Tue, Dec 20, 2016 at 10:28 AM, NoviceSortOf wrote: > > Why does validate_email return None irregardless of what is typed in? > > >>> from django.core.validators import validate_email >

Re: Erroneous links in my URLs - all load the home page -- not a 404 or other error.page

2016-12-21 Thread Vijay Khemlani
show your urls.py On Wed, Dec 21, 2016 at 10:43 PM, NoviceSortOf wrote: > > URLs not defined in my urls.py all show my home page and not a 404 missing > page error. > > For instance > > www.mysite.com > Naturally shows my home page. > > www.mysite.com/catalogs > Shows the downloadable catalogs >

Re: Erroneous links in my URLs - all load the home page -- not a 404 or other error.page

2016-12-22 Thread Vijay Khemlani
tml")), > (r'^about.htm/$', TemplateView.as_view(template_name= > "about.html")), > (r'^contactus.htm/$', TemplateView.as_view(template_name= > "contactus.html")), > (r'^subjectslst/$', TemplateView.as_view(temp

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

2016-12-22 Thread Vijay Khemlani
https://sqlite.org/whentouse.html SQLite is not directly comparable to client/server SQL database engines such as MySQL, Oracle, PostgreSQL, or SQL Server since SQLite is trying to solve a different problem. Client/server SQL database engines strive to implement a shared repository of enterprise

Re: Form Validation Error NOT Raised When Form Is Submitted

2016-12-22 Thread Vijay Khemlani
I'm not following If you submit the form with incorrect information (non unique email) then your view does not return anything because form.is_valid() returns False Validation errors don't prevent the form from being submitted, they prevent the form from validation (making form.is_valid() return

Re: Form Validation Error NOT Raised When Form Is Submitted

2016-12-22 Thread Vijay Khemlani
t; > Or, if I use an invalid email format, I get the same popup error saying > "Please Enter An Email Address." > > Is there a way to do this with this (with django)? > > On Thursday, December 22, 2016 at 9:30:22 PM UTC-5, Vijay Khemlani wrote: >> >> I&#x

Re: Advise for first project in Django

2016-12-23 Thread Vijay Khemlani
Yes, it is feasible As a starting project i find it a bit too complicated, at least the listening online part On Fri, Dec 23, 2016 at 12:39 PM, imed chaabouni wrote: > Hello, > > > I am a Tunisian novice developer, and I am about to make my first project > in Django this year after studying Pyt

Re: Define Django Base Model Class

2016-12-28 Thread Vijay Khemlani
That doesn't change the advise I would find it weird to import a class only to have something else loaded https://www.python.org/dev/peps/pep-0020/ "Explicit is better than implicit." On Wed, Dec 28, 2016 at 3:02 PM, Guilherme Leal wrote: > Got it. > > The custom model doesn't have any signi

Re: Deploying a Django App on GitHub Pages with the aid of Firebase

2017-01-02 Thread Vijay Khemlani
Github pages is only for static files, so no, unless your application only consists of static html files (in which case you woudn't be using django) On 1/2/17, Mostafa Elgayar wrote: > Is it possible to deploy a Django Application on GitHub pages, by having > the backend on Firebase for example a

Re: request.read() is empty in POST

2017-01-03 Thread Vijay Khemlani
Yeah, because hitting a roadblock only happens in Django Why are you trying to read the request directly? django parses it in request.body, request.GET, request.POST, request.FILES, etc https://docs.djangoproject.com/en/1.10/ref/request-response/ On 1/4/17, Flávio Cardoso wrote: > Wow, that's s

Re: Facing performance issue bcoz of db data

2017-01-04 Thread Vijay Khemlani
A poorly optimized query or a query that returns too many results (too many as un hundrends of thousands), but it doesn't make sense to execute a query that large in a request / response cycle. Or too many subsequent queries after the original one Without more information it's kinda hard to tell

Re: good pratices to write many lines on database

2017-01-05 Thread Vijay Khemlani
You could queue the tasks in a broker (rabbitmq for example) and use a fixed number of celery workers to process them and save them to the database, assuming: - you don't have 1000 requests per second all the time - you don't need the data to be stored immediately On 1/4/17, Avraham Serour wrote

Re: Facing performance issue bcoz of db data

2017-01-05 Thread Vijay Khemlani
alues pairs. > > > Best Regards, > Anjali > > On Wed, Jan 4, 2017 at 6:35 PM, Vijay Khemlani wrote: > >> A poorly optimized query or a query that returns too many results (too >> many as un hundrends of thousands), but it doesn't make sense to >> execute

Re: Use case for ALLOWED_HOSTS

2017-01-05 Thread Vijay Khemlani
To prevent Host header poisoning https://www.djangoproject.com/weblog/2013/feb/19/security/#s-issue-host-header-poisoning On 1/5/17, Antonis Christofides wrote: > If Django is listening at http://mydjangoproject.com/, then the web server > is > normally configured to proxy pass mydjangoproject.c

Re: Dynamic Models

2017-01-05 Thread Vijay Khemlani
I had to implement dynamic models for our project. In the end we represented them in four django models, two for the "virtual models" and its fields and two for the actual data We used the django model system for these four base classes, but the "virtual models" on top of them were custom (so no

Re: Dynamic Models

2017-01-05 Thread Vijay Khemlani
"That was exacly the points i'm willing to avoid. Had any problems with the metaclass approach? Why did you chose the "virtual model" concept?" We had to represent multiple product categories, each with their own structure and particular fields. In the end we had around 700 virtual models, which

Re: data must be QuerySet-like (have count() and order_by()) or support list(data) -- NoneType has neither

2017-01-08 Thread Vijay Khemlani
At least by looking at the source code https://github.com/bradleyayers/django-tables2/blob/master/django_tables2/views.py It seems you need to have a "table_data" attribute, or a "object_list" attribute, or define a "get_table_data" method in your class On 1/8/17, Ali khan wrote: > I am using D

Re: Are we ever meant to make a totally new python module in our app?

2017-01-08 Thread Vijay Khemlani
Using urls.py and views.py as names is not mandatory in the app, the "urls.py" is referenced in the urls.py of the project, and can have any name you want, but these are convention names and useful for other people reading your code models.py is a tad more special because models need to be auto di

Re: data must be QuerySet-like (have count() and order_by()) or support list(data) -- NoneType has neither

2017-01-11 Thread Vijay Khemlani
n example the way you proposed. > Its also surprising for me that in Django Users group so little people > contribute to solving issues. > > Thanks Vijay for your response at the first place. > > Regards, > Ali > > On Sun, Jan 8, 2017 at 7:53 AM, Vijay Khemlani wrote:

Re: Get current site inside model

2017-01-13 Thread Vijay Khemlani
You would need to pass it as argument, or set a default Site, otherwise it doesn't make sense For example, when calling the method from the shell (not a web request) what will you expect it to return? On 1/13/17, Max wrote: > Hi, guys. I want to get absolute url for Model with domain based on re

Re: Get current site inside model

2017-01-13 Thread Vijay Khemlani
e template itself {{ domain }}{{ ob.get_absolute url }} where the absolute url is something like '/model/5' or something like that, without the domain. On 1/13/17, Max wrote: > Vijay Khemlani, i think my question have not a lot of details. More > 1) Django site framework (w

Re: Get current site inside model

2017-01-13 Thread Vijay Khemlani
I'm not gonna start on the "cool" part You could generate the urls on the view and pass them already generated to the template On 1/13/17, Max wrote: > {{ domain }}{{ ob.get_absolute url }} - is not cool , i set site with > context proccesor for domain > > Once again, if you don't have a default

Re: Need help with a school project

2017-01-14 Thread Vijay Khemlani
Read the tutorial I guess https://docs.djangoproject.com/en/1.10/intro/tutorial01/ After that handling form data and saving to the databse should be trivial On 1/14/17, Grant Holman wrote: > I need help starting a django project for a school project. I am brand new > to Django but have some exp

Re: Am I stupid or is there an essential error in Django 1.10 Docs?

2017-01-17 Thread Vijay Khemlani
The only "custom include" in Django is for loading other url files The rest of the imports are typical Python module / packages On 1/17/17, 'Peter Müller' via Django users wrote: > Ah I now see the problem. However I tried to remove the entry in the > __init__.py file > Python is then unable to

Re: What is the best library for Facebook social auth?

2017-01-18 Thread Vijay Khemlani
I like django-allauth http://django-allauth.readthedocs.io/en/latest/ On 1/18/17, christina zou wrote: > Hi, > > I am new to Django and web development in general. I am trying to > incorporate facebook social auth into django. I assume this is a common > need for which there is a well supported

Re: urls with https and s3:// as parameters

2017-01-19 Thread Vijay Khemlani
Shouldn't the paths be passed as GET or POST arguments instead of part of the URL path? Why would you need the regex then? On 1/19/17, Ramon Ramirez-Linan wrote: > Hi > > I am building a django app which urls take 2 parameters a source and > destination. > The source is either a url for a file ht

Re: How to resole Integrity Error caused by NOT NULL

2019-03-09 Thread Vijay Khemlani
Your assign should be new_material_review.material = material_instance instead of new_material_review.material_instance = material_instance that you have now On Sat, Mar 9, 2019 at 4:29 AM Chukwunonso Nwankpa wrote: > Good Morning. > I'm new to django and currently using the framework for a

Re: Guardar many to many Django

2019-04-13 Thread Vijay Khemlani
Esta línea Articulo_Consolidacion.objects.create(articulo=articulo_data,tagicNone, tono=array_tono, tema__id=None) No tiene mucho sentido (que es tagicNone?, de donde sale arrary_tono? no estas usando tag_list ni tema_list...) Ademas en tu modelo el campo "articulo" de "ArticuloConsolidacion" es

Re: File not getting uploaded

2019-04-17 Thread Vijay Khemlani
In your HTML, the form tag should have an enctype ... On Wed, Apr 17, 2019 at 2:36 AM Aakash Baranwal wrote: > Sorry, the image file wasnt uploaded. > > > > On Wed, Apr 17, 2019 at 12:04 PM Aakash Baranwal > wrote: > >> Hi Everybody, >> >> I am trying to upload a file, but it says "No file c

Re: File not getting uploaded

2019-04-17 Thread Vijay Khemlani
Vijay, > > You are right, but he has mentioned that it gets uploaded when logged in > as admin. Will it be a different template for the same view? Just > wondering... > > @Aakaash: can you please check in both cases and confirm please > > Regards, > Ramsundar > > &

Re: Existing database for users to use django user auths

2019-06-05 Thread Vijay Khemlani
Yes, you can write your own Authentication Backend with your custom authentication logic https://docs.djangoproject.com/en/2.2/topics/auth/customizing/ On Wed, Jun 5, 2019 at 8:53 AM michael ababao wrote: > I am new to django and i would like to know if it is possible to use the > django user a

Re: Redireccionamiento

2019-07-10 Thread Vijay Khemlani
No hay ningun JavaScript interceptando los links en tu pagina? On Tue, Jul 9, 2019 at 10:23 PM samuel lopez wrote: > Tengo un problema con los links y es que todo está bien internamente osea > los tags, urls, views y todo, pero cuando le doy click al botón o al enlace > del nav o cualquier otro,

Re: Model forms

2017-01-24 Thread Vijay Khemlani
Crispy forms is also good http://django-crispy-forms.readthedocs.io/en/latest/ On 1/24/17, Fred Chevitarese wrote: > Hey! > > I use this app to make my job easier :P > https://github.com/dyve/django-bootstrap3 > > Just install it and follow the instructions ;) > > > Cheers! > > > > *"* > *São os

Re: Am I stupid or is there an essential error in Django 1.10 Docs?

2017-01-28 Thread Vijay Khemlani
> A quick one is e.g. that there is no explanation of what a view is and what > > its purpose is. "The code above maps URLs, as simple regular expressions, to the location of Python callback functions (“views”)" "Each view is responsible for doing one of two things: Returning an HttpResponse obje

Re: Django Debug Toolbar installation

2017-01-28 Thread Vijay Khemlani
Did you install debug_toolber on your server? pip install django-debug-toolbar On 1/28/17, Richard Jackson wrote: > Hi everyone, > > I've recently installed the Django Debug Toolbar for local use; I've just > pushed the code online and am greeted with the below error: > > [81.95.157.172] out: Tr

Re: get_or_create IntegrityError

2017-02-16 Thread Vijay Khemlani
As far as I know Postgres uses "sequences" for generating the model IDs. If you set the id manually I think you are bypassing the sequence, which doesn't autoincrement. So when you use the sequence the next time the ID clashes. pgAdmin should auto generate the id if you leave the field blank. On

Re: Having trouble with Django tutorial

2017-03-02 Thread Vijay Khemlani
Did you do this step? The next step is to point the root URLconf at the polls.urls module. In mysite/urls.py, add an import for django.conf.urls.include and insert an include() in the urlpatterns list, so you have: mysite/

Re: Having trouble with Django tutorial

2017-03-03 Thread Vijay Khemlani
How does your learning_python.urls look like? On 3/3/17, Yves S. Garret wrote: > Yes. > > On Thursday, March 2, 2017 at 11:09:58 AM UTC-5, Vijay Khemlani wrote: >> >> Did you do this step? >> >> The next step is to point the root URLconf at the polls.urls mod

Re: Having trouble with Django tutorial

2017-03-03 Thread Vijay Khemlani
url(r'^polls/', urls), > url(r'^admin/', admin.site.urls), > ] > > Is there a way to print out strings to indicate where the problem is? > > On Friday, March 3, 2017 at 8:35:47 AM UTC-5, Vijay Khemlani wrote: >> >> How does your learning_pyth

Re: Having trouble with Django tutorial

2017-03-03 Thread Vijay Khemlani
ves S. Garret wrote: > Is this learning_python/urls.py or learning_python/learning_python/urls.py? > > On Friday, March 3, 2017 at 10:04:32 AM UTC-5, Vijay Khemlani wrote: >> >> You should import the polls urls as it appears in the tutorial >> >> url(r'^polls/'

Re: Request for advice on refactoring a big Django project

2017-03-06 Thread Vijay Khemlani
Also, this type mailing lists are usually for specific questions about the framework "How do I make this particular query with the ORM" "Why isn't this variable getting rendered in the template" etc Your question is kinda broad On 3/6/17, Bob Haugen wrote: > Antonis, thank you very much for th

Re: Chart library for django

2017-03-06 Thread Vijay Khemlani
Rendering server-side charts is usually a mess, and the result (usually a static image) is not as good as using a JS library. I use Highcharts, just had to make a little layer on top of it to make it compatible with the JSON django was generating. It also encourages separation of concerns between

Re: Advice: count hits/pageview for high traffic website

2017-03-08 Thread Vijay Khemlani
Maybe I'm missing something, but why not Google Analytics? On 3/8/17, ludovic coues wrote: > Have you looked at an analytics solution like piwik ? > > 2017-03-08 6:40 GMT+01:00 carlos : >> Daniel, no i say i used django for a website with high traffic maybe 70k >> per >> days, but i need count vi

Re: Django queryset High CPU Usage

2017-03-10 Thread Vijay Khemlani
There is something wrong in your setup I can query a 400.000 item table in less than a second with the typical "Model.objects.all()". Django does not convert all of the entries into objects just by that query. You don't have any managers, or anything that can result in a side-effect beyond the qu

Re: Django queryset High CPU Usage

2017-03-10 Thread Vijay Khemlani
ts are created. > > But when you say not all objects are created at one go, you mean they can > be deferred? You mean the query results are stored in the memory till each > record is accessed or something using the objects? Could you please > clarify? > > Thanks. > > On F

Re: Migrations

2017-03-11 Thread Vijay Khemlani
Not really, as long as you understand what's going on and not inputting commands just for the sake of it. On 3/11/17, Mike Dewhirst wrote: > On 11/03/2017 7:17 AM, Matthew Pava wrote: >> >> Does anyone else get a migraine when working migrations? >> > > Only when I try to game them. If I follow i

Re: Django queryset High CPU Usage

2017-03-11 Thread Vijay Khemlani
Am I the only one who thinks that generating a report over a set of just 10.000 records could be done in 10 - 20 secs unless there are some serious computations going on with that data? For a report I have to query around 200.000 records, with aggregations, and it takes less than a minute using th

Re: Django queryset High CPU Usage

2017-03-11 Thread Vijay Khemlani
r the high cpu and time taken are due to the basic query ("Model.objects.all()") or the further processing of the report. It could easily be a missing "select_related" which causes thousands of joins inside a for loop. On 3/11/17, James Schneider wrote: > On Mar 11, 2017 12:0

Re: Django queryset High CPU Usage

2017-03-14 Thread Vijay Khemlani
"In the above, the CPU was hitting almost 100% and was taking almost a second" So, your query was resolved in a second, that's normal, also the spike in cpu usage because... the cpu is working... Your problem seems to be in your for loop for a in As: retrieve other related data from associa

Re: 'OneToOneField' object has no attribute 'get' in function-based view

2017-03-15 Thread Vijay Khemlani
Can you post the whole stack trace of the error? There are some things that don't make sense in the view function (for example returning "new_title" from the view) but they are not related to your initial error. On 3/15/17, Pedro Paulo Palazzo wrote: > > > I am writing a two-part form where I wa

Re: 'OneToOneField' object has no attribute 'get' in function-based view

2017-03-15 Thread Vijay Khemlani
path/to/venv/lib/python3.6/site-packages/django/core/handlers/base.py" in > _get_response 185. response = wrapped_callback(request, > *callback_args, **callback_kwargs)File > "/path/to/project/objectinfo/views.py" in object_entry 45. > object_form = Objec

Re: Django and Nginx through uwsgi is not working

2017-03-16 Thread Vijay Khemlani
Not sure if a typo on your email, but your command says "chown nginx:nginx -R /sockect/uwsgi.sock" sockect ? On 3/16/17, valerio orfano wrote: > Hi All > > i ve created a django application not using virtual environment. I ve > installed nginx and trying to integrate them via uwsgi application.

Re: Error running Django tutorial

2017-03-16 Thread Vijay Khemlani
Why is there a backslash in from django.conf.urls import polls\ ? On 3/16/17, Camilo Torres wrote: > Hi. > > You may have a strange, non-visible character in your file just before the > line giving error. > > -- > You received this message because you are subscribed to the Google Groups > "Djan

Re: Django and Nginx through uwsgi is not working

2017-03-17 Thread Vijay Khemlani
I fail to see what's so complex of uwsgi for a simple deploy, my typical configuration file has 8 lines On 3/17/17, Antonis Christofides wrote: >> Thanx you very much, i've spent days on this issue > I'm sorry to hear that, especially because when I was using uwsgi I was > also > spending days fo

Re: cannot get div to reload with ajax

2017-03-17 Thread Vijay Khemlani
And what error are you getting? The only weird thing I see at first is url: "{% url candidate_notes %}", If your JS file is a standalone file served as a static file then you have no "url" tag available inside it. On 3/17/17, Shezan Kazi wrote: > hi all, > > i am trying to reload a div that is

Re: Will function based views ever be deprecated?

2017-04-03 Thread Vijay Khemlani
Any function based view can be reduced to a CBV trivially class MyView(View): def get(request):# or post, or whatever http method Point is there are patterns that repeat themselves enough to justify CBV, aside from the benefits of using classes (inheritance, mixins, etc). Also

Re: Manage.py runserver is showing somthing else

2017-04-12 Thread Vijay Khemlani
Please copy and paste the whole stack trace (the messages on the command prompt) On Wed, Apr 12, 2017 at 3:01 PM, Divya Rajpurohit wrote: > I started learning django a few days ago & i am trying to run a example > project for a demo but when i put this command "manage.py runserver" it > show so

Re: Error with Tutorial - Writing your first Django app, part 1

2017-04-12 Thread Vijay Khemlani
In the first case he mispelled "urlpatters", it should be "urlpatterns" (notice the n) On Wed, Apr 12, 2017 at 3:47 PM, Lynn Capps wrote: > Shah, > > Did you get this figured out? I am having the same issue as you did. > > > > On Friday, December 9, 2016 at 1:50:22 PM UTC-6, shah wrote: >> >> Hi

Re: Django forks

2017-04-17 Thread Vijay Khemlani
Django is essentially a backend development framework (essentially receive http request, make http response) Ruby on Rails tried to integrate with a javascript "framework" in its time (Prototype / Scriptaculous if I remember correctly) and it exploded on their faces in my humble opinion. On Mon,

Re: Django forks

2017-04-17 Thread Vijay Khemlani
I'm not trying to scare anyone If you need particular form widgets or fields not readily available in Django I would prefer to write an app that includes them instead of forking the whole framework. On Mon, Apr 17, 2017 at 12:39 PM, Matthew Pava wrote: > Well, since web2py is in Python, you mig

Re: How to set mysql database in setting up django setup in eclipse ?

2017-04-23 Thread Vijay Khemlani
I don't use Eclipse for development, but your screenshot says "Django version 1.1 or earlier" which is awfully old, we are at 1.11, as in there was a versions 1.2 1.3 1.4 1.5 1.11. settings file has changed a lot since that time. On 4/23/17, Pubudu Goonetilleke wrote: > Hi, > I am very new

Re: Models not appearing in Admin page.

2017-04-25 Thread Vijay Khemlani
Register in in the admin.py file https://docs.djangoproject.com/en/1.11/intro/tutorial02/#make-the-poll-app-modifiable-in-the-admin On Tue, Apr 25, 2017 at 9:46 AM, Ratul Shams wrote: > Hey Pythonistas! > I was working on Django and made a Model, but its not appearing on my > Django Admin page

Re: Make a separate table for a model without additional fields

2017-05-01 Thread Vijay Khemlani
Why do you need an additional model for automatic payments? I don't know the whole project, but I would just add a field to the Payment class On 5/1/17, Victor Porton wrote: > I store into the DB payments received through PayPal. Every payment is > either manual or automatic (automatic payment

Re: makemigration detect error

2017-05-06 Thread Vijay Khemlani
You are adding a non-null field to a table, so the existing rows from that table need a value to put in it to enforce the non-null rule. If you select 1, you type that value, and it is used for all previously existing rows in the table. On 5/6/17, Er. Rv Ranga wrote: > python manage.py makemigr

Re: get method inside class based view

2017-05-07 Thread Vijay Khemlani
Assuming this view is for a path like http://example.com/shortener If you make a GET request to it (as in navigating to it in a browser) it displays the form calling the "get" method in the view. When you submit the form it usually does so to the same URL but with the POST method. So in this cas

Re: Unicode error in __unicode__(self) function

2017-05-09 Thread Vijay Khemlani
Paste the whole stack traceof the error On 5/9/17, rmschne wrote: > > >> I'm sorry - but this isn't your real error. >> >> You will see it in your WSGI daemon logs once you set DEBUG to false. >> >> >> >> This error is caused by Django trying to print the error using ascii codec >> >> for the deb

Re: null value in column violates not-null constraint

2017-05-25 Thread Vijay Khemlani
"form.instance.user" should be "form.instance.seller" But the "null value in column" error could also apply to any of the non-nullable fields in your Product model that are not set by the time you save the instance. On 5/25/17, Ismail Sarenkapic wrote: > Tnx. > The slug is not important here.

Re: Retrieve field values from ManyToMany field in model

2017-06-25 Thread Vijay Khemlani
A DocumentMetaData instance may be associated with multiple documents and multiple metadata according to your model, so your question is ambiguous. If you want a particular DocumentMetaData to only refer to a single document and a single metadata then change the ManyToManyField for a ForeignKey I

Re: ModuleNot Found Error

2017-06-26 Thread Vijay Khemlani
Could you post the stack trace of the error? On Mon, Jun 26, 2017 at 5:35 AM, akhil kumar wrote: > this is my polls/urls.py > > > from django.conf.urls import url > from . import views > > urlpatterns=[ > url(r'^$',views.index,name='index'), >] > > > > mysite/urls.py > > > from djang

Re: 'migrate' does not find existing postgres database

2017-06-26 Thread Vijay Khemlani
Maybe I'm misunderstanding, but you don't access PostgreSQL databases as normal files with a path. If you were using SQlite that might work, but not on typical SQL databases (MySQL, Postgres, etc) On 6/26/17, Rich Shepard wrote: >This is my first django project and is intended for my own use

Re: NOVICE Question; Installing Django 1.11.2 in Python 3.6 with the correct path

2017-06-27 Thread Vijay Khemlani
You should run pip from the command line, not from inside the python interpreter shell On Tue, Jun 27, 2017 at 11:25 AM, wrote: > A a Novice to Python and to Django How do i install Django into the > correct path , I followed the instruction in a Django manual and got an > error message; How do

Re: Django signals **kwargs

2017-06-27 Thread Vijay Khemlani
https://docs.djangoproject.com/en/1.11/topics/signals/#receiver-functions We’ll look at senders a bit later, but right now look at the **kwargs argument. All signals send keyword arguments, and may change those keyword arguments at any time. In the case of request_finished, it’s documented as send

Re: Django signals **kwargs

2017-06-27 Thread Vijay Khemlani
; Okk. > > But what i am actually asking is, what type of contents does the **kwargs. > Give me a typical example of **kwargs in the context of signals. The actual > data **kwargs may contain. > > Yingi Kem > > On 27 Jun 2017, at 9:24 PM, Vijay Khemlani wrote: > >

Re: django webframework

2017-07-03 Thread Vijay Khemlani
You can use Django even if you are new to Python, but it will be more difficult (basically learning 2 things at the same time). You can run a django application over tomcat using Jython and django-jython, but I've never done so myself https://docs.djangoproject.com/en/1.11/howto/jython/ On Mon,

Re: Math filter

2017-07-19 Thread Vijay Khemlani
Also I guess mathfilters just executes left-to-right so a|mul:b|add:b|mul:c is (((a * b) + b) * c) On Wed, Jul 19, 2017 at 1:50 AM, James Schneider wrote: > > > On Jul 18, 2017 7:21 PM, "sum abiut" wrote: > > Hi, > needed direction maths filters on django templates. for example how to you >

Re: Math filter

2017-07-19 Thread Vijay Khemlani
I'm guessing he's using the mathfilters package https://github.com/dbrgn/django-mathfilters On Wed, Jul 19, 2017 at 7:28 PM, Mike Morris wrote: > Of course, if they're integers you could implement the "mul" as a loop of > "add"s... clumsy, but would work. > > On 07/19/2017 03:39 PM, Mike Morris

Re: Math filter

2017-07-20 Thread Vijay Khemlani
Don't worry, I only knew about the project because I use it in a small part of an application that can't execute computations on the view On Wed, Jul 19, 2017 at 10:02 PM, Mike Morris wrote: > On 07/19/2017 06:20 PM, Vijay Khemlani wrote: > >> I'm guessing he'

Re: Dos Modelos en un formulario django

2017-07-28 Thread Vijay Khemlani
Puedes crear un formulario común y corriente de Django class Formulario(forms.Form): ... campos del usuario ... campos de sus caracteristicas Y manejar la lógica en tu vista formulario = Formulario(this.request.POST) if formulario.is_valid(): ... actualizar usuario con campos de formul

Re: Unable to extend User model and see it in Django Admin

2017-07-29 Thread Vijay Khemlani
AUTH_USER_MODEL should point to your model class, not the model admin use AUTH_USER_MODEL = 'user_text.User' Assuming that the app where the User model lives is called "user_text" On Sat, Jul 29, 2017 at 12:56 PM, Binny Zupnick wrote: > I've tried many things, but I'll write what I currently

Re: Row based permissions: In DB or App? ... farewell pain

2017-08-07 Thread Vijay Khemlani
I use django-guardian for object level permissions and it works surprisingly well On Mon, Aug 7, 2017 at 4:59 AM, Antonis Christofides < anto...@djangodeployment.com> wrote: > Hello, > > This is a tricky issue and we need to start from the basics. You already > know the basics, but they bear repe

Re: database tables are not being created

2017-08-07 Thread Vijay Khemlani
As far as I know you also need to declare the app_label for each model class Meta: app_label = 'your_app_name_here' On Mon, Aug 7, 2017 at 4:15 PM, Andréas Kühne wrote: > Ok, > > Regarding point 2 there - have you added the models to the __init__.py > file? Imported them as in: > > from .mo

Re: Row based permissions: In DB or App? ... farewell pain

2017-08-09 Thread Vijay Khemlani
https://django-guardian.readthedocs.io/en/stable/userguide/check.html#get-objects-for-user projects = get_objects_for_user(request.user, 'projects.view_project') On Wed, Aug 9, 2017 at 10:55 AM, guettli wrote: > > > Am Mittwoch, 9. August 2017 10:04:25 UTC+2 schrieb James Schneider: > >> >> >>

<    1   2   3   4   >