Re: form.is_valid() is always return false please help

2019-08-24 Thread vineeth sagar
What does form.errors show. Just see what print(form.errors) tells you. It should be pretty obvious. On Sun, 25 Aug 2019, 00:30 mohammad mehrani, wrote: > awesome!!! and i like it > > On Fri, Aug 23, 2019 at 12:27 AM Shubham Chauhan < > shubham.chauhan...@gmail.com> wrote: > >> form.is_valid()

[Urgent] 500 when requesting a file from browser.

2019-06-20 Thread vineeth sagar
I need to display images on canvas, so I have used the following snippet. The request is reaching the server but I get the following trace. Unable to make sense out of it, if any of you can help out, it would be great. function getImage(file_name, num_pages) { myimage = new Image();

Re: How to modify LOGGING settings in unittest

2019-06-10 Thread vineeth sagar
Try this with the override_settings decorator. like this. @override_settings(LOGGING_DIR='/tmp/test_logs/' def test_function1(self): pass On Mon, Jun 10, 2019 at 7:15 PM panfei wrote: > There is a logger path for production environment, but I want to put the > logs in /tmp/ in unittests. >

Re: DateTimeField is in UTC but need IST standards

2019-04-30 Thread vineeth sagar
whenever USE_TZ=True is enabled, the timestamp is stored as a UTC object. This is standard practice, why? https://docs.djangoproject.com/en/2.2/topics/i18n/timezones/ Go through this, more than once. It'll be helpful. On Tue, 30 Apr 2019, 18:09 Sampath Reddy, wrote: > Hey guys, > > I am using

Re: Django - always getting False in form.is_valid()

2019-04-19 Thread vineeth sagar
can you please post, request.POST output? On Fri, 19 Apr 2019, 16:34 Sipum Mishra, wrote: > Hi All, > > I am always getting - form.is_valid returning False. kindly check where I > am doing wrong. > please find below code. > > > views.py > --- > def home(request): > > if request.method

Re: How this Line of code works

2019-04-14 Thread vineeth sagar
Hi Mayur, get_object_or_404, returns an object if it exists in the database or it will raise a 404 exception. So if the object is in the DB, django render template is done, in your case detail.html is rendered with the context dictionary.If there's no row peertaining to the query, then Http404

Re: How can I make users login to my site with facebook/twitter/google?

2019-03-05 Thread vineeth sagar
You can use django social auth. https://python-social-auth-docs.readthedocs.io/en/latest/configuration/django.html If you just want to learn. Look up Oauth2 and then use developer documentation to implement login with django. On Tue, 5 Mar, 2019, 22:49 Sandip Nath, wrote: > i want users to

Re: Local variable dump on exception in production environment (DEBUG=False)

2019-02-01 Thread vineeth sagar
Friday, February 1, 2019 at 4:00:13 PM UTC+5:30, vineeth sagar wrote: >> >> Hi, >> >> I am not sure about django, but you can have a look at sentry, we use it >> in production and it gives everything you ask for. I am sure Django also >> does it but I find sentr

Re: Local variable dump on exception in production environment (DEBUG=False)

2019-02-01 Thread vineeth sagar
Hi, I am not sure about django, but you can have a look at sentry, we use it in production and it gives everything you ask for. I am sure Django also does it but I find sentry better for error reporting. regards Vineeth On Feb 1, 2019 3:41 PM, "Web Architect" wrote: > Hi, > > In our

Where do you place your application code in production

2019-01-14 Thread vineeth sagar
Hi, This is not concerned with django itself, but I would love to get the general consensus here, In my college days while deploying a php application all the tutorials pointed to place my code in /var/www or something of that sort. For my django applications I tend to put it in /home//services/.

Re: How to hide the password of postgresql in settings.py

2018-11-30 Thread vineeth sagar
Use this https://github.com/jpadilla/django-dotenv/blob/master/README.rst If you have copied the GitHub template of .gitignore then the .env won't be in your history of vs. I used this in production and development without a single problem. On Nov 30, 2018 11:54 PM, "Carsten Fuchs" wrote: >

Re: How to fix TypeError: __init__() missing 1 required positional argument: 'on_delete'

2018-11-22 Thread vineeth sagar
For a foreign keys you have to specify an on_delete attribute, food=models.ForiegnKey(Food,on_delete=models.CASCADE) If a row in the parent table(food for example) is deleted this will cause the row/s that refers to that particular food item in your Restraunt model be deleted. on_delete can be

Re: How to solve django.db.utils.OperationalError: (2013, 'Lost connection to MySQL server during query')?

2018-11-15 Thread vineeth sagar
Try reducing the connection max age to a lesser value like 3600 maybe? On Nov 15, 2018 2:41 PM, "prateek gupta" wrote: > Hi, > > My all db have 20 gb of size. > > On Thursday, November 15, 2018 at 12:27:27 PM UTC+5:30, Krishnasagar > Subhedarpage wrote: >> >> Hi Prateek, >> >> Did you check

Re: Error installing mysqldb module !

2018-11-11 Thread vineeth sagar
Ah using Windows the most braindead operating system the world has ever seen. My coworker had this problem and he solved it using the following command pip install --only-binary :all: mysqlclient Good luck! On Nov 11, 2018 5:01 PM, "Swetank Subham Roy" wrote: > First of all you have to

Re: Link ID's To Detail Page

2018-11-07 Thread vineeth sagar
I think it should be url 'kpi_detail' incident_id=incident.id" and for the other one it should be url 'kpi_eftdetail' eftlead=eftlead.id" . I think you get the idea. This won't solve it if you copy paste but it's a step in the right path On Nov 7, 2018 8:20 PM, "Gregory Strydom" wrote: > Hi

Re: I Suck

2018-10-24 Thread vineeth sagar
Hi, This kind of attitude gets you no where my man, Programming is supposed to be hard. You pick-up things every day. First focus on your weaknesses and then work your way up. If you don't have good python experience learn python first and then comeback to django. If there is some part of django

Re: Template Issues

2018-10-21 Thread vineeth sagar
Do you mean bootstrap? STL doesn't care about that and it's not clear what you mean. Can you share the code so that we can help you. On Oct 22, 2018 12:14 AM, "Dennis Alabi" wrote: > i am Building Django 2.0 Web Applications, template is not rendering with > boottrap3. > > -- > You received

Re: Connecting Sql server to Django

2018-10-14 Thread vineeth sagar
Singh >>> wrote: >>> >>>> bro...will you help me ... >>>> i am getting django 404 error ...please tell how to fix it... >>>> i am using python 3.6 + django 1.11 >>>> >>>> On Fri, 12 Oct 2018 at 19:35, vineeth saga

Re: Connecting Sql server to Django

2018-10-12 Thread vineeth sagar
I don't know if it works for 1.8, you would've tested it by now. The link I haven given is a current method to connect with sql server with newer versions of django, also I think it's about time your company updated your django version. For 2.1 the link I have given works seemlessly. On Oct 12,

Re: Connecting Sql server to Django

2018-10-11 Thread vineeth sagar
Which version of django are you using, django-mssql only supports Django until 1.8 and it's not under active development. https://pypi.org/project/django-pyodbc-azure/ use this instead, this works with ms-sql as I use this at work and if you go to the bitbucket repo you'll find the same thing I

Django Code distribution to customers.

2018-10-09 Thread vineeth sagar
We deploy our web applications on the infrastructure provided by the customer, how do you keep the code non-accessible to others. WHAT are the strategies you use. It doesn't have to be fool proof just it should become very hard to look at the code. Any ideas? -- You received this message

Possible bug while using migrate or maybe not.

2018-09-18 Thread vineeth sagar
> > So I had a migration which can be found below, so when I was applying the > migration I get this error You can't delete all columns with ALTER TABLE; > use DROP TABLE instead That makes sense because I have only a single > column. When I use the code sample 2 it works nicely. Can anyone

I don't clearly know how to name my issue, please read the body.

2018-09-09 Thread vineeth sagar
I have a form class like this, if the db is not populated I skip that field, in the future when something thaat might trigger a d population happens and I try to render this form, it doesn't recognise the update, but once I restart the development server it renders with the newly added field?

Re: Ldap for django

2018-08-31 Thread vineeth sagar
Wow Vineet Kothari very insightful, why do you have to be a dick? On Aug 31, 2018 9:57 PM, "Vineet Kothari" wrote: > It is not lodap is ldap > > Sent from my Huawei Mobile > > > Original Message > Subject: Ldap for django > From: soumyajit banerjee > To: Django users > CC: > >

Re: Doubts on One-To-One Field

2018-08-30 Thread vineeth sagar
each prefetched item, so one for users and one for > user profiles, which isn't useful here. > > https://docs.djangoproject.com/en/2.1/ref/models/querysets/#select-related > > On 8/30/2018 9:08 AM, vineeth sagar wrote: > > def userProfile(models.Model): > user=models.O

Doubts on One-To-One Field

2018-08-30 Thread vineeth sagar
def userProfile(models.Model): user=models.OneToOneField(User,primary_key=True) """ Other stuff """ I can query it like this x = userProfile.objects.get(user__id=1)(Assuming this exists) when I do a connection.queries a single query is executed.When I try to access

Re: Making a django project and an API.

2018-08-22 Thread vineeth sagar
Sorry, got the name of the book. On Aug 23, 2018 9:29 AM, "vineeth sagar" wrote: > Hey Mike I like reading books rather than tutorials please share the name > of the book. > > On Aug 23, 2018 5:47 AM, "Mike Dewhirst" wrote: > >> If you can get your han

Re: Making a django project and an API.

2018-08-22 Thread vineeth sagar
20+ pages) and I > reckon it will answer all your questions. > > On 23/08/2018 5:10 AM, vineeth sagar wrote: > >> Hi I am pretty comfortable django. Now recently started working on a >> fresh project, they want a normal project and an browsable api. I have seen >> th

Making a django project and an API.

2018-08-22 Thread vineeth sagar
Hi I am pretty comfortable django. Now recently started working on a fresh project, they want a normal project and an browsable api. I have seen the drf and it's great, the browsable api in drf documentation is what they(my boss) wants. How do I start developing both of them simultaneously. I

Re: Learning django

2018-08-05 Thread vineeth sagar
Not to be mean or cheeky, but Django documentation is best book imo. Read the docs, if they are unclear in anyway, Start reading code. That's how I learnt about sessions and also you'll get to learn all kinds of cool stuff when you start reading Django code, Like property,cached property, Lazy

Re: JSON serializable error

2018-08-03 Thread vineeth sagar
You can use unix timestamp, It's json serializable and can be converted to a datetime object. If I am not wrong you were trying to store it in a session? try this. import time timestamp=time.time() request.session['current time']= timestamp import datetime

Problems Faced with some login requirements. Please read the thread below

2018-08-01 Thread vineeth sagar
Hi, So we are currently doing a project where the client wants the session to expire at browser close and also prevent multiple logins from the same account. Well there are some ways to implement the multiple login thing, consider this say user closes the browser, the session cookie expires.

Some Doubts on Session Expiries

2018-07-25 Thread vineeth sagar
Hi, I have been going crazy for the past few days trying to understand sessions, my settings.py file as the following, SESSION_SAVE_EVERY_REQUEST=True SESSION_COOKIE_AGE=2*60 Now whenever a request is initiated shoudn't the expiry date of the cookie i.e the one that holds the session id

Re: A few doubts with an implementation.

2018-07-02 Thread Vineeth Sagar
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 know that the mails are being retrieved - > https://channels.readthedocs.io/en/latest/ > Thanks Mikhailo for the prompt reply,

A few doubts with an implementation.

2018-07-02 Thread Vineeth Sagar
Problem: We are developing a email-CRM. The task at hand is to fetch emails every N minutes or hours. I have received a codebase written by another guy who left the company,my job is to re-write/re-factor. The guy who previously wrote the code started a thread whenever a user logged and he put