Re: Can't access my django runserver

2018-07-01 Thread Jason
You're importing the wrong thing *from django import templates* should be *from django import template* no "s" on the latter -- 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, s

Re: Can't access my django runserver

2018-07-01 Thread Umar Kambala
Please am new to django n I don't know where to get the problem tree. Need further clarifications On Jul 1, 2018 10:18 PM, "Anirudh Jain" wrote: Can you please show your directory structure ? Just take the screenshot of your project tree from code editor and that would be enough. -- You receive

Re: Can't access my django runserver

2018-07-01 Thread Anirudh Jain
Can you please show your directory structure ? Just take the screenshot of your project tree from code editor and that would be enough. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails fro

Re: Invalid HTTP_HOST header when website being accessed by public IP

2018-07-01 Thread Kasper Laudrup
Hi Tomasz, On 2018-07-01 19:10, Tomasz Knapik wrote: I don't think that's wise to set allowed hosts to a host you don't want your application to be accessed by. I agree completely, which is why I asked the question. Thanks a lot. Django documentation shows you how you can mute the errors -

Re: Can't access my django runserver

2018-07-01 Thread Umar Kambala
please this what i got after correcting my codes when i run python manage.py runserver C:\Users\Admin\Desktop\Djan Polls>cd mysite C:\Users\Admin\Desktop\Djan Polls\mysite>python manage.py runserver Traceback (most recent call last): File "C:\Users\Admin\AppData\Local\Programs\Python\Python36

Re: Can't access my django runserver

2018-07-01 Thread Jason
what does this have to do with the original question of this post? On Sunday, July 1, 2018 at 1:45:14 PM UTC-4, Ripon Uddin wrote: > > Anybody can help about Django Auth Login please ? > > > On Sun, Jul 1, 2018 at 3:27 PM Umar Kambala > wrote: > >> Am very grateful >> On Jun 30, 2018 1:05 PM, "An

Re: Can't access my django runserver

2018-07-01 Thread Ripon Uddin
Anybody can help about Django Auth Login please ? On Sun, Jul 1, 2018 at 3:27 PM Umar Kambala wrote: > Am very grateful > On Jun 30, 2018 1:05 PM, "Anirudh Jain" > wrote: > >> You forgot to put 'comma' after DIRS': [os.path.join(BASE_DIR, >> 'templates')] in templates. >> >> It should be DIRS'

Re: limit the instances created by the current logged in user where the user is a foreign key in the model.

2018-07-01 Thread Saloni Kalra
thanks much! On Sunday, 1 July 2018 21:52:55 UTC+5, Tomasz Knapik wrote: > > You probably have to validate it yourself. You probably should do this at > the form level. I don't think there's a smart way to do that in Django. > > 1. Pass user into the form's __init__. > > 2. Check the number of us

Re: Invalid HTTP_HOST header when website being accessed by public IP

2018-07-01 Thread Tomasz Knapik
I don't think that's wise to set allowed hosts to a host you don't want your application to be accessed by. Django documentation shows you how you can mute the errors - https://docs.djangoproject.com/en/2.0/topics/logging/#django-security. It's not technically an error of your application. 'h

How can I save uploaded image's url in a column of database?

2018-07-01 Thread prateek gupta
Hi All, I am using Django2.0.6, Python3.6 and MySql. I have a table Brand in db which have fields- id, name, description, image_url. >From django admin I am uploading an image to s3 bucket. For this I have created a class Brand in models.py as below- class Brand(models.Model): name = models

Re: limit the instances created by the current logged in user where the user is a foreign key in the model.

2018-07-01 Thread Tomasz Knapik
You probably have to validate it yourself. You probably should do this at the form level. I don't think there's a smart way to do that in Django. 1. Pass user into the form's __init__. 2. Check the number of user's feedback in the form's clean() method and raise ValidationError if user has lef

limit the instances created by the current logged in user where the user is a foreign key in the model.

2018-07-01 Thread Saloni Kalra
I have a feedback app in which the user signs in, logs in and gives feedback. i wish to limit the number of feedbacks a user can give. how to do this and where? shall I user validation? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscr

Invalid HTTP_HOST header when website being accessed by public IP

2018-07-01 Thread Kasper Laudrup
Hi fellow Django users, I have succesfully deployed a small Django site with uwsgi and Nginx to a virtual server running in Amazons cloud (AWS). I have also succesusfully set up email so I will get an email everytime an error occurs. Quite useful. Now, my problem is, that lately I have been

Re: Isolated virtualenv and mod_wsgi - how do I do this on Apache

2018-07-01 Thread Melvyn Sopacua
On donderdag 28 juni 2018 17:46:42 CEST Bruce Whealton wrote: > In all cases, a virtualenv is recommended for any Python > deployment. In both cases, I have Apache as the web server with mod_wsgi. > Obviously, I need the server, Apache, to activate the > Django environment. I can ssh

Re: Set null value for floatfield

2018-07-01 Thread Jason
You're not returning a response from the view method. this has nothing to do with setting the value on the model field. On Sunday, July 1, 2018 at 8:09:11 AM UTC-4, Rakhee Menon wrote: > > Hi, > > Please could anyone tell how to set null value for FloatField and when I > try with null=True and

Set null value for floatfield

2018-07-01 Thread Rakhee Menon
Hi, Please could anyone tell how to set null value for FloatField and when I try with null=True and blank=true I get this error AssertionError: Expected a `Response`, `HttpResponse` or `HttpStreamingResponse` to be returned from the view, but received a `` Regards, Rakhee -- You received th

Re: Can't access my django runserver

2018-07-01 Thread Umar Kambala
Am very grateful On Jun 30, 2018 1:05 PM, "Anirudh Jain" wrote: > You forgot to put 'comma' after DIRS': [os.path.join(BASE_DIR, > 'templates')] in templates. > > It should be DIRS': [os.path.join(BASE_DIR, 'templates')], > > On Sat 30 Jun, 2018, 15:52 Umar Kambala, wrote: > >> >> this are my co

Re: Can't access my django runserver

2018-07-01 Thread Umar Kambala
Am very grateful On Jun 30, 2018 12:49 PM, "Jason" wrote: > you're missing a comma at the end of > > 'DIRS': [os.path.join(BASE_DIR, 'templates')] > > for future reference, if you want people to help you, give the information > up front as well as context. Your original posting showed minimal >

Re: Can't access my django runserver

2018-07-01 Thread Umar Kambala
Am very grateful On Jun 30, 2018 1:05 PM, "Glen D souza" wrote: > I think there is a ' , ' missing after 'DIRS' in Templates settings > > On Saturday, 30 June 2018, Umar Kambala wrote: > >> >> this are my codes... >> >> # SECURITY WARNING: don't run with debug turned on in production! >> DEBUG =

Re: Database

2018-07-01 Thread Tomasz Knapik
Django has support for Postgres-only features - https://docs.djangoproject.com/en/2.0/ref/contrib/postgres/ - if you need any of them. Also full text search is much easier to implement with Postgres in Django - https://docs.djangoproject.com/en/2.0/ref/contrib/postgres/search/ Also I am not s