Re: django-admin error

2019-08-18 Thread DPM
Hi,

Kindly do whatever some told to add in admin.py file above. Thats correct.
After that u can see in admin panel
..

And for heroku what  error you are getting plz share screenshot.
I can help you.

On Mon, 19 Aug, 2019, 2:36 AM Gil Obradors,  wrote:

> 1.-Plese detail more : "But it not run" ?  Any error?  Admin screen
> withous the model?
> You can try doing with the same with decorator and class:
>
> from django.contrib import admin
>
> @admin.register(Pacientes)
> class PacientesAdmin(admin.ModelAdmin)
> pass
>
> Share errors, screen, behaveour...
>
>
> 2.- I don't know heroku but maybe for test/demo your selfPC it could be
> easy for starting...
> Port forwarding and go!
>
>
>
>
> Bests djangos
>
> Missatge de Gabriel Araya Garcia  del dia
> dg., 18 d’ag. 2019 a les 21:41:
>
>> Hi Daniel:
>> I have build a little app in Django, but i have two problems:
>> 1) I can not see the tables in ADMIN, but nevertheless y put in admin.py:
>> from .models import Pacientes
>> admin.site.register(Pacientes)
>>
>> But it not run.
>>
>> 2) I can not upload my project to HEROKU, I've follow all the steps for
>> to do this, but not run
>> Do you know some cpanel to upload my app for demo only (it have 120
>> records)
>>
>> Please, can you help about this?
>>
>> Thanks
>> (excusme my english, my native language is spanish)
>>
>> El sáb., 17 ago. 2019 a las 18:38, Daniel Agbaji ()
>> escribió:
>>
>>> Please check to see it you got install Django properly with the version
>>> of Python you are using.
>>>
>>> On Sat, Aug 17, 2019, 4:38 PM Muhammad Nadeem 
>>> wrote:
>>>
 FIRST U NEED TO START A NEW PROJECT USING FOLLOWING CODE:
django-admin startproject mysite
 WHERE "mysite" is the name of your project. you can change this name as
 you desired.


 if further u have any error fell free ping me


 On Sun, Aug 18, 2019 at 1:32 AM Naty Mina  wrote:

> hi, i'm new in django and trying to create my first project
> i followed the documentation and when i try to execute the
> django-admin startproject mysite i get error that 'no django settings
> specified' and to try 'django-admin.py help' instead for usage.
> the problem is when i try to do so, i get again the same error message
> i need help with that.
> i attached file so you can see
> *thank you*
>
> --
> 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 web visit
> https://groups.google.com/d/msgid/django-users/1690dca2-2728-452e-81fe-1458af63ba95%40googlegroups.com
> 
> .
>
 --
 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 web visit
 https://groups.google.com/d/msgid/django-users/CALYW77hm8aK%2BNPpfPPexB10ikmQ7Y%2BzezZZULe5mDvgLyVYSSQ%40mail.gmail.com
 
 .

>>> --
>>> 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 web visit
>>> https://groups.google.com/d/msgid/django-users/CAEnL_2nXTu13StMpfL8EQR6zwhZ6TmpW8RhHYoH69cc-9xWAog%40mail.gmail.com
>>> 
>>> .
>>>
>>
>>
>> --
>> Gabriel Araya Garcia
>> GMI - Desarrollo de Sistemas Informáticos
>> 99.7721.15.70
>>
>> --
>> 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 web visit
>> https://groups.google.com/d/msgid/django-users/CAKVvSDAW0r1hJ7muJ0cEB9NhTwhWVq1O5yCMo1%3D7OsV04nGLtA%40mail.gmail.com
>> 
>> .
>>
> --
> 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...@google

Re: django-admin error

2019-08-18 Thread Gil Obradors
1.-Plese detail more : "But it not run" ?  Any error?  Admin screen withous
the model?
You can try doing with the same with decorator and class:

from django.contrib import admin

@admin.register(Pacientes)
class PacientesAdmin(admin.ModelAdmin)
pass

Share errors, screen, behaveour...


2.- I don't know heroku but maybe for test/demo your selfPC it could be
easy for starting...
Port forwarding and go!




Bests djangos

Missatge de Gabriel Araya Garcia  del dia dg.,
18 d’ag. 2019 a les 21:41:

> Hi Daniel:
> I have build a little app in Django, but i have two problems:
> 1) I can not see the tables in ADMIN, but nevertheless y put in admin.py:
> from .models import Pacientes
> admin.site.register(Pacientes)
>
> But it not run.
>
> 2) I can not upload my project to HEROKU, I've follow all the steps for to
> do this, but not run
> Do you know some cpanel to upload my app for demo only (it have 120
> records)
>
> Please, can you help about this?
>
> Thanks
> (excusme my english, my native language is spanish)
>
> El sáb., 17 ago. 2019 a las 18:38, Daniel Agbaji ()
> escribió:
>
>> Please check to see it you got install Django properly with the version
>> of Python you are using.
>>
>> On Sat, Aug 17, 2019, 4:38 PM Muhammad Nadeem 
>> wrote:
>>
>>> FIRST U NEED TO START A NEW PROJECT USING FOLLOWING CODE:
>>>django-admin startproject mysite
>>> WHERE "mysite" is the name of your project. you can change this name as
>>> you desired.
>>>
>>>
>>> if further u have any error fell free ping me
>>>
>>>
>>> On Sun, Aug 18, 2019 at 1:32 AM Naty Mina  wrote:
>>>
 hi, i'm new in django and trying to create my first project
 i followed the documentation and when i try to execute the django-admin
 startproject mysite i get error that 'no django settings specified' and to
 try 'django-admin.py help' instead for usage.
 the problem is when i try to do so, i get again the same error message
 i need help with that.
 i attached file so you can see
 *thank you*

 --
 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 web visit
 https://groups.google.com/d/msgid/django-users/1690dca2-2728-452e-81fe-1458af63ba95%40googlegroups.com
 
 .

>>> --
>>> 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 web visit
>>> https://groups.google.com/d/msgid/django-users/CALYW77hm8aK%2BNPpfPPexB10ikmQ7Y%2BzezZZULe5mDvgLyVYSSQ%40mail.gmail.com
>>> 
>>> .
>>>
>> --
>> 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 web visit
>> https://groups.google.com/d/msgid/django-users/CAEnL_2nXTu13StMpfL8EQR6zwhZ6TmpW8RhHYoH69cc-9xWAog%40mail.gmail.com
>> 
>> .
>>
>
>
> --
> Gabriel Araya Garcia
> GMI - Desarrollo de Sistemas Informáticos
> 99.7721.15.70
>
> --
> 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 web visit
> https://groups.google.com/d/msgid/django-users/CAKVvSDAW0r1hJ7muJ0cEB9NhTwhWVq1O5yCMo1%3D7OsV04nGLtA%40mail.gmail.com
> 
> .
>

-- 
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 web visit 
https://groups.google.com/d/msgid/django-users/CAK-JoTRhFtARycAprSZnOH77GnqUMGNNiArtrUpN__Qj1-%2Bjww%40mail.gmail.com.


Re: django-admin error

2019-08-18 Thread Gabriel Araya Garcia
Hi Daniel:
I have build a little app in Django, but i have two problems:
1) I can not see the tables in ADMIN, but nevertheless y put in admin.py:
from .models import Pacientes
admin.site.register(Pacientes)

But it not run.

2) I can not upload my project to HEROKU, I've follow all the steps for to
do this, but not run
Do you know some cpanel to upload my app for demo only (it have 120 records)

Please, can you help about this?

Thanks
(excusme my english, my native language is spanish)

El sáb., 17 ago. 2019 a las 18:38, Daniel Agbaji ()
escribió:

> Please check to see it you got install Django properly with the version of
> Python you are using.
>
> On Sat, Aug 17, 2019, 4:38 PM Muhammad Nadeem 
> wrote:
>
>> FIRST U NEED TO START A NEW PROJECT USING FOLLOWING CODE:
>> django-admin startproject mysite
>> WHERE "mysite" is the name of your project. you can change this name as
>> you desired.
>>
>>
>> if further u have any error fell free ping me
>>
>>
>> On Sun, Aug 18, 2019 at 1:32 AM Naty Mina  wrote:
>>
>>> hi, i'm new in django and trying to create my first project
>>> i followed the documentation and when i try to execute the django-admin
>>> startproject mysite i get error that 'no django settings specified' and to
>>> try 'django-admin.py help' instead for usage.
>>> the problem is when i try to do so, i get again the same error message
>>> i need help with that.
>>> i attached file so you can see
>>> *thank you*
>>>
>>> --
>>> 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 web visit
>>> https://groups.google.com/d/msgid/django-users/1690dca2-2728-452e-81fe-1458af63ba95%40googlegroups.com
>>> 
>>> .
>>>
>> --
>> 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 web visit
>> https://groups.google.com/d/msgid/django-users/CALYW77hm8aK%2BNPpfPPexB10ikmQ7Y%2BzezZZULe5mDvgLyVYSSQ%40mail.gmail.com
>> 
>> .
>>
> --
> 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 web visit
> https://groups.google.com/d/msgid/django-users/CAEnL_2nXTu13StMpfL8EQR6zwhZ6TmpW8RhHYoH69cc-9xWAog%40mail.gmail.com
> 
> .
>


-- 
Gabriel Araya Garcia
GMI - Desarrollo de Sistemas Informáticos
99.7721.15.70

-- 
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 web visit 
https://groups.google.com/d/msgid/django-users/CAKVvSDAW0r1hJ7muJ0cEB9NhTwhWVq1O5yCMo1%3D7OsV04nGLtA%40mail.gmail.com.


Re: AttributeError 'QuerySet' object has no attribute '_meta'

2019-08-18 Thread Kean Dumba
Ok thanks is there a way to call all objects, as this is more user friendly
and efficient when potentially editing many object fields?

On Sun, 18 Aug 2019 at 18:05, Daniel Roseman  wrote:

> You can't pass *all* the objects to the form. You have to get the specific
> one you want to edit and pass that as the instance.
>
> --
> 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 web visit
> https://groups.google.com/d/msgid/django-users/e78cfd54-9800-4c17-b8a4-0ffaf5ddcfd4%40googlegroups.com
> .
>

-- 
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 web visit 
https://groups.google.com/d/msgid/django-users/CAKvrVZO_rKiPOm9ZLZ%2BmiUpTgUy-xim%2Br7s8kRWskThHtndjpw%40mail.gmail.com.


AttributeError 'QuerySet' object has no attribute '_meta'

2019-08-18 Thread Daniel Roseman
You can't pass *all* the objects to the form. You have to get the specific one 
you want to edit and pass that as the instance.

-- 
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 web visit 
https://groups.google.com/d/msgid/django-users/e78cfd54-9800-4c17-b8a4-0ffaf5ddcfd4%40googlegroups.com.


AttributeError 'QuerySet' object has no attribute '_meta'

2019-08-18 Thread Kean
Hi,

New to Django but trying to stick with it.

I have created a model form, which creates ok.

I am trying to edit records. I have the following, but keep getting the 
QuerySet object has no attribute '_meta' in the browser.

my views.py

def editbusiness(request):
data = models.Businessownercreate.objects.all() 
if request.method == "POST": 
form = forms.Businessownercreate(request.POST, instance=data)
if form.is_valid():
form.save()
return redirect("accounts:editremovebusiness")
else: 
form = forms.Businessownercreate(instance=data)
return render(request, 'editbusiness.html', context={ 'form':form })

my forms.py 

class Businessownercreate(forms.ModelForm):
class Meta:
model = Businessownercreate
fields = [ "Creator", "Micro_Small_Medium", "Business_Name", 
"Owner_Firstname", 
"Owner_Surname", "Companies_House_Number", "Address_Line_1", 
"Address_Line_2",
"Town", "City", "County", "Postcode", "Email", "Phone", "Mobile" ]

I'm have defined the meta, so i can't see why the query cant return the 
objects from the model to the form in this instance.

Please can anyone advise or help?

Best,

K



-- 
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 web visit 
https://groups.google.com/d/msgid/django-users/5e4d57f1-e41b-4692-8814-1c1888e563dc%40googlegroups.com.


Re: DeferredAttribute object in form

2019-08-18 Thread Kean
Hi Salimon, 

Thank you for the code and help.
When I update to your code I get the following error in the browser

Exception Type: AttributeError
Exception Value:
'ModelFormOptions' object has no attribute 'concrete_fields'
Im not sure why 

my models.py

class Businessownercreate(models.Model):
Creator = models.CharField(max_length=20)
Micro_Small_Medium = models.CharField(max_length=6)
Business_Name = models.CharField(max_length=20)
Owner_Firstname = models.CharField(max_length=20)
Owner_Surname = models.CharField(max_length=20)
Companies_House_Number = models.CharField(max_length=8)
Address_Line_1 = models.CharField(max_length=30)
Address_Line_2 = models.CharField(max_length=30)
Town = models.CharField(max_length=20)
City = models.CharField(max_length=20)
County = models.CharField(max_length=20)
Postcode = models.CharField(max_length=10)
Email = models.EmailField(max_length=50)
Phone = models.CharField(max_length=15)
Mobile = models.CharField(max_length=15)
Created_date = models.DateTimeField(auto_now_add=True)

def __str__(self):
return self(Creator)

Pls advise if this is an error with my model?

Best,

K

On 18 Aug 2019, at 01:47, salimon jamiu olashile  
wrote:

> It seems the model & form class names are clashing. If you want use the same 
> name, you can import each module as a whole.
> 
> Edited:
> 
> from . import models, forms
> 
> def editbusiness(request):
>   data = models.Businessownercreate.objects.all() 
>   if request.method == "POST":
>   form = forms.Businessownercreate(request.POST, 
> instance=Businessownercreate)
>   if form.is_valid():
>   form.save()
>   return redirect("accounts:editremovebusiness")
>   else:
>   form = forms.Businessownercreate(instance=Businessownercreate)
>   return render(request, 'editbusiness.html', { 'form':form })
> 
> -- 
> 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 web visit 
> https://groups.google.com/d/msgid/django-users/CAFhdOCNUFeHnuF409CZQ%2BL9dB-p-D6CU3s_sso%2BGsZhsOqX3cg%40mail.gmail.com.

-- 
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 web visit 
https://groups.google.com/d/msgid/django-users/C362552D-AF16-419A-8A6A-AF378822DB75%40gmail.com.


Re: django-admin error

2019-08-18 Thread Mituka Devlin Bwanausi
I recommend this: 
https://www.udemy.com/the-ultimate-beginners-guide-to-django-django-2-python-web-dev-website/

Django 2.2 & Python | The Ulitmate Web Development Bootcamp.

Good lectures and easy to grasp as you will also get through a python 
refresher before you get right into Django. 

On Sunday, August 18, 2019 at 2:18:27 PM UTC+2, Arjun Reddy wrote:
>
> Hi
>>
> I would like to start learning Django and can anyone suggest tutorial is 
> best for beginners.
>

-- 
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 web visit 
https://groups.google.com/d/msgid/django-users/22da02d9-2cb6-4ab4-990f-ec31af83a1dd%40googlegroups.com.


Re: django-admin error

2019-08-18 Thread Mituka Devlin Bwanausi
Type it all in one line.like this "*django-admin startproject mysite*"

Your screen shot shows you trying to do things separately.

On Saturday, August 17, 2019 at 10:33:43 PM UTC+2, Naty Mina wrote:
>
> hi, i'm new in django and trying to create my first project 
> i followed the documentation and when i try to execute the django-admin 
> startproject mysite i get error that 'no django settings specified' and to 
> try 'django-admin.py help' instead for usage.
> the problem is when i try to do so, i get again the same error message 
> i need help with that.
> i attached file so you can see
> *thank you* 
>

-- 
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 web visit 
https://groups.google.com/d/msgid/django-users/7ed0262d-e935-4c91-a461-22428069b8e1%40googlegroups.com.


How to refresh part of a Django page with AJAX?

2019-08-18 Thread Xiaoyun Huang


I am deploying a website using Django. There is an application called 
'forum', supporting a discussion forum on my website.

The url of the discussion forum is 'XXX.com/forum/roomY'. I want to refresh 
a div id = ''chat'', which includes a message list, on this page when users 
click a refresh button. I want to use AJAX to do that.


But I find that I could not call the function updatestatementlist(request) 
to retrieve the updated message list so it can be passed to the on this 
page.


*/forum/views.py def updatestatementlist(request):*

log.debug("call statementlist function")
statements = Statement.objects.filter(discussion=discussion)return 
render(request, 'forum/statementlist.html', {
'statements': statements
})


I cannot see the log info so I think by clicking the button I fail to call 
this function.


The main html page of the discussion forum is */forum/discussion.html*, 
which is under the template folder. I extract the html code within the div 
id = "chat" to a separate html */forum/statementlist.html*as suggested here 

 and 
several other SO posts.


*/forum/discussion.html*

 Refresh 
{% include 'forum/statementlist.html' %}

*/forum/statementlist.html*

{% recursetree statements %}{% endrecursetree %}

*forum.js*

//When users click the refresh button
$("#Refresh").on("click", function(event){
alert("Refresh clicked")
$.ajax({
url: '',
type: "GET",
success: function(data) {
alert("success")
var html = $(data).filter('#chat').html();
$('#chat').html(html);
}
});});


I also tried a few other url in this AJAX request: {% url 
updatestatementlist %}, {% url 'updatestatementlist' %}. But then I think 
it should be set to empty because I don't want to be redirected to another 
url. The discussion forum has a url of 'XXX.com/forum/roomY', by clicking 
the refresh button on this page I only want to refresh the div and fetch an 
updated statement list from the server.


BTW, I can see the two alerts after I click the button.


*/forum/urls.py*

urlpatterns = [...
url(r'^(?P[\w-]{,50})/$', views.discussion_forum, 
name='discussion_forum'),
url(r'^(?P[\w-]{,50})/$', views.statementlist, name='statementlist'),

]


/forum/views.py def discussion_forum() is used to load all the information 
when the user first arrives at this forum.


I guess my problem might be that 1) the AJAX is wrong; 2) the url is wrong 
so that the updatestatementlist() can not be called.


Can anyone help me with that? Thank you so much.

-- 
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 web visit 
https://groups.google.com/d/msgid/django-users/e8cf17fa-a7f7-4002-86dc-4b2460a3e140%40googlegroups.com.


Re: django-admin error

2019-08-18 Thread Arjun Reddy
>
> Hi
>
I would like to start learning Django and can anyone suggest tutorial is
best for beginners.

-- 
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 web visit 
https://groups.google.com/d/msgid/django-users/CALusEWOJFids%2BP0KibXn4RgBQsrPYKKb2E8EzUxD8yqG5dk17g%40mail.gmail.com.


django-users@googlegroups.com

2019-08-18 Thread Mudasir Mian
guys im facing this error 

everything is working good unless i add carousel code copied from 
bootstrap4 site


-- 
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 web visit 
https://groups.google.com/d/msgid/django-users/d9c5c82b-ed8b-4cf3-8360-d54e1e7f624f%40googlegroups.com.


error

2019-08-18 Thread Mudasir Mian
hey im facing this error can you please help me out from this

everything is goes smoothly unless i add carousel code imoort from bootstrap4

[Mudasir Mian - Chat @ 
Spike](https://www.spikenow.com/?ref=spike-organic-signature&_ts=4etdn)  [4etdn]

-- 
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 web visit 
https://groups.google.com/d/msgid/django-users/c-1fad7-jzguth2f-7cno3l%3D1fym5vt%402.gethop.com.