Unable to migrate Django migration using docker container.

2022-09-26 Thread Vijay Arora
migrations then last container overwrite the old migrations. Thank you Vijay A. -- 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-user

Re: ModuleNotFoundError: No module named 'tutorial.quickstart'

2022-09-03 Thread Vj Vijay
It should be from tutorial import views On Fri, Sep 2, 2022, 12:51 PM Pooja Kumari wrote: > Hello team, > please help me with this error. > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To unsubscribe from this group and stop receiving

Re: Why do we need Django rest framework when our conventional django do what we want?

2022-08-26 Thread Vj Vijay
Api can make your website versatilewhat I mean by that is that your website can communicate with all type of users easily with the help of API almost most of the production ready applications front end and backend are built seperately so you need API to communicate On Fri, Aug 26, 2022, 8:48

Re: Help to implement custome user login

2022-08-05 Thread vijay chourey
Even you can extend your user modle and can store your extra fields and OTP verification field. It's posible to change your email to phone based login. On Fri, 5 Aug, 2022, 7:29 pm Rinki Prasad, wrote: > Hi team , > Actually i want to implement custom model in Django Like i want that the > user

Re: Need help in User log in, someone please help

2022-02-22 Thread vijay chourey
Hi Raj, Error is showing due to the blank value in user name, please try to print username before registration if it's blank please check form fields. Once done you can directly login your account with "auth.login(request,user) On Wed, 23 Feb, 2022, 12:22 pm Antonis Christofides, < anto...@ant

/accounts/password/reset/ Exception Value: No module named 'django.shop'

2021-08-22 Thread vijay chourey
Environment: Request Method: POST Request URL: http://127.0.0.1:8000/accounts/password/reset/ Django Version: 3.1.1 Python Version: 3.6.6 Installed Applications: ['django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages',

Re: Chat Application in Django

2021-03-10 Thread vijay naudiyal
Hi Kasper, Sure I am not offended and thank you for asking that. I will be glad to share the project once completed. Regards Vijay On Thu, 11 Mar, 2021, 08:23 Kasper Laudrup, wrote: > On 11/03/2021 03.34, vijay naudiyal wrote: > > > > Pls no personal attacks. Lets keep the th

Re: Chat Application in Django

2021-03-10 Thread vijay naudiyal
to me at vijaynaudiyal...@gmail.com Have a good day. Vijay On Thu, Mar 11, 2021 at 3:53 AM Rajesh Ranjan_067 < rajeshrausan3...@gmail.com> wrote: > Dear sakshi mam may I join you, as you are doing on chat app > > On Thu, 11 Mar, 2021, 12:15 am sakshi jain, wrote: > >>

Chat Application in Django

2021-03-10 Thread vijay naudiyal
but still not sure what is the right way to do it. Any help would be appreciated. Thanks in advance. Have a nice day. Regards Vijay -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving e

Re: hello guys, help me please, I could not associate username to a post

2020-12-16 Thread vijay naudiyal
You can also try get_user(request) instead of request.user Or also self.requesr.user if you take self as argument. Let me know if it works for you Cheers Vijay On Tue, Dec 15, 2020, 23:56 Chelsea Fan wrote: > [image: image.png] > > -- > You received this message because you are s

Re: help with my signup api

2020-05-13 Thread Vijay Khemlani
in your code data is json.dumps(request.data), which is a string representation of the json dictionary so data is a str and then you are trying to do item assignment to it On Wed, May 13, 2020 at 8:05 AM ola neat wrote: > good day guys, please i need help with my signup api, when the user click

How to create user registration

2019-09-06 Thread VIJAY RAJA
How to create user registration forms -- 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-users+unsubscr...@googlegroups.com. To view this discussion on the w

Re: error in models

2019-08-05 Thread Vijay Khemlani
Remove the quotes On Mon, Aug 5, 2019 at 11:24 AM Mudasir Mian wrote: > Dear Team, > im facing this error in models > help me please > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To unsubscribe from this group and stop receiving emai

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: 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: File not getting uploaded

2019-04-17 Thread Vijay Khemlani
When he said "uploading it from there" I was not sure whether "there" meant Django's admin page or the same view that's failing now As far as I know the form has to have a multipart enctype to upload files On Wed, Apr 17, 2019 at 9:53 AM Ram sundar wrote: > Hi

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: 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: 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: "Project object has no attribute review_set"

2018-10-12 Thread Vijay Khemlani
Since the related name in the project foreign key is "review" you have to use that keyword for the related query from project, so it should be "self.review.all()" instead of "self.review_set.all()" in your Project methods. Regards! On Fri, Oct 12, 2018 at 9:25 AM Melissa Malala wrote: > Getting

Re: A questionale developer had added exraneous code to image URLS that used to work. I would be gratefuldor your assitamce please?

2018-09-09 Thread Vijay Khemlani
If you're using django-storages with S3 as the media backend then there is a setting called AWS_S3_FILE_OVERWRITE that prevents files with the same name form being uploaded. In those cases the library appends a suffix similar to your example. Usually this is useful to prevent files from being over

Re: Django performance issue that's troubling

2018-08-24 Thread Vijay Khemlani
you want to be editable by the user On Fri, Aug 24, 2018 at 2:06 PM Jim Illback wrote: > Vijay, think of this is a parent - child relationship. I have 37K parents. > Now I want to update a child of one of the parents. But, in order to have > the update work, it needs the ForeignKey t

Re: Django performance issue that's troubling

2018-08-24 Thread Vijay Khemlani
On Thu, Aug 23, 2018 at 8:19 PM Jim Illback wrote: > Vijay, you are exactly correct. Thank you much! > > Now, knowing the problem, I still don’t have a great solution. Here’s how > it is supposed to work. > > Someone chooses a client from the list or a search. All the possibl

Re: Django performance issue that's troubling

2018-08-23 Thread Vijay Khemlani
Maybe your update form has a field related to a model with thousands of records? like rendering a select combo box with thousands of choices? On Thu, Aug 23, 2018 at 5:30 PM Jim Illback wrote: > I have a Django app in development that performed perfectly with about 20 > client records. Each clie

Re: Use an external REST API in django admin

2018-07-16 Thread Vijay Khemlani
django rest framework would be your best bet http://www.django-rest-framework.org/ On Mon, Jul 16, 2018 at 10:16 AM micka wrote: > Hello, > > I wish I could use the data from an external API in the administration of > Django. I wish I could list, read, edit and create objects but instead of > u

Re: A few doubts with an implementation.

2018-07-02 Thread Vijay Khemlani
You can also use PubNub (https://www.pubnub.com/) or similar services On Mon, Jul 2, 2018 at 10:29 AM Vineeth Sagar wrote: > Mikhailo Keda wrote: >> >> to fetch emails every N minutes or hours - >> http://docs.celeryproject.org/en/latest/django/first-steps-with-django.html >> I want the user to

Re: Nested for loops in templates

2018-06-13 Thread Vijay Khemlani
As far as I know you can't do it directly in the templating system Yo could write a template tag as described here https://stackoverflow.com/questions/2894365/use-variable-as-dictionary-key-in-django-template/10700142#10700142 or use a different data structure, for example each row as a list of

Re: Interfaz administrativa, login con SSH

2018-06-12 Thread Vijay Khemlani
La máxima seguridad (razonable) sería conectarse a una VPN y que el admin de Django solo acepte logins desde dentro de la VPN, pero para el 99% de los casos suena innecesario. Para abrir un navegador dentro del servidor mismo tendrías que tener instalado todo ambiente de escritorio en el servidor

Re: Interfaz administrativa, login con SSH

2018-06-11 Thread Vijay Khemlani
"Vijay, thanks for the help, but the authentication of two factors seems quite uncomfortable, considering that an administrator can enter every day, several times a day, having to depend on a mobile device for each login. " Session cookies last for 2 weeks by default in Django, regardl

Re: Interfaz administrativa, login con SSH

2018-06-10 Thread Vijay Khemlani
En general SSH sirve para hacer conexiones remotas por terminal (bueno, puedes hacer una sesión X a través de SSH pero no creo que sea lo que necesites) La forma más común de aumentar la seguridad del login es por two factor authorization, básicamente mandar una validación a tu celular o algun otr

Re: Passing Django Template Vars to JS

2018-06-10 Thread Vijay Khemlani
I'm not sure why your code does not work (maybe there is a "race condition" between the JS click handlers), but that global variable is a bad idea in general. You can add the comment ID as an attribute to your button, like and in your event handler obtain the comment id $("#like_comment_button

Re: Problem in part 6, CSS doesn't work

2018-05-29 Thread Vijay Khemlani
That's only for production environments, for development you don't need to run that command Where did you finally put the css file and what path did you put in the tag? On Tue, May 29, 2018 at 1:46 PM Mikko Meronen wrote: > Hi, > > Thank you, but I should have those correct. > > I did some goo

Re: Managing multiple user types in Django

2018-05-15 Thread Vijay Khemlani
I would make a UserType table and have a foreign key from your user model to it, or maybe just have an enumerated type in your user model depending on how much custom logic there is to each user type. On Tue, May 15, 2018 at 11:50 AM Frankline wrote: > Hello Everyone, > > I am developing an API

Re: M2M Magic Accessors without explicit ManyToMany Field

2018-05-08 Thread Vijay Khemlani
Why would it be a muti table inheritance? I would just inherit Car (class MyCar) and add the m2m field there, seems way more explicit and easy to understand too. On Tue, May 8, 2018 at 12:18 PM Clayton D wrote: > I posted a question on SO (https://stackoverflow.com/q/50222402/1978687), > but it

Re: committing migration files

2018-04-30 Thread Vijay Khemlani
At least for me I have custom migrations (for a materialized view) so that needs to be commited, and a migration seems the most logical place to do so Also if you already have a production database and you need to execute a complex change in the data model you may need a sequence of steps that inc

Re: Django y Python

2018-04-16 Thread Vijay Khemlani
No es necesario usar anaconda para instalar Django Puedes usar Django 1.5 en adelante con Python 3, pero lo ideal es usar la última versión (2.0.4) On Sun, Apr 15, 2018 at 8:38 PM, Marcelo Giorno wrote: > Soy nuevo en todo esto. > Instale Anaconda. > Tengo Python 3,6 > La consulta es puedo inst

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

2018-04-12 Thread Vijay Shanker
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 has expired it will take him to login page after which he is rediredted to form page with a prefilled form with data he filled previously. my propsed s

Re: Optimal query for related names in onetomany or manytomany using Django Queryset

2018-02-03 Thread Vijay Khemlani
t;> >>> A.objects.filter(bs__isnull=True) >> >>> from django.db import connection >> >>> for q in connection.queries: >> >>> print("{0}: {1}".format(q['sql'], q['time'])) >> >> This will show you both querie

Re: Optimal query for related names in onetomany or manytomany using Django Queryset

2018-02-02 Thread Vijay Khemlani
"with large of records in A and B, the above takes lot of time" How long? At first glance it doesn't look like a complex query or something particularly inefficient for a DB. On Fri, Feb 2, 2018 at 11:31 AM, Andy wrote: > not that i know of > > > Am Freitag, 2. Februar 2018 15:28:26 UTC+1 schri

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

2018-01-23 Thread Vijay Khemlani
I have been using django-custom-user for that without any issues On Tue, Jan 23, 2018 at 6:43 PM, Daniel Cîrstea wrote: > Hello. For a while I noticed that it is a struggle to extend the > AbstractBaseUser in order to change user to email for registration and > login. Takes time and it is a lot

Re: How to Design Models for Matches in Django Dating App?

2017-12-23 Thread Vijay Khemlani
If you have the survey answers for all the people and you are only going to base the matches based on that data, I'd rather use a K Nearest Neighbors implementation http://scikit-learn.org/stable/modules/neighbors.html Or some other similar system to suggest the matches. For 1.000 users it shoul

Re: Django 2.0 released

2017-12-04 Thread Vijay Khemlani
I just wanted to take the chance to thank Tim and all the other people working on Django, especially on this big milestone for the project. At least for me It has served me well over the last 5 years, has incorporated many useful features while still being relatively lean, and has top notch docume

Re: İ want to setup a server at home for testing and lerning to deploy django projects, thanks for any helping.

2017-12-01 Thread Vijay Khemlani
For a typical setup, a VM (using VirtualBox or similar) running the OS of your server should be enough to test On Fri, Dec 1, 2017 at 2:39 AM, Ali İNCE wrote: > İ want to setup a server at home for testing and lerning to deploy django > projects, can anyone help me , advice and share sources th

Re: Django Templates and Conditional CSS classes

2017-11-10 Thread Vijay Khemlani
You can also add a "state_css_class" (or something) method to your object class and just call ... the method should be quite simple On Fri, Nov 10, 2017 at 7:01 PM, Adam Simon wrote: > > You can pass the class from either the model or the view into the > template. For example, you can assign

Re: tutorial site not working

2017-11-05 Thread Vijay Khemlani
did you keep the manage.py shell open while making the code changes? you need to close/open it again On Sat, Nov 4, 2017 at 10:36 PM, Kyle Foley wrote: > Let me also show what I have placed in the terminal > > >>> Question.objects.get(pk=1) > > > > >>> q = Question.objects.get(pk=1) > > >>> q.w

Re: make a button element outside be on the right side of another element inside

2017-09-28 Thread Vijay Khemlani
An input with type "button" instead of "submit" should not trigger the form submit. On Thu, Sep 28, 2017 at 7:56 PM, fábio andrews rocha marques < fabioandrewsrochamarq...@gmail.com> wrote: > In my template, I have a form. This form has a lot of textfields and a > submit button. There's another b

Re: Email validation in form

2017-09-12 Thread Vijay Khemlani
erstand, but why while using model form it's not cought by form > itself same as missing or incorect field like "asdf" for email? This is my > problem. I need to show error and not to try to save :) > > > > Dne úterý 12. září 2017 12:47:16 UTC+2 Vijay Khemlani nap

Re: Email validation in form

2017-09-12 Thread Vijay Khemlani
"asdf@asdf" is not a valid email so form.is_valid returns False and form.save is never called On Tue, Sep 12, 2017 at 4:52 AM, Moreplavec wrote: > Greetings, > > i have strange problem with my model form. I have simple form for taking > orders, model looks like: > > class Order(models.Model):

Re: how to write APIview to access a specific item by using APIViews only

2017-09-05 Thread Vijay Khemlani
To retrieve a particular object in your API you should implement it in a method called "retrieve", not "get", if I remember correctly On Tue, Sep 5, 2017 at 10:28 AM, Rakhee Menon wrote: > CODE: > > class FormList(APIView): > def get(self, request, id): > import ipdb;ipdb.set_trace() > item_obj

Re: Deploy app under subdirectory

2017-08-28 Thread Vijay Khemlani
If possible try and run as a subdomain myapp.mydomain.com it is easier to configure things in that case On Sun, Aug 27, 2017 at 11:39 PM, Angel Ruiz wrote: > Hello everybody, I need run my app under subdirectory, e.g. > mydomain.com/myapp > > I have one app running with Nginx and Gunicorn in U

Re: please help me about django error that encoding is wrong

2017-08-22 Thread Vijay Khemlani
What is the hostname of your machine? If you are using Windows then you can execute "ipconfig /all" on a cmd prompt On Mon, Aug 21, 2017 at 11:27 PM, 輝夜三日月 wrote: > >

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

2017-08-17 Thread Vijay Khemlani
bject-level permissions extensively in my own project and haven't had any performance issues yet. If nothing else, your results would prove useful to the community. On Thu, Aug 17, 2017 at 10:18 AM, guettli wrote: > > > Am Mittwoch, 16. August 2017 13:39:53 UTC+2 schrieb Vijay

Re: Making/Creating a verified user for unit test (django-allauth)

2017-08-17 Thread Vijay Khemlani
Check that the created user has the "is_active" field set to True On Thu, Aug 17, 2017 at 2:41 AM, Desmond Lim wrote: > Hi there, > > I'm wonder, how do we create a verified user for testing purpose > > I have this line that creates a user > > *cls.user = get_user_model().objects.create_user(use

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

2017-08-16 Thread Vijay Khemlani
So, please share the specific numbers you got from your profiling. On Wed, Aug 16, 2017 at 6:10 AM, guettli wrote: > > > Am Donnerstag, 10. August 2017 14:30:31 UTC+2 schrieb Vijay Khemlani: >> >> It's still implemented like that in the background, but I'm not

Re: How to use try..except, but when DEBUG is True, show the error?

2017-08-12 Thread Vijay Khemlani
from django.conf import settings try: x = parse_date('') except TypeError: if settings.DEBUG: raise else: return False On Sat, Aug 12, 2017 at 10:54 AM, Fellipe Henrique wrote: > Hello, > > i have these code, for example: > > try: >x = parse_date('') > except TypeErr

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

2017-08-10 Thread Vijay Khemlani
> > > Am Mittwoch, 9. August 2017 18:03:44 UTC+2 schrieb 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')

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

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-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: 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: 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: 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: 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-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: 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: 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 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: 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: '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: 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: 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: 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: 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: 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: 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: 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: 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: 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: Django forks

2017-04-17 Thread Vijay Khemlani
d basically had not been capitalizing on Django itself for > the last decade. > > Vijay, that RoR failed at it, fails to scare me out, and does not look > like a logic argument *for me*. I'm a lot more comfortable with failing > than with not trying. And even if it was really "

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

  1   2   3   4   5   >