Django FormView, Return without redirecting

2019-05-27 Thread Sujayeendra G
Hi, Can anyone kindly let me know, how to return page without redirecting. I mean, I have created one product list_page and corresponding detail_page. In product detail_page. need to fill form to send brochure to their E-mail. After filling form can we return to same section without reloading

Django FormView, Return without redirecting

2019-05-27 Thread Sujayeendra G
Hi, Can anyone kindly let me know, how to return page without redirecting. I mean, I have created one product list_page and corresponding detail_page. In product detail_page. need to fill form to send brochure to their E-mail. After filling form can we return to same section without

Re: What's wrong with this model

2019-05-27 Thread Balaji Shetty
Hi You may change elogin column syntax and provide default="Some_Value" .This may work. On Tuesday, May 28, 2019, Chandrashekhar Singh wrote: > You have to add null= true to each model field since database needs > default value > > On Mon, May 27, 2019, 5:52 PM Saeed Pooladzadeh > wrote: >

Re: what is the meaning of this error

2019-05-27 Thread Lunga Baliwe
You probably have to import and use like this https://docs.djangoproject.com/en/2.2/topics/http/shortcuts/#redirect from django.shortcuts import redirect def my_view(request): ... obj = MyModel.objects.get(...) return redirect(obj) On Tue, May 28, 2019 at 1:49 AM Saeed Pooladzadeh

what is the meaning of this error

2019-05-27 Thread Saeed Pooladzadeh
hello Can you please help me to understand the meaning of this error: NameError at /emp name 'redirect' is not defined Request Method: POST Request URL: http://localhost:62597/emp Django Version: 2.2 Exception Type: NameError Exception Value: name 'redirect' is not defined Exception

Re: What's wrong with this model

2019-05-27 Thread Chandrashekhar Singh
You have to add null= true to each model field since database needs default value On Mon, May 27, 2019, 5:52 PM Saeed Pooladzadeh wrote: > Hello > > I made this model and think everything is fine: > > class Smodel(models.Model): > > eid=models.AutoField(primary_key=True) >#

Re: What's wrong with this model

2019-05-27 Thread Gil Obradors
Yes, your are adding new field elogin. Table contains data You must specify a default on all existing rows, selecting 1 and writing to console something Missatge de Saeed Pooladzadeh del dia dl., 27 de maig 2019 a les 23:52: > Hello > > I made this model and think everything is fine: >

What's wrong with this model

2019-05-27 Thread Saeed Pooladzadeh
Hello I made this model and think everything is fine: class Smodel(models.Model): eid=models.AutoField(primary_key=True) # eid=models.IntegerField(default=0) elogin = models.CharField(max_length=8) epassword= models.CharField(max_length=8)

Re: Single place for validation

2019-05-27 Thread Alexis Roda
Hi, an approach that comes to mind would be defining validation in the model and using model forms[1] for the user site. HTH [1] https://docs.djangoproject.com/en/2.2/topics/forms/modelforms/ Missatge de Harsh Gundecha del dia dl., 27 de maig 2019 a les 16:20: > hello, > i am currently

Re: How to restore Models original Properties - Problem in Models column Exclude

2019-05-27 Thread Alexis Roda
Not an admin expert here. You are modifying the modeladmin instance and, by the behavior you're describing, it looks like it is a global (shared) object. I'm guessing, you can confirm this by printing id(self) in add_view(). I'll bet you get the same value in each request, so the instance is

Re: deploy to Heroku " collectstatic --noinput "

2019-05-27 Thread Stephen L
This is a migration problem https://groups.google.com/forum/#!topic/django-users/M-C6cZ8S4r4 https://stackoverflow.com/questions/42613536/django-programming-error-column-does-not-exist-even-after-running-migrations always run migrations before committing to heroku, but you can also run it on

Re: deploy to Heroku " collectstatic --noinput "

2019-05-27 Thread Andrew C.
Follow a tutorial. 1) Hide your secret key and everything secretive in an environment variable. Or use Django-environ 2) Try python manage.py check —deploy 3) Debug is set to True... it should not be True if you’re publishing (deploying) On Mon, May 27, 2019 at 3:46 PM omar ahmed wrote: > i

Re: deploy to Heroku " collectstatic --noinput "

2019-05-27 Thread omar ahmed
i can't publish my project On Monday, May 27, 2019 at 8:45:59 PM UTC+2, Jamiu Olashile Salimon wrote: > > Hello Omar, what’s the problem? > > On Sun, 26 May 2019 at 10:35 PM, omar ahmed > wrote: > >> git push heroku master >> Counting objects: 4, done. >> Delta compression using up to 4

How to restore Models original Properties - Problem in Models column Exclude

2019-05-27 Thread Balaji Shetty
*Hi* *i have encountered very strange problem. have two user . One is superuser of name "root" and another is general user of name "dgp". I have model of Name Profile with 21 fields around.* *I want to show all field of Model Profile in "root" login.* *I want to exclude 4 field of Model Profile

Re: deploy to Heroku " collectstatic --noinput "

2019-05-27 Thread salimon jamiu olashile
Hello Omar, what’s the problem? On Sun, 26 May 2019 at 10:35 PM, omar ahmed wrote: > git push heroku master > Counting objects: 4, done. > Delta compression using up to 4 threads. > Compressing objects: 100% (4/4), done. > Writing objects: 100% (4/4), 414 bytes | 0 bytes/s, done. > Total 4

Re: Hosting - Does pythonanywhere supports all features as AWS.

2019-05-27 Thread Balaji Shetty
High Chetan Thank You very much. On Mon, May 27, 2019 at 5:43 PM Chetan Ganji wrote: > Hi Balaji Sir, > > AFAIK, Python Anywhere is Shared Hosting Provider for Django. Suitable for > Small to Medium sized Websites and Webapps. > Its like a tiny mouse. > > AWS is a platform to create online

Re: Hosting - Does pythonanywhere supports all features as AWS.

2019-05-27 Thread Balaji Shetty
Than You On Mon, May 27, 2019 at 7:50 PM Chandrashekhar Singh < chandrashekhar...@gmail.com> wrote: > Hii, > It will better if you ask or email python anywhere directly > > > On Sun, May 26, 2019, 2:49 PM Balaji Shetty > wrote: > >> Does pythonanywhere supports all features as AWS. >> >> Or any

Re: KeyError at /admin/newapp/profile/add/ and Search Error --- Related Field got invalid lookup: icontains

2019-05-27 Thread Balaji Shetty
Hi Sorry This is my model class Profile(models.Model): RCS1 = "Regular_Civil_Suit" SCS1 = "Special_Civil_Suit" RCA1 = "Regular Civil Appeal" MCA1 = "Miscellaneous Civil Appeal" CMA1 = "Civil Miscellaneous Application" LAR1 = "Land Acquisation Reference" SED1 =

Re: KeyError at /admin/newapp/profile/add/ and Search Error --- Related Field got invalid lookup: icontains

2019-05-27 Thread Derek
Your first error refers to a ProfileForm; you need to post the form definition code here as well. On Sunday, 26 May 2019 20:48:09 UTC+2, Balaji wrote: > > Hi > > Here i want to exclude some model filed depending upon type of User. > > Example if username is "dgp", i want to exclude > in

Re: deploy to Heroku " collectstatic --noinput "

2019-05-27 Thread Joe Reitman
Is there a question here? I will point out what I see wrong in Settings.py. Allowed_hosts is empty. Need the host domain. Missing Port number for your database Did you migrate your models? Secret key should be stored in environment variable On Sunday, May 26, 2019 at 4:34:54 PM UTC-5, omar

Atomic post_save operation

2019-05-27 Thread Clara Daia
Hello, guys tl; dr: Is there a way to make [save + post_save] and [delete + post_delete] operations atomic? That is, if the operations in the function triggered by the post_save signal fail, then the save itself is reverted? Long version: I have a certain model MyModel and I keep track of

Re: Single place for validation

2019-05-27 Thread Chetan Ganji
If you have customized the forms for the user facing website, you have to specify the same forms in the class extended by admin.ModelAdmin. Below answer is what you are looking for. https://stackoverflow.com/questions/6321916/different-fields-for-add-and-change-pages-in-admin Regards, Chetan

Re: Rails to Django Application Architecture Question

2019-05-27 Thread Steve R
Would it be correct to think of an app being basically one object equivalent to a single medium-to-complex class? On Friday, May 24, 2019 at 3:30:40 PM UTC-5, Steve R wrote: > > Thank you! > > On Friday, May 24, 2019 at 3:08:33 PM UTC-5, Alex Heyden wrote: >> >> What you're describing is how

Unable to fetch data from mysql DB without manually restarting the server

2019-05-27 Thread Pranjal Kesharwani
Hello all, I am trying to insert some data in a mysql DB on one tab then trying to fetch the upoaded data on another tab. I have to restart my server manually then I am able to fetch data . kindly help. -- You received this message because you are subscribed to the Google Groups "Django

Re: What is this error mean and what can I do

2019-05-27 Thread Chandrashekhar Singh
Yes I think you should first do "makemigrations" and then run migrate On Sun, May 26, 2019, 6:15 PM Saeed Pooladzadeh wrote: > > Hi > > This is my model: > from django.db import models > from django.conf import settings > > > # Create your models here. > class Smodel(models.Model): >

Single place for validation

2019-05-27 Thread Harsh Gundecha
hello, i am currently learning django and i have query as following is it that we have to put validators in both the model definition and form validation to apply validation to both admin and user site ? i tired on reusing a form class assuming that the validator there would apply on both user

Re: Hosting - Does pythonanywhere supports all features as AWS.

2019-05-27 Thread Chandrashekhar Singh
Hii, It will better if you ask or email python anywhere directly On Sun, May 26, 2019, 2:49 PM Balaji Shetty wrote: > Does pythonanywhere supports all features as AWS. > > Or any service it does not as compared to AWS. > > > > On Sat, May 25, 2019 at 6:50 PM Subramanian Sridharan < >

Re: AutoField

2019-05-27 Thread ramadhan ngallen
By Default each model in django has one primary key (id) which is also auto filled. If you don't want to use django's autofilled primary key, you suppose to make custom primary key  You may use the link below https://docs.djangoproject.com/en/2.2/topics/db/models/ Best Regards Ramadhan Ngallen

Re: Hosting - Does pythonanywhere supports all features as AWS.

2019-05-27 Thread Serdar Emirci
You can use to digitalocean , AWS and natro. Serdar EMIRCI Chetan Ganji , 27 May 2019 Pzt, 15:14 tarihinde şunu yazdı: > Hi Balaji Sir, > > AFAIK, Python Anywhere is Shared Hosting Provider for Django. Suitable for >

Re: Hosting - Does pythonanywhere supports all features as AWS.

2019-05-27 Thread Chetan Ganji
Hi Balaji Sir, AFAIK, Python Anywhere is Shared Hosting Provider for Django. Suitable for Small to Medium sized Websites and Webapps. Its like a tiny mouse. AWS is a platform to create online Platforms like Python Anywhere in the cloud. i.e. You can create decentralised online platforms, based