How to fix "App 'polls' could not be found. Is it in INSTALLED_APPS?"

2018-07-23 Thread Sitthiput Mongkolsri
Hi, i'm new to django. Just learn from the tutorial and found this problem. I don't know how to fix this, wish someone could. Thanks. -- 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

Prevent Django tests from accessing internet (except localhost)

2018-07-23 Thread Kum
Hi, Is there a global config I can enable to prevent any Django tests in a project from accessing the internet (i.e., only allow network calls to localhost) ? Thanks -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this gr

Re: How to fix "App 'polls' could not be found. Is it in INSTALLED_APPS?"

2018-07-23 Thread Gerald Brown
Don't use SUDO, just python manage.py makemigrations.  Also the "POLLS" is not necessary. On Monday, 23 July, 2018 02:48 PM, Sitthiput Mongkolsri wrote: Hi, i'm new to django. Just learn from the tutorial and found this problem. I don't know how to fix this, wish someone could. Thanks. -- You

Re: Prevent Django tests from accessing internet (except localhost)

2018-07-23 Thread Jason
you shouldn't be accessing external services with your tests, you should mock or patch them with expected responses/failures and test based on that. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receivi

Re: Prevent Django tests from accessing internet (except localhost)

2018-07-23 Thread Melvyn Sopacua
On maandag 23 juli 2018 13:39:27 CEST Jason wrote: > you shouldn't be accessing external services with your tests Non-sense. Part of interacting with a remote API is making sure it works and they didn't change anything (trust me, there's plenty of API's that change without changing version numbe

Django admin panel records disappearing

2018-07-23 Thread dean raemaekers
Hello, I am using the Django admin tool as an internal tool to reach into a remote database. Most of my models work perfectly with the save. method additions I have added, but there are 2 that are not working. What happens is that the admin screen gives a successful "save" message, but the gr

Re: Prevent Django tests from accessing internet (except localhost)

2018-07-23 Thread chuck . horowitz
Hi Kum, I think Melvyn's suggestion is a good one. Is there any reason you couldn't do: import DEBUG from yourapp.settings And then check against that for your testing? On Monday, July 23, 2018 at 8:22:17 AM UTC-4, Melvyn Sopacua wrote: > > On maandag 23 juli 2018 13:39:27 CEST Jason wrote

Re: Prevent Django tests from accessing internet (except localhost)

2018-07-23 Thread Melvyn Sopacua
On maandag 23 juli 2018 17:23:20 CEST chuck.horow...@packetviper.us wrote: > Hi Kum, > > I think Melvyn's suggestion is a good one. Is there any reason you > couldn't do: > > > import DEBUG from yourapp.settings > > > And then check against that for your testing? Here's some code I used in a

How to automatically fill out an auto increment number in form field?

2018-07-23 Thread Alexander Joseph
Hello, I have a model ... class PurchaseOrder(models.Model): po_number = models.IntegerField(unique=True) and a function ... def get_po_number(self, *args, **kwargs): if not self.id: last_po = PurchaseOrder.objects.order_by('po_number').last() if last_po: la

Server complete html Static App without apache server and without modifying html code

2018-07-23 Thread archit mehta
Hi, I have oraclejet frontend application and want to server that using django, I did it with flask but don't know how to do with django. Here is complete description of my problem Please go through it and suggest some solution. https://stackoverflow.com/questions/51484839/how-to-serve-comple

Code vs Shell?

2018-07-23 Thread roflcopterpaul
Hello, everyone! I am quite the scrub, having written a few super basic apps and currently going through the Django tutorial. As I'm going through the tutorial (creating a "polls" app), I've been perplexed by something the whole time that I haven't been able to find an answer to - Why is much

How can i require the user to login to see the view ?

2018-07-23 Thread Mostafa Alaa
the view of app from django.shortcuts import render from .models import Article from django.contrib.auth.decorators import login_required # Create your views here. def index(request): articles = Article.objects.all() return render(request,'app/index.html',{'articles':articles}) def d

Connecting to remote host like Twitch to monitor chat using websockets

2018-07-23 Thread Dave Holly
Greetings, Is it possible to use Django Channels and websockets to monitor the chat in twitch rooms, or other sites with chat rooms? I would like to display extra graphics for users who send cheers of high amounts, like 1000, 2000, etc. I have the display worked out in Django where I'm monit

BEGIINER_ISSUE (FIRST DJANGO PROJECT): The install worked successfully! Congratulations! You are seeing this page because DEBUG=True is in your settings file and you have not configured any URLs.

2018-07-23 Thread Vinko Sucur
When i lounch my first djangoproject it always display the issue "The install worked successfully! Congratulations! You are seeing this page because DEBUG=True is in your settings file and you have not configured any URLs." (Look FIRTS DJANGO PROJECT.PGN) Please, how can I fix that problem, tha

Re: How to automatically fill out an auto increment number in form field?

2018-07-23 Thread Michael MacIntosh
Hi, Aren't you looking for the AutoField? https://docs.djangoproject.com/en/2.0/ref/models/fields/#autofield It will automatically increment based on each record added to the table. As an aside, the problem you are having is that in python, the first argument to a class is a reference to the

Re: How to automatically fill out an auto increment number in form field?

2018-07-23 Thread Gerald Brown
From "https://docs.djangoproject.com/en/2.0/topics/db/models/#automatic-primary-key-fields";, it has a further definition of automatic primary key fields.  In your model just add "(primary_key=True)" to po_number field. On Tuesday, 24 July, 2018 07:54 AM, Michael MacIntosh wrote: Hi, Aren'

Re: How to automatically fill out an auto increment number in form field?

2018-07-23 Thread Alexander Joseph
Thanks Michael and Gerald. With an auto key field or primary key field would users still be able to input their own value? And if so how would I be able to give it a default attribute in a form that shows what the next number should be, if the user decides to choose to use the auto increment? Thank

Re: Prevent Django tests from accessing internet (except localhost)

2018-07-23 Thread Kum
Is there a way to prevent people from accidentally doing so? On Monday, July 23, 2018 at 7:39:27 AM UTC-4, Jason wrote: > > you shouldn't be accessing external services with your tests, you should > mock or patch them with expected responses/failures and test based on that. > -- You received th

Re: Code vs Shell?

2018-07-23 Thread Mike Dewhirst
On 24/07/2018 9:25 AM, roflcopterpaul wrote: Hello, everyone! I am quite the scrub, having written a few super basic apps and currently going through the Django tutorial. As I'm going through the tutorial (creating a "polls" app), I've been perplexed by something the whole time that I haven't

Re: Help with FilteredSelectMultiple

2018-07-23 Thread Ike
Hi Melvyn, Sorry for the late reply, also this is my first post here so I'm not really sure what's needed. FilteredSelectMultiple is a django admin widget so it isn't in the requirements.txt. I have managed to save to the database already via ajax request. However, I am unable to have the ch

Re: How can i require the user to login to see the view ?

2018-07-23 Thread mottaz hejaze
The login_required decorator¶ login_required(*redirect_field_name='next'*, *login_url=None*)[source]

Re: Server complete html Static App without apache server and without modifying html code

2018-07-23 Thread mottaz hejaze
i dont understand .. why you need backend anyway ? On Mon, 23 Jul 2018, 23:21 archit mehta, wrote: > > Hi, > > I have oraclejet frontend application and want to server that using > django, I did it with flask but don't know how to do with django. > > Here is complete description of my problem Pl

Re: BEGIINER_ISSUE (FIRST DJANGO PROJECT): The install worked successfully! Congratulations! You are seeing this page because DEBUG=True is in your settings file and you have not configured any URLs.

2018-07-23 Thread mottaz hejaze
this is not an issue , please go to documentation and follow the tutorial On Tue, 24 Jul 2018, 01:44 Vinko Sucur, wrote: > When i lounch my first djangoproject it always display the issue "The > install worked successfully! Congratulations! You are seeing this page > because DEBUG=True is in you

Re: How to automatically fill out an auto increment number in form field?

2018-07-23 Thread mottaz hejaze
you can use count() in views or models to count number of objects then add the new record On Tue, 24 Jul 2018, 02:55 Alexander Joseph, wrote: > Thanks Michael and Gerald. With an auto key field or primary key field > would users still be able to input their own value? And if so how would I > be

Re: Code vs Shell?

2018-07-23 Thread mottaz hejaze
python is not just web , python is very general and has many other usages , so you are developing but in a pythonic way , think of the shell as your scratch paper .. what if you want to learn a code snippet like querying the database with filters , do you have to waste time build a complete app to