re_path(r'^admin/filebrowser/', fbsite.urls) - ValueError

2020-05-07 Thread Mike Dewhirst

Can anyone help with this please?

  File "/var/www/train/train/urls.py", line 49, in 
    re_path(r'^admin/filebrowser/', fbsite.urls),
  File "/usr/local/lib/python3.6/dist-packages/django/urls/conf.py", 
line 61, in _path

    urlconf_module, app_name, namespace = view
ValueError: not enough values to unpack (expected 3, got 2)

The code below works in Windows 10 in development but refuses to load 
during deployment with the above error.


Thank you for any hints

Cheers

Mike

Here is the problem code which *does* work in Windows as per the 
Filebrowser docco[1][2] ...


from filebrowser.sites import site

urlpatterns = [

    # # # filebrowser/tinymce pre-admin # # # # # # # # # # # # # # # # 
# # # #


    path('admin/filebrowser/', site.urls),

    ...



Here is the Windows freeze info ...

bleach==3.1.4
certifi==2020.4.5.1
chardet==3.0.4
coverage==5.1
Django==2.2.12
django-debug-toolbar==2.2
django-filebrowser-no-grappelli==3.7.8        ### same as Ubuntu 18.04 below
django-tinymce4-lite==1.7.5
docutils==0.16
idna==2.7
jsmin==2.2.2
Pillow==5.1.1
psycopg2==2.7.4
pwned-passwords-django==1.4
pytz==2019.3
requests==2.23.0
six==1.11.0
sqlparse==0.3.0
stripe==2.46.0
urllib3==1.23
webencodings==0.5.1

... and Ubuntu 18.04 in production ...

bleach==3.1.0
chardet==3.0.4
Django==2.2.12
django-csp==3.6
django-filebrowser-no-grappelli==3.7.8   ### same as Windows 10 above
django-referrer-policy==1.0
django-tinymce4-lite==1.7.5
docutils==0.14
idna==2.6
jsmin==2.2.2
Pillow==6.0.0
psycopg2==2.7.4
pwned-passwords-django==1.3.2
pytz==2019.1
requests==2.21.0
six==1.11.0
sqlparse==0.3.0
stripe==2.29.4
urllib3==1.22
webencodings==0.5.1

[1] https://django-filebrowser.readthedocs.io/en/latest/quickstart.html
[2] https://github.com/smacker/django-filebrowser-no-grappelli

--
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/0989007e-6712-bb2c-14b8-689589f95eee%40dewhirst.com.au.


Watch "How to use domain email with gmail account - connect send and receive emails in few steps" on YouTube

2020-05-07 Thread Anonymous Patel
https://youtu.be/-_MYP6m37SA

Raj Patel

-- 
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/CAF_9Cisy8knhyG%2BPcOwBsD_BqtyigFSuGvPXssAq85DrpxTDEg%40mail.gmail.com.


Re: How to send dict to template and use it

2020-05-07 Thread Andréas Kühne
Hi,

If you want to see something in the queryset you need to query it :)

For example:

 {% for question in
latest_question_list %} {{question.id }}{%endfor%}

Or you can take the last or first item?
 {{ latest_question_list.first.id }}

Regards,

Andréas


Den tors 7 maj 2020 kl 07:55 skrev Mohsen Pahlevanzadeh <
m.pahlevanza...@gmail.com>:

> I have the following view function:
> 
> def index(request, question_id):
> latest_question_list = User.objects.all() #Post.objects.all()
> template = loader.get_template('posts/index.html')
>  context = {
>'latest_question_list': latest_question_list,
>}
>  return HttpResponse(template.render(context))
> #
> And the following template:
> 
> {% if latest_question_list %}
>
>salaam
>   {{ latest_question_list
> }}
>  {% endif %}
> ###
>
> I see the following result in my browser:
> #
>
> salaam
> ]>
>
>
> ##
>
> How Can I some field in my Queryset in template?
>
> --
> 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/CAJFFGZLhqwkvNVbHtGoU2zG5HdNjy-xbL7NbSTWJxfN0tnaZKQ%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/CAK4qSCc%2BL-uALmAfrfGYKGUuyEHUK%2BAW7fgg6%2BOPWztbSL-pCg%40mail.gmail.com.


Re: How to omit Admin field verbose name

2020-05-07 Thread Derek
I do something similar but not exactly the same.  Perhaps like this 
(WARNING: untested code) under the class MyModelAdmin:

def get_form(self, request, obj=None, **kwargs):
form = super(MyModelAdminForm, self).get_form(request, obj, 
**kwargs)
if form.base_fields:
form.base_fields['currency'].label = get_regional_currency()  # 
or other method...
return form


On Wednesday, 6 May 2020 03:37:59 UTC+2, Mike Dewhirst wrote:
>
> One of my Admin forms has a price field and the currency and symbol 
> depend on the selected region. 
>
> I would like to display (readonly) just the field content for currency 
> and symbol for example ... 
>
> "AUD $ [   222.22]" 
>
> ... but all I can achieve at the moment is ... 
>
> "Currency: AUD Symbol:$   [   
> 222.22]" 
>
> Is there a technique for this? 
>
> I have checked the docs and found I can use a callable but that just 
> uses the callable name as the verbose_name. 
>
> I have tried making verbose_name="" in the model but that still displays 
> the colon and lots of spaces. 
>
> I expect I'll need to use my own form somehow but I'd prefer something 
> simpler. 
>
> Any hints greatly appreciated 
>
> Cheers 
>
> Mike 
>

-- 
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/48adbb40-11d4-47d7-bba1-e068d5ae523f%40googlegroups.com.


Re: How to make Custom User Registration and Login

2020-05-07 Thread Anubhav Madhav
Thankyou so much Kushal!!

On Wednesday, 6 May 2020 20:47:39 UTC+5:30, Kushal Neupane wrote:
>
> For you following web pages or video will help you.
>
> https://simpleisbetterthancomplex.com/tutorial/2017/02/18/how-to-create-user-sign-up-view.html
>  
> https://www.youtube.com/watch?v=oZUb372g6Do 
> https://docs.djangoproject.com/en/3.0/topics/auth/customizing/ 
> https://testdriven.io/blog/django-custom-user-model/ 
>
> https://www.codingforentrepreneurs.com/blog/how-to-create-a-custom-django-user-model
>  
>
> On Wed, May 6, 2020 at 8:57 PM Camilo Garcia  > wrote:
>
>> This might come in handy 
>> https://learndjango.com/tutorials/django-custom-user-model
>>
>> On Wednesday, May 6, 2020 at 5:09:29 AM UTC-5, Anubhav Madhav wrote:
>>>
>>> I am new to Django. I need to make a custom sign up and log in page. 
>>> Because, during Sign Up, I also want to get User's Address and Contact 
>>> Number. In Django's 'User' module, it isn't supported. So, how can I make a 
>>> custom sign up and sign in page. Please Help!! 
>>
>> -- 
>> 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...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/408862b0-3958-4484-a989-9ede6aa57a59%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/db502671-1510-47b8-97d0-163d879b7558%40googlegroups.com.


Re: How to make Custom User Registration and Login

2020-05-07 Thread Anubhav Madhav
Thankyou Camilo!!

On Wednesday, 6 May 2020 20:42:10 UTC+5:30, Camilo Garcia wrote:
>
> This might come in handy 
> https://learndjango.com/tutorials/django-custom-user-model
>
> On Wednesday, May 6, 2020 at 5:09:29 AM UTC-5, Anubhav Madhav wrote:
>>
>> I am new to Django. I need to make a custom sign up and log in page. 
>> Because, during Sign Up, I also want to get User's Address and Contact 
>> Number. In Django's 'User' module, it isn't supported. So, how can I make a 
>> custom sign up and sign in page. Please Help!! 
>
>

-- 
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/f22d6b6b-a396-4e21-a268-9374cb014557%40googlegroups.com.


Nonetype object is not subscriptable

2020-05-07 Thread sharu kuriakose
Hi guys...  iam new to django
Can you please help me to solve my problem. 


I need to work with openCv function cv2.imread(image_src)
But when i work with that function, iam getting an error
"Nonetype object is not subscriptable"

-- 
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/c1baf1fc-b5b4-4bcd-bbb5-80f9935598e5%40googlegroups.com.


Django tutorial, HttpResponseRedirect, sending multiple arguments

2020-05-07 Thread Ekberg Peter
 

I know something like this has been asked before but I never seen any 
answer that I can understand or that works. But I am very new on Django so 
maybe I could have missed it. But there must be an easy answer to my 
question. I am following the tutorial for Django and at section 4 they use 
the httpresponseredirect to go to next page after posting a form.


return HttpResponseRedirect(reverse('polls:results', args=(question.id,)))

The views page function looks like this: 


def detail(request, question_id):

My question is: How can I send more arguments than the question.id to the 
function? 

Thx

-- 
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/5be13b82-36e5-4939-a822-a0b56b6dee66%40googlegroups.com.


How to display pie chart using Django

2020-05-07 Thread ratnadeep ray
Hi all, 

I just started to work on Django and hence have limited knowledge about it. 

Now I need to design an app to display a pie chart based on some sample 
data. Can anybody please help me to do so? Is there any sample app existing 
which fulfills this requirement ? 

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 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/84036bfa-ddfb-451b-98ff-27fffcfb151c%40googlegroups.com.


Re: No module named 'blog'

2020-05-07 Thread Mukesh Badgujar
already added

'home.apps.HomeConfig',
'blog.apps.BlogConfig',
'shop.apps.shopConfig',

one thing is that, i copied this app folder frm my other project, this is 
not created here


On Sunday, 9 August 2015 22:43:38 UTC+5:30, Robin Lery wrote:
>
> Did you add your 'blog' app in the installed apps in settings.py?
>
> On Sun, Aug 9, 2015 at 10:35 PM, Maggie Chang  > wrote:
>
>> hi all,
>> would like to seek for everyone's help.
>> I am following the django girls instruction => 
>> http://tutorial.djangogirls.org/en/django_urls/index.html#your-first-django-url,
>>  
>> but encounter the problem. 
>> when I connect to 127.0.0.1:8000, I got the No module named 'blog' 
>> response.
>> Here's the message on browser.
>> **
>> ImportError at /
>>
>> No module named 'blog'
>>
>> Request Method: GET
>> Request URL: http://127.0.0.1:8000/
>> Django Version: 1.8
>> Exception Type: ImportError
>> Exception Value: 
>>
>> No module named 'blog'
>>
>> Exception Location: /usr/lib/python3.4/importlib/__init__.py in 
>> import_module, line 109
>> Python Executable: /home/maggie/djangoanywhere/venv/bin/python
>> Python Version: 3.4.0
>> Python Path: 
>>
>> ['/home/maggie/djangoanywhere',
>>  '/usr/lib/python3.4',
>>  '/usr/lib/python3.4/plat-x86_64-linux-gnu',
>>  '/usr/lib/python3.4/lib-dynload',
>>  '/home/maggie/djangoanywhere/venv/lib/python3.4/site-packages']
>>
>> Server time: Mon, 10 Aug 2015 00:47:53 +0800
>> **
>>
>> This issue occurred when I add *url(r'', include('blog.urls')), *into 
>> *magsite/url.py*
>> **
>> *url.py*
>> **
>> from django.conf.urls import include, url
>> from django.contrib import admin
>>
>>
>> urlpatterns = [
>> url(r'^admin/', include(admin.site.urls)),
>> url(r'', include('blog.urls')),
>> ]
>> **
>> Any idea about the root cause? :(
>> and any response will be appreciate.
>>
>> -- 
>> 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...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com 
>> .
>> Visit this group at http://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/0c3ba90d-97d3-448c-8656-0b2ad6becca7%40googlegroups.com
>>  
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
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/4a25e83a-0f62-4f60-8401-618252682a22%40googlegroups.com.


User.objects.all() returns only one field

2020-05-07 Thread Mohsen Pahlevanzadeh
User.objects.all() only returns one field, I need to others fields
such as first_name or last_name.

How can I access others field?

-- 
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/CAJFFGZ%2BG84ORqhqgCDDN8jTQdNSpt_XUZMLRaO9LXb%3D1fc158Q%40mail.gmail.com.


Re: Django tutorial, HttpResponseRedirect, sending multiple arguments

2020-05-07 Thread Andréas Kühne
Hi Peter,

The thing is you need to handle this with your url files, your view
function (or class) and your reverse call.

So for example:

urls.py

path('blog///', detail)

views.py:

def detail(request, category, question_id):

and finally the call to reverse:

reverse('polls:results', args=(category.slug, question.id, ))

Something like that.

All of this is connected - so you need to do all of it. However if you only
want to get a url parameter, you can do so via the request object:

For example:

blog/category_slug/23/?shoe_size=42

to get the shoe_sizer you get it in the view:

def detail(request, category, question_id):
 shoe_size = request.GET.get('shoe_size')


Hope this helps!

Regards,

Andréas


Den tors 7 maj 2020 kl 12:39 skrev Ekberg Peter :

> I know something like this has been asked before but I never seen any
> answer that I can understand or that works. But I am very new on Django so
> maybe I could have missed it. But there must be an easy answer to my
> question. I am following the tutorial for Django and at section 4 they use
> the httpresponseredirect to go to next page after posting a form.
>
>
> return HttpResponseRedirect(reverse('polls:results', args=(question.id,)))
>
> The views page function looks like this:
>
>
> def detail(request, question_id):
>
> My question is: How can I send more arguments than the question.id to the
> function?
>
> Thx
>
> --
> 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/5be13b82-36e5-4939-a822-a0b56b6dee66%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/CAK4qSCfNA1S3hTqkEJ%3DwwqoB3iSS6EOS%3Duhubu3m%2BprVaFbGmw%40mail.gmail.com.


Re: Django URL routing

2020-05-07 Thread ROBSON SOUZA
You are missing parenteses right after as_view in urls.py 

Enviado do meu iPhone

Em 7 de mai de 2020, à(s) 03:22, Ronald Kamulegeya 
 escreveu:

> I am learning Django and progressing well but i am stuck on how to configure 
> the different urls to view functions. 
> I have gone through tutorials and URL routing seems pretty straight forward 
> but i cant make it work in my apps.
> 
> I am almost hitting a brick wall. I dont see anything wrong i have done.
> 
> What happens is that the index view and admin interface opens.
> 
> But connecting from the index view to other pages raises the 404 error.
> 
> 
> 
> I created a project TenancyMGt and added  app rentals as shown above.
> I have created several views in the module views.py Two are relevant here:
> def createTenant(request):
> form = TenantsForm
> context = {'form': form}
> html_form = render_to_string('rentals/partial_tenant_create.html',
> context,
> request=request,
> )
> return JsonResponse({'html_form': html_form})
> class TenantsListView(ListView):
> model = Tenants
> context_object_name = 'tenant_list'
> template_name = 'rentals/tenants_list.html'
> paginate_by = 5
> def get_queryset(self):
> return Tenants.objects.all()
> Now i created a file urls.py under the app rentals:
> from . import views
> from django.urls import path
> app_name='rentals'
> urlpatterns = [
> path("", views.TenantsListView.as_view(), name="index"),
> path("",views.TenantDetailView.as_view,name="detail"),
> path("",views.createTenant, name='createTenant'), 
> path("/",views.TenantUpdateView.as_view, name='edit'),
> path("/",views.delete, name='delete'),
> 
> ]
> under TenancyMgr/urls, i add the following:
> from django.contrib import admin
> from django.urls import path,include
> from rentals import views
> 
> urlpatterns = [
> path('admin/', admin.site.urls),
> path('', include('rentals.urls')),
> 
> ]
> When i run the server, the index view opens successfully! From the index, i 
> want to open the createTenant view as below.
> 
>   New Tenant
> 
> When the button is clicked, i get the urls below:
> http://127.0.0.1:8000/rentals/createTenant/
> Then i get the response is 404,page not found error.
> But this opens admin page:
> http://127.0.0.1:8000/admin/
> So far i have failed to crack the secret of how the Urls work. I have gone 
> through several tutorials and i see the same set up as mine.
> 
> I am requesting for guidance on how to crack the puzzle i.e make the other 
> urls work.
> 
> Ronald
> 
> -- 
> 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/29c8fdd0-5c82-4ccf-98f9-33e05b8e5ab1%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/1AD1D392-7270-48A8-97D2-E8C1E5C31214%40gmail.com.


Re: Django URL routing

2020-05-07 Thread Daniel Roseman
You have multiple URLs that are the same path. That can't work. One URL 
maps to one view.
-- 
DR.

On Thursday, 7 May 2020 11:40:09 UTC+1, Ronald Kamulegeya wrote:
>
> I am learning Django and progressing well but i am stuck on how to 
> configure the different urls to view functions. 
> I have gone through tutorials and URL routing seems pretty 
> straight forward but i cant make it work in my apps.
>
> I am almost hitting a brick wall. I dont see anything wrong i have done.
>
> What happens is that the index view and admin interface opens.
>
> But connecting from the index view to other pages raises the 404 error.
>
> [image: project-s.png]
> I created a project TenancyMGt and added  app rentals as shown above.
> I have created several views in the module views.py Two are relevant here:
>
> def createTenant(request):
> form = TenantsForm
> context = {'form': form}
> html_form = render_to_string('rentals/partial_tenant_create.html',
> context,
> request=request,
> )
> return JsonResponse({'html_form': html_form})class 
> TenantsListView(ListView):
> model = Tenants
> context_object_name = 'tenant_list'
> template_name = 'rentals/tenants_list.html'
> paginate_by = 5
> def get_queryset(self):
> return Tenants.objects.all()
>
> Now i created a file urls.py under the app rentals:
>
> from . import viewsfrom django.urls import path
> app_name='rentals'
> urlpatterns = [
> path("", views.TenantsListView.as_view(), name="index"),
> path("",views.TenantDetailView.as_view,name="detail"),
> path("",views.createTenant, name='createTenant'), 
> path("/",views.TenantUpdateView.as_view, name='edit'),
> path("/",views.delete, name='delete'),
> ]
>
> under TenancyMgr/urls, i add the following:
>
> from django.contrib import adminfrom django.urls import path,includefrom 
> rentals import views
>
> urlpatterns = [
> path('admin/', admin.site.urls),
> path('', include('rentals.urls')),
> ]
>
> When i run the server, the index view opens successfully! From the index, i 
> want to open the createTenant view as below.
>
> 
>   New Tenant
> 
>
> When the button is clicked, i get the urls below:
>
> http://127.0.0.1:8000/rentals/createTenant/
>
> Then i get the response is 404,page not found error.
>
> But this opens admin page:
>
> http://127.0.0.1:8000/admin/
>
> So far i have failed to crack the secret of how the Urls work. I have gone 
> through several tutorials and i see the same set up as mine.
>
> I am requesting for guidance on how to crack the puzzle i.e make the other 
> urls work.
>
> Ronald
>
>

-- 
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/4cc1d70b-119e-4f07-9867-f4c9786fbabc%40googlegroups.com.


Re: User.objects.all() returns only one field

2020-05-07 Thread Daniel Roseman

On Thursday, 7 May 2020 12:47:21 UTC+1, Mohsen Pahlevanzadeh wrote:
>
> User.objects.all() only returns one field, I need to others fields 
> such as first_name or last_name. 
>
> How can I access others field? 
>

No it doesn't. It returns a queryset of objects, each of which has all the 
fields. When you print the entire queryset, it calls the `__repr__` method 
of each element.
-- 
DR.

-- 
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/ecc703ce-fc40-4533-a7ea-564ba7c870f7%40googlegroups.com.


Re: How to display pie chart using Django

2020-05-07 Thread Larry Martell
On Thu, May 7, 2020 at 6:39 AM ratnadeep ray  wrote:
>
> Hi all,
>
> I just started to work on Django and hence have limited knowledge about it.
>
> Now I need to design an app to display a pie chart based on some sample data. 
> Can anybody please help me to do so? Is there any sample app existing which 
> fulfills this requirement ?

You need to choose a charting package, such as google charts or
plotly, then in your python code get the data you want to chart and
pass it to your template and in the template write some javascript
code to render the chart. Googling django pie chart should give you
examples.

-- 
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/CACwCsY4kL4gb8feawyTQcpMskU3HbP7c%2B4%2BFdkoUCtk6bhMZXA%40mail.gmail.com.


Re: Django URL routing

2020-05-07 Thread LGBS fine soul coders
Yaaahhh

On Thu, 7 May 2020, 15:24 Daniel Roseman,  wrote:

> You have multiple URLs that are the same path. That can't work. One URL
> maps to one view.
> --
> DR.
>
> On Thursday, 7 May 2020 11:40:09 UTC+1, Ronald Kamulegeya wrote:
>>
>> I am learning Django and progressing well but i am stuck on how to
>> configure the different urls to view functions.
>> I have gone through tutorials and URL routing seems pretty
>> straight forward but i cant make it work in my apps.
>>
>> I am almost hitting a brick wall. I dont see anything wrong i have done.
>>
>> What happens is that the index view and admin interface opens.
>>
>> But connecting from the index view to other pages raises the 404 error.
>>
>> [image: project-s.png]
>> I created a project TenancyMGt and added  app rentals as shown above.
>> I have created several views in the module views.py Two are relevant here:
>>
>> def createTenant(request):
>> form = TenantsForm
>> context = {'form': form}
>> html_form = render_to_string('rentals/partial_tenant_create.html',
>> context,
>> request=request,
>> )
>> return JsonResponse({'html_form': html_form})class 
>> TenantsListView(ListView):
>> model = Tenants
>> context_object_name = 'tenant_list'
>> template_name = 'rentals/tenants_list.html'
>> paginate_by = 5
>> def get_queryset(self):
>> return Tenants.objects.all()
>>
>> Now i created a file urls.py under the app rentals:
>>
>> from . import viewsfrom django.urls import path
>> app_name='rentals'
>> urlpatterns = [
>> path("", views.TenantsListView.as_view(), name="index"),
>> path("",views.TenantDetailView.as_view,name="detail"),
>> path("",views.createTenant, name='createTenant'),
>> path("/",views.TenantUpdateView.as_view, name='edit'),
>> path("/",views.delete, name='delete'),
>> ]
>>
>> under TenancyMgr/urls, i add the following:
>>
>> from django.contrib import adminfrom django.urls import path,includefrom 
>> rentals import views
>>
>> urlpatterns = [
>> path('admin/', admin.site.urls),
>> path('', include('rentals.urls')),
>> ]
>>
>> When i run the server, the index view opens successfully! From the index, i 
>> want to open the createTenant view as below.
>>
>> 
>>   New Tenant
>> 
>>
>> When the button is clicked, i get the urls below:
>>
>> http://127.0.0.1:8000/rentals/createTenant/
>>
>> Then i get the response is 404,page not found error.
>>
>> But this opens admin page:
>>
>> http://127.0.0.1:8000/admin/
>>
>> So far i have failed to crack the secret of how the Urls work. I have gone 
>> through several tutorials and i see the same set up as mine.
>>
>> I am requesting for guidance on how to crack the puzzle i.e make the other 
>> urls work.
>>
>> Ronald
>>
>> --
> 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/4cc1d70b-119e-4f07-9867-f4c9786fbabc%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/CAKNQJk5xgmPLPA7-Drhtgc4andjuZ8yqh3sbAMaQ25zDATG-DA%40mail.gmail.com.


Re: No module named 'blog'

2020-05-07 Thread Mohsen Pahlevanzadeh
Where did you import your module?

On Thu, May 7, 2020 at 3:09 PM Mukesh Badgujar 
wrote:

> already added
>
> 'home.apps.HomeConfig',
> 'blog.apps.BlogConfig',
> 'shop.apps.shopConfig',
>
> one thing is that, i copied this app folder frm my other project, this is
> not created here
>
>
> On Sunday, 9 August 2015 22:43:38 UTC+5:30, Robin Lery wrote:
>>
>> Did you add your 'blog' app in the installed apps in settings.py?
>>
>> On Sun, Aug 9, 2015 at 10:35 PM, Maggie Chang 
>> wrote:
>>
>>> hi all,
>>> would like to seek for everyone's help.
>>> I am following the django girls instruction =>
>>> http://tutorial.djangogirls.org/en/django_urls/index.html#your-first-django-url,
>>> but encounter the problem.
>>> when I connect to 127.0.0.1:8000, I got the No module named 'blog'
>>> response.
>>> Here's the message on browser.
>>> **
>>> ImportError at /
>>>
>>> No module named 'blog'
>>>
>>> Request Method: GET
>>> Request URL: http://127.0.0.1:8000/
>>> Django Version: 1.8
>>> Exception Type: ImportError
>>> Exception Value:
>>>
>>> No module named 'blog'
>>>
>>> Exception Location: /usr/lib/python3.4/importlib/__init__.py in
>>> import_module, line 109
>>> Python Executable: /home/maggie/djangoanywhere/venv/bin/python
>>> Python Version: 3.4.0
>>> Python Path:
>>>
>>> ['/home/maggie/djangoanywhere',
>>>  '/usr/lib/python3.4',
>>>  '/usr/lib/python3.4/plat-x86_64-linux-gnu',
>>>  '/usr/lib/python3.4/lib-dynload',
>>>  '/home/maggie/djangoanywhere/venv/lib/python3.4/site-packages']
>>>
>>> Server time: Mon, 10 Aug 2015 00:47:53 +0800
>>> **
>>>
>>> This issue occurred when I add *url(r'', include('blog.urls')), *into
>>> *magsite/url.py*
>>> **
>>> *url.py*
>>> **
>>> from django.conf.urls import include, url
>>> from django.contrib import admin
>>>
>>>
>>> urlpatterns = [
>>> url(r'^admin/', include(admin.site.urls)),
>>> url(r'', include('blog.urls')),
>>> ]
>>> **
>>> Any idea about the root cause? :(
>>> and any response will be appreciate.
>>>
>>> --
>>> 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...@googlegroups.com.
>>> To post to this group, send email to django...@googlegroups.com.
>>> Visit this group at http://groups.google.com/group/django-users.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/0c3ba90d-97d3-448c-8656-0b2ad6becca7%40googlegroups.com
>>> 
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>> --
> 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/4a25e83a-0f62-4f60-8401-618252682a22%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/CAJFFGZLyEOZBqbdVULzD8xR6abjfvy8VoMaO4War133B3FeDXQ%40mail.gmail.com.


Re: Django URL routing

2020-05-07 Thread Ronald Kamulegeya
Hello Roseman,
Please suggest how i can code the different Urls.


On Thursday, May 7, 2020 at 3:24:28 PM UTC+3, Daniel Roseman wrote:
>
> You have multiple URLs that are the same path. That can't work. One URL 
> maps to one view.
> -- 
> DR.
>
> On Thursday, 7 May 2020 11:40:09 UTC+1, Ronald Kamulegeya wrote:
>>
>> I am learning Django and progressing well but i am stuck on how to 
>> configure the different urls to view functions. 
>> I have gone through tutorials and URL routing seems pretty 
>> straight forward but i cant make it work in my apps.
>>
>> I am almost hitting a brick wall. I dont see anything wrong i have done.
>>
>> What happens is that the index view and admin interface opens.
>>
>> But connecting from the index view to other pages raises the 404 error.
>>
>> [image: project-s.png]
>> I created a project TenancyMGt and added  app rentals as shown above.
>> I have created several views in the module views.py Two are relevant here:
>>
>> def createTenant(request):
>> form = TenantsForm
>> context = {'form': form}
>> html_form = render_to_string('rentals/partial_tenant_create.html',
>> context,
>> request=request,
>> )
>> return JsonResponse({'html_form': html_form})class 
>> TenantsListView(ListView):
>> model = Tenants
>> context_object_name = 'tenant_list'
>> template_name = 'rentals/tenants_list.html'
>> paginate_by = 5
>> def get_queryset(self):
>> return Tenants.objects.all()
>>
>> Now i created a file urls.py under the app rentals:
>>
>> from . import viewsfrom django.urls import path
>> app_name='rentals'
>> urlpatterns = [
>> path("", views.TenantsListView.as_view(), name="index"),
>> path("",views.TenantDetailView.as_view,name="detail"),
>> path("",views.createTenant, name='createTenant'), 
>> path("/",views.TenantUpdateView.as_view, name='edit'),
>> path("/",views.delete, name='delete'),
>> ]
>>
>> under TenancyMgr/urls, i add the following:
>>
>> from django.contrib import adminfrom django.urls import path,includefrom 
>> rentals import views
>>
>> urlpatterns = [
>> path('admin/', admin.site.urls),
>> path('', include('rentals.urls')),
>> ]
>>
>> When i run the server, the index view opens successfully! From the index, i 
>> want to open the createTenant view as below.
>>
>> 
>>   New Tenant
>> 
>>
>> When the button is clicked, i get the urls below:
>>
>> http://127.0.0.1:8000/rentals/createTenant/
>>
>> Then i get the response is 404,page not found error.
>>
>> But this opens admin page:
>>
>> http://127.0.0.1:8000/admin/
>>
>> So far i have failed to crack the secret of how the Urls work. I have gone 
>> through several tutorials and i see the same set up as mine.
>>
>> I am requesting for guidance on how to crack the puzzle i.e make the other 
>> urls work.
>>
>> Ronald
>>
>>

-- 
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/fd94d9a1-1c90-4544-b795-e4a8f89fb116%40googlegroups.com.


Re: User.objects.all() returns only one field

2020-05-07 Thread Mohammed Alnajdi
User.objects.all() will return a queryset you can put it in a loop such as 

users = User.objects.all()
for user in users:
user.first_name

And also there are other ways to get dict instead of queryset object but its up 
to you.

Sent from my iPhone

> On 7 May 2020, at 2:46 PM, Mohsen Pahlevanzadeh  
> wrote:
> 
> User.objects.all() only returns one field, I need to others fields
> such as first_name or last_name.
> 
> How can I access others field?
> 
> -- 
> 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/CAJFFGZ%2BG84ORqhqgCDDN8jTQdNSpt_XUZMLRaO9LXb%3D1fc158Q%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/ACB66807-3F15-460E-9B0E-AB070F9189D2%40gmail.com.


Re: Create a function which fill automatically a field in my models

2020-05-07 Thread Derek
Its unclear what you mean by "last ID" - and I cannot see the value of 
storing such as they are available in the database...

But have a look at 
https://stackoverflow.com/questions/12649659/how-to-set-a-django-model-fields-default-value-to-a-function-call-callable-e
 

The example is:

from datetime import datetime, timedelta

# default to 1 day from now
def get_default_my_date():
return datetime.now() + timedelta(days=1)

class MyModel(models.Model):
my_date = models.DateTimeField(default=get_default_my_date)


Instead of the date arithmetic, you'd need to write code to, for example, 
extract last ID from the database (assuming you have an auto-increment ID 
set) and do the concatenation.




On Thursday, 7 May 2020 02:23:22 UTC+2, Anselme SERI wrote:
>
> Thanks you for your answer. I know how to make a default value in 
> charfield but I don't know  how to build function which returns value for 
> my default field. In my case this function must retrieve last id on my 
> model and must concataned it with a string and the final result must be 
> affected to default charfield. Have you an example ? Help me plz.
>
> Le mer. 6 mai 2020 à 18:44, Motaz Hejaze > 
> a écrit :
>
>> Yes you can make a normal charfield and assign its default attribute to a 
>> function you declare
>>
>> On Wed, 6 May 2020, 6:53 pm Anselme SERI, > > wrote:
>>
>>> Hi,
>>>
>>> I use Django 3.0 and I would like to create a function which fill 
>>> automatically a field in my models.
>>> Can I do it directly in models.py ? How?
>>>
>>> Thanks a lot
>>>
>>> -- 
>>> 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...@googlegroups.com .
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/django-users/5f810453-c7ca-4c10-bca1-4cfe11ea496a%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...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/CAHV4E-dDRD%3DLteuDo7KuATzjKem-ThvtozzHuaqkwAeAC%2BBrZw%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/48c4d59e-8241-4739-b8df-feab45a7fa3a%40googlegroups.com.


Re: Django URL routing

2020-05-07 Thread Ronald Kamulegeya
Here is my attempt at creating unique path:
Still i get page not found error. The index page is not opening too.
urlpatterns = [
path("tenants/", views.TenantsListView.as_view(), name="index"),
path("tenants/details",views.TenantDetailView.as_view(),name="detail"),
path("tenants/add",views.createTenant, name='createTenant'), 
path("tenants/edit//",views.TenantUpdateView.as_view(), name=
'edit'),
path("tenants/delete//",views.delete, name='delete'),   
 
]
urlpatterns = [
path('', include('rentals.urls',namespace='rentals')),
path('admin/', admin.site.urls),
   
On Thursday, May 7, 2020 at 3:53:44 PM UTC+3, Ronald Kamulegeya wrote:
>
> Hello Roseman,
> Please suggest how i can code the different Urls.
>
>
> On Thursday, May 7, 2020 at 3:24:28 PM UTC+3, Daniel Roseman wrote:
>>
>> You have multiple URLs that are the same path. That can't work. One URL 
>> maps to one view.
>> -- 
>> DR.
>>
>> On Thursday, 7 May 2020 11:40:09 UTC+1, Ronald Kamulegeya wrote:
>>>
>>> I am learning Django and progressing well but i am stuck on how to 
>>> configure the different urls to view functions. 
>>> I have gone through tutorials and URL routing seems pretty 
>>> straight forward but i cant make it work in my apps.
>>>
>>> I am almost hitting a brick wall. I dont see anything wrong i have done.
>>>
>>> What happens is that the index view and admin interface opens.
>>>
>>> But connecting from the index view to other pages raises the 404 error.
>>>
>>> [image: project-s.png]
>>> I created a project TenancyMGt and added  app rentals as shown above.
>>> I have created several views in the module views.py Two are relevant 
>>> here:
>>>
>>> def createTenant(request):
>>> form = TenantsForm
>>> context = {'form': form}
>>> html_form = render_to_string('rentals/partial_tenant_create.html',
>>> context,
>>> request=request,
>>> )
>>> return JsonResponse({'html_form': html_form})class 
>>> TenantsListView(ListView):
>>> model = Tenants
>>> context_object_name = 'tenant_list'
>>> template_name = 'rentals/tenants_list.html'
>>> paginate_by = 5
>>> def get_queryset(self):
>>> return Tenants.objects.all()
>>>
>>> Now i created a file urls.py under the app rentals:
>>>
>>> from . import viewsfrom django.urls import path
>>> app_name='rentals'
>>> urlpatterns = [
>>> path("", views.TenantsListView.as_view(), name="index"),
>>> path("",views.TenantDetailView.as_view,name="detail"),
>>> path("",views.createTenant, name='createTenant'), 
>>> path("/",views.TenantUpdateView.as_view, name='edit'),
>>> path("/",views.delete, name='delete'),
>>> ]
>>>
>>> under TenancyMgr/urls, i add the following:
>>>
>>> from django.contrib import adminfrom django.urls import path,includefrom 
>>> rentals import views
>>>
>>> urlpatterns = [
>>> path('admin/', admin.site.urls),
>>> path('', include('rentals.urls')),
>>> ]
>>>
>>> When i run the server, the index view opens successfully! From the index, i 
>>> want to open the createTenant view as below.
>>>
>>> 
>>>   New Tenant
>>> 
>>>
>>> When the button is clicked, i get the urls below:
>>>
>>> http://127.0.0.1:8000/rentals/createTenant/
>>>
>>> Then i get the response is 404,page not found error.
>>>
>>> But this opens admin page:
>>>
>>> http://127.0.0.1:8000/admin/
>>>
>>> So far i have failed to crack the secret of how the Urls work. I have gone 
>>> through several tutorials and i see the same set up as mine.
>>>
>>> I am requesting for guidance on how to crack the puzzle i.e make the other 
>>> urls work.
>>>
>>> Ronald
>>>
>>>

-- 
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/546fa5a3-f824-438b-b8b2-e986a16b0552%40googlegroups.com.


Re: Django tutorial, HttpResponseRedirect, sending multiple arguments

2020-05-07 Thread Ekberg Peter

Hello Andréas and thank you for the answer. But unfortunately it doesn't 
seem to do what I want or I just don't get it.

What I really try to do is very simple, but I have been trying for two days 
now and feel I am close to give up on Django. Because if the simpliest and 
most common thing in webb application is this hard to understand than I 
must find something else. Passing arguments is the most common thng so I 
can't understand why Django doesn't offer any example. Anyway what I want 
to do is this.

I have this call: 

return HttpResponseRedirect(reverse('bsapp:result', args=(question.id,)))

I suppose this must match This URL path:
path('/result', views.result, name = 'result'),

That takes me to this function:
def detail(request, question_id):

>From the reverse call I want to include some extra arguments that I can use in 
>the detail page.
In your example it seems going in wrong order from what I am asking for. You 
have the reverse last, but it is the reverse function that runs first.
But I would appreciate very much if you can make an example from my code here.


Thanks
Peter

-- 
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/b8bf5138-83df-4603-9298-7351e6b0a2b3%40googlegroups.com.


Re: Django tutorial, HttpResponseRedirect, sending multiple arguments

2020-05-07 Thread Ekberg Peter
Hi Again

I finally got it to work now.

return HttpResponseRedirect(reverse('bsapp:result', args=(question.id, xx,)))

path('//result/', views.result,
name='result'), (I think you mixed up the order of int:question
here, you wrote question:int)

xx="EXTRA ARGUMENT"
def result(request, question_id, xx):

Thanks for your help, I appreciate it very much.

Peter


Den tors 7 maj 2020 kl 14:06 skrev Andréas Kühne :

> Hi Peter,
>
> The thing is you need to handle this with your url files, your view
> function (or class) and your reverse call.
>
> So for example:
>
> urls.py
>
> path('blog///', detail)
>
> views.py:
>
> def detail(request, category, question_id):
>
> and finally the call to reverse:
>
> reverse('polls:results', args=(category.slug, question.id, ))
>
> Something like that.
>
> All of this is connected - so you need to do all of it. However if you
> only want to get a url parameter, you can do so via the request object:
>
> For example:
>
> blog/category_slug/23/?shoe_size=42
>
> to get the shoe_sizer you get it in the view:
>
> def detail(request, category, question_id):
>  shoe_size = request.GET.get('shoe_size')
>
>
> Hope this helps!
>
> Regards,
>
> Andréas
>
>
> Den tors 7 maj 2020 kl 12:39 skrev Ekberg Peter :
>
>> I know something like this has been asked before but I never seen any
>> answer that I can understand or that works. But I am very new on Django so
>> maybe I could have missed it. But there must be an easy answer to my
>> question. I am following the tutorial for Django and at section 4 they use
>> the httpresponseredirect to go to next page after posting a form.
>>
>>
>> return HttpResponseRedirect(reverse('polls:results', args=(question.id,)))
>>
>> The views page function looks like this:
>>
>>
>> def detail(request, question_id):
>>
>> My question is: How can I send more arguments than the question.id to
>> the function?
>>
>> Thx
>>
>> --
>> 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/5be13b82-36e5-4939-a822-a0b56b6dee66%40googlegroups.com
>> 
>> .
>>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Django users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/django-users/LUyl9dqbybE/unsubscribe.
> To unsubscribe from this group and all its topics, 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/CAK4qSCfNA1S3hTqkEJ%3DwwqoB3iSS6EOS%3Duhubu3m%2BprVaFbGmw%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/CAAkB%2BwmcyEJFSf4GQbB%2B7RE3o1Q6uHE0Tqm-WSPz0jM3XBStbw%40mail.gmail.com.


Re: Django URL routing

2020-05-07 Thread Ronald Kamulegeya
Hi Roseman,

Your comment pointed me to the right direction.

I have finally cracked the mystery!

Thanks so much!

On Thursday, May 7, 2020 at 5:17:22 PM UTC+3, Ronald Kamulegeya wrote:
>
> Here is my attempt at creating unique path:
> Still i get page not found error. The index page is not opening too.
> urlpatterns = [
> path("tenants/", views.TenantsListView.as_view(), name="index"),
> path("tenants/details",views.TenantDetailView.as_view(),name="detail"
> ),
> path("tenants/add",views.createTenant, name='createTenant'), 
> path("tenants/edit//",views.TenantUpdateView.as_view(), name=
> 'edit'),
> path("tenants/delete//",views.delete, name='delete'),   
>  
> ]
> urlpatterns = [
> path('', include('rentals.urls',namespace='rentals')),
> path('admin/', admin.site.urls),
>
> On Thursday, May 7, 2020 at 3:53:44 PM UTC+3, Ronald Kamulegeya wrote:
>>
>> Hello Roseman,
>> Please suggest how i can code the different Urls.
>>
>>
>> On Thursday, May 7, 2020 at 3:24:28 PM UTC+3, Daniel Roseman wrote:
>>>
>>> You have multiple URLs that are the same path. That can't work. One URL 
>>> maps to one view.
>>> -- 
>>> DR.
>>>
>>> On Thursday, 7 May 2020 11:40:09 UTC+1, Ronald Kamulegeya wrote:

 I am learning Django and progressing well but i am stuck on how to 
 configure the different urls to view functions. 
 I have gone through tutorials and URL routing seems pretty 
 straight forward but i cant make it work in my apps.

 I am almost hitting a brick wall. I dont see anything wrong i have done.

 What happens is that the index view and admin interface opens.

 But connecting from the index view to other pages raises the 404 error.

 [image: project-s.png]
 I created a project TenancyMGt and added  app rentals as shown above.
 I have created several views in the module views.py Two are relevant 
 here:

 def createTenant(request):
 form = TenantsForm
 context = {'form': form}
 html_form = render_to_string('rentals/partial_tenant_create.html',
 context,
 request=request,
 )
 return JsonResponse({'html_form': html_form})class 
 TenantsListView(ListView):
 model = Tenants
 context_object_name = 'tenant_list'
 template_name = 'rentals/tenants_list.html'
 paginate_by = 5
 def get_queryset(self):
 return Tenants.objects.all()

 Now i created a file urls.py under the app rentals:

 from . import viewsfrom django.urls import path
 app_name='rentals'
 urlpatterns = [
 path("", views.TenantsListView.as_view(), name="index"),
 path("",views.TenantDetailView.as_view,name="detail"),
 path("",views.createTenant, name='createTenant'), 
 path("/",views.TenantUpdateView.as_view, name='edit'),
 path("/",views.delete, name='delete'),
 ]

 under TenancyMgr/urls, i add the following:

 from django.contrib import adminfrom django.urls import path,includefrom 
 rentals import views

 urlpatterns = [
 path('admin/', admin.site.urls),
 path('', include('rentals.urls')),
 ]

 When i run the server, the index view opens successfully! From the index, 
 i want to open the createTenant view as below.

 >>> data-url="{% url 'rentals:createTenant' %}>
   
   New Tenant
 

 When the button is clicked, i get the urls below:

 http://127.0.0.1:8000/rentals/createTenant/

 Then i get the response is 404,page not found error.

 But this opens admin page:

 http://127.0.0.1:8000/admin/

 So far i have failed to crack the secret of how the Urls work. I have gone 
 through several tutorials and i see the same set up as mine.

 I am requesting for guidance on how to crack the puzzle i.e make the other 
 urls work.

 Ronald



-- 
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/162a7ab5-0c45-4c94-a00e-122823056234%40googlegroups.com.


Re: Django tutorial, HttpResponseRedirect, sending multiple arguments

2020-05-07 Thread Ekberg Peter


This is what I had to do. Thanks to you I know how to think and fixed it. 


xx="EXTRA ARGUMENT"
 return HttpResponseRedirect(reverse('bsapp:result', args=(question.id, xx,)))


 path('//result/', views.result, name='result'),  


 def result(request, question_id, xx):



Den torsdag 7 maj 2020 kl. 12:40:06 UTC+2 skrev Ekberg Peter:
>
> I know something like this has been asked before but I never seen any 
> answer that I can understand or that works. But I am very new on Django so 
> maybe I could have missed it. But there must be an easy answer to my 
> question. I am following the tutorial for Django and at section 4 they use 
> the httpresponseredirect to go to next page after posting a form.
>
>
> return HttpResponseRedirect(reverse('polls:results', args=(question.id,)))
>
> The views page function looks like this: 
>
>
> def detail(request, question_id):
>
> My question is: How can I send more arguments than the question.id to the 
> function? 
>
> Thx
>

-- 
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/ddc94715-8c83-4060-bfd5-8c336d4fc900%40googlegroups.com.


Re: Django Media Static Files

2020-05-07 Thread Ilda Pedro
Hello, Jorge!

Thanks Jorge it already worked!

On Wed, May 6, 2020 at 3:38 PM Jorge Gimeno  wrote:

>
>
> On Wed, May 6, 2020 at 3:09 AM ilda.pedro1993 
> wrote:
>
>> Hello, everyone!
>> My name is Ilda, i'm getting a page not found when trying to load django
>> media files.
>>
>> My django settings file looks like below:
>>
>> [image: Captura de Tela (148).png]
>>
>>
>>
>>
>>
>>
>>
>> And saw many suggestions to concatenate my app urls with the static one
>> like:
>>
>> urlpatterns +=static(setting.MEDIA_URL, document_root=MEDIA_ROOT)
>>
>> But after storing the media files when i try to load a get always a not
>> found page.
>>
>> Im using Django 3.0.2
>>
>> Can anybody help me out there?
>>
>> --
>> 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/c08b99df-9423-46b6-8edf-34f01f550bc7%40googlegroups.com
>> 
>> .
>>
>
> Are you getting a 404 in production, or while using the development server
> (manage.py runserver)?
>
> -Jorge
>
> --
> 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/CANfN%3DK8F%2BR1JmugS1jj9wzQ6C%2BkdjfcL6OL75sU_6pzz-2cesQ%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/CAL%3DqnfXP_YL5kXZQVjy0Up-x_-xa9KAxup1quvKVQ%3Dd08uWWpQ%40mail.gmail.com.


Charts

2020-05-07 Thread hajar Benjat
Hello guys how are you doing?

I want to create charts for an application,  things like "delivery apps"...

Who can help me with examples please

-- 
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/CAMcj6WfsSp6eFxjw5Azdoh8Ldoz13HM8boYqo--bPt-hHjiymg%40mail.gmail.com.


Django Pipeline

2020-05-07 Thread Soumen Khatua
Hi Guys,
I want to use Django-pipeline library, Does anyone know how I can use it?
I'm also using AWS S3 storage. Any help will be appreciated.

Regards,
Soumen

-- 
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/CAPUw6WZ7eTj%2BmXOmXs9qHn-XSzUFKs7Zop-qna-GrfHP9N%3DPdA%40mail.gmail.com.


hai everyone, i am getting error in sending email portion, after submitting i got nothing in my mail. if anyone please help me

2020-05-07 Thread yammuna pari
def homeview(request):
   # return HttpResponse("Welcome to the store")
if request.method =='POST':
form =  Uploader(request.POST)
if form.is_valid():
Firstname=request.POST.get('Firstname','')
Lastname=request.POST.get('Lastname','')
Phoneno=request.POST.get('Phoneno','')
Email=request.POST.get('Email','')
Qualification=request.POST.get('Qualification','')
Cv=request.POST.get('Cv','')
mail.send_mail(Firstname,Lastname,Phoneno,Email,Qualification,Cv,[
'***@gmail.com'],fail_silently=False)
messages.info(request,'Message Sent Successfully')

form=Uploader()
return render(request,'home.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/629526d8-8dbe-4f3d-9cd1-24d6ea32ddfc%40googlegroups.com.


Re: Charts

2020-05-07 Thread Motaz Hejaze
What do you need exactly?
I think this is a javascript issue, checkout chart.js

On Thu, 7 May 2020, 6:36 pm hajar Benjat,  wrote:

> Hello guys how are you doing?
>
> I want to create charts for an application,  things like "delivery apps"...
>
> Who can help me with examples please
>
>
>
> --
> 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/CAMcj6WfsSp6eFxjw5Azdoh8Ldoz13HM8boYqo--bPt-hHjiymg%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/CAHV4E-cwFnsZYUfoTMvW99DcX29uq%2BtZg0xsEWqgmxZez5JXHg%40mail.gmail.com.


Re: Charts

2020-05-07 Thread DAVID ALEJANDRO Pineda
Hi friend
There are some shortcuts like Highcharts,
But i recommend to learn D3, is more difficult but it's worth.

In general you hace to create a list on serializable dicts (on the view on
python) and put the list like a json on the template (the tag to_json or
something like that)

Then, when the user load the page, the javascript read the data (you have
to use the id assigned by the task) and convert to JSON. If the JSON is
fina (builded exactly for the chart), only have to load the chart. In
another case you have to transform every JSOn in what you need

BR

El jue., 7 may. 2020 a las 12:37, hajar Benjat ()
escribió:

> Hello guys how are you doing?
>
> I want to create charts for an application,  things like "delivery apps"...
>
> Who can help me with examples please
>
>
>
> --
> 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/CAMcj6WfsSp6eFxjw5Azdoh8Ldoz13HM8boYqo--bPt-hHjiymg%40mail.gmail.com
> 
> .
>


-- 
Ingeniero Civil Electricista U. de Chile
F: +56 9 82142267 - dpin...@ug.uchile.cl

-- 
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/CAM2MghibyQAna%2BsYE9U0H%3D5denAawz83X7wMVDQ2ig%2ByqK3DvQ%40mail.gmail.com.


Re: hai everyone, i am getting error in sending email portion, after submitting i got nothing in my mail. if anyone please help me

2020-05-07 Thread Kasper Laudrup

Hi Yammuna,

It is very likely that the error is the reason why you're not getting 
any mail.


Hard to tell without knowing what kind of error you are getting though.

I would suggest you try to fix the error and then see if your mail gets 
through.


Kind regards,

Kasper Laudrup

--
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/154d75d3-c957-8ac2-79a7-a14dfb84766c%40stacktrace.dk.


Re: Create a function which fill automatically a field in my models

2020-05-07 Thread Phako Perez
You can use default option while creating model

Sent from my iPhone

> On 7 May 2020, at 8:53, Derek  wrote:
> 
> 
> Its unclear what you mean by "last ID" - and I cannot see the value of 
> storing such as they are available in the database...
> 
> But have a look at 
> https://stackoverflow.com/questions/12649659/how-to-set-a-django-model-fields-default-value-to-a-function-call-callable-e
>  
> 
> The example is:
> 
> from datetime import datetime, timedelta
> 
> # default to 1 day from now
> def get_default_my_date():
> return datetime.now() + timedelta(days=1)
> 
> class MyModel(models.Model):
> my_date = models.DateTimeField(default=get_default_my_date)
> 
> 
> Instead of the date arithmetic, you'd need to write code to, for example, 
> extract last ID from the database (assuming you have an auto-increment ID 
> set) and do the concatenation.
> 
> 
> 
> 
>> On Thursday, 7 May 2020 02:23:22 UTC+2, Anselme SERI wrote:
>> Thanks you for your answer. I know how to make a default value in charfield 
>> but I don't know  how to build function which returns value for my default 
>> field. In my case this function must retrieve last id on my model and must 
>> concataned it with a string and the final result must be affected to default 
>> charfield. Have you an example ? Help me plz.
>> 
>>> Le mer. 6 mai 2020 à 18:44, Motaz Hejaze  a écrit :
>>> Yes you can make a normal charfield and assign its default attribute to a 
>>> function you declare
>>> 
 On Wed, 6 May 2020, 6:53 pm Anselme SERI,  wrote:
 Hi,
 
 I use Django 3.0 and I would like to create a function which fill 
 automatically a field in my models.
 Can I do it directly in models.py ? How?
 
 Thanks a lot
 
 -- 
 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...@googlegroups.com.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/django-users/5f810453-c7ca-4c10-bca1-4cfe11ea496a%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...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/django-users/CAHV4E-dDRD%3DLteuDo7KuATzjKem-ThvtozzHuaqkwAeAC%2BBrZw%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/48c4d59e-8241-4739-b8df-feab45a7fa3a%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/B80CE7F3-311A-4F57-8DB0-9B80997DEAC4%40gmail.com.


Re: Django tutorial, HttpResponseRedirect, sending multiple arguments

2020-05-07 Thread Andréas Kühne
Hi,

Sorry for mixing those things up - I was writing from the top of my head
and not really paying that much attention perhaps :)

I would like to give you a few other pointers:
1. This is a bit biased but I would try to get away from function based
views - because they tend to make you do a lot of code duplication (in my
view - and I know I am opinionated here).
2. I am not really sure that you should use URL based things in your case -
but if you want to fine - I would probably use query params instead (and
get it off the request object instead).
3. Django IS really simple - probably one of the easiest things to create
but complicated and simple websites in :)

I would recommend that you look to a good tutorial to get started - the
django girls tutorial is one of the best:
https://tutorial.djangogirls.org/en/

Regards,

Andréas


Den tors 7 maj 2020 kl 17:08 skrev Ekberg Peter :

> This is what I had to do. Thanks to you I know how to think and fixed it.
>
>
> xx="EXTRA ARGUMENT"
>  return HttpResponseRedirect(reverse('bsapp:result', args=(question.id, xx,)))
>
>
>  path('//result/', views.result, name='result'),
>
>
>  def result(request, question_id, xx):
>
>
>
> Den torsdag 7 maj 2020 kl. 12:40:06 UTC+2 skrev Ekberg Peter:
>>
>> I know something like this has been asked before but I never seen any
>> answer that I can understand or that works. But I am very new on Django so
>> maybe I could have missed it. But there must be an easy answer to my
>> question. I am following the tutorial for Django and at section 4 they use
>> the httpresponseredirect to go to next page after posting a form.
>>
>>
>> return HttpResponseRedirect(reverse('polls:results', args=(question.id,)))
>>
>> The views page function looks like this:
>>
>>
>> def detail(request, question_id):
>>
>> My question is: How can I send more arguments than the question.id to
>> the function?
>>
>> Thx
>>
> --
> 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/ddc94715-8c83-4060-bfd5-8c336d4fc900%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/CAK4qSCfafVJOUng3poG%3DX8QzC1nh36OAGFYtgUUwM1u-PF3yHQ%40mail.gmail.com.


Re: hai everyone, i am getting error in sending email portion, after submitting i got nothing in my mail. if anyone please help me

2020-05-07 Thread Motaz Hejaze
You dont have any error messages ???

Try to send the mail to your console first to test functionality

On Thu, 7 May 2020, 8:49 pm Kasper Laudrup,  wrote:

> Hi Yammuna,
>
> It is very likely that the error is the reason why you're not getting
> any mail.
>
> Hard to tell without knowing what kind of error you are getting though.
>
> I would suggest you try to fix the error and then see if your mail gets
> through.
>
> Kind regards,
>
> Kasper Laudrup
>
> --
> 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/154d75d3-c957-8ac2-79a7-a14dfb84766c%40stacktrace.dk
> .
>

-- 
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/CAHV4E-fyhs8O0uxXApOmT9%3DuiFbmo8AqAr5XNEfMWbju0hE6Cw%40mail.gmail.com.


Re: Charts

2020-05-07 Thread hajar Benjat
Okey thank you so much guys

On Thu, May 7, 2020, 6:44 PM DAVID ALEJANDRO Pineda 
wrote:

> Hi friend
> There are some shortcuts like Highcharts,
> But i recommend to learn D3, is more difficult but it's worth.
>
> In general you hace to create a list on serializable dicts (on the view on
> python) and put the list like a json on the template (the tag to_json or
> something like that)
>
> Then, when the user load the page, the javascript read the data (you have
> to use the id assigned by the task) and convert to JSON. If the JSON is
> fina (builded exactly for the chart), only have to load the chart. In
> another case you have to transform every JSOn in what you need
>
> BR
>
> El jue., 7 may. 2020 a las 12:37, hajar Benjat ()
> escribió:
>
>> Hello guys how are you doing?
>>
>> I want to create charts for an application,  things like "delivery
>> apps"...
>>
>> Who can help me with examples please
>>
>>
>>
>> --
>> 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/CAMcj6WfsSp6eFxjw5Azdoh8Ldoz13HM8boYqo--bPt-hHjiymg%40mail.gmail.com
>> 
>> .
>>
>
>
> --
> Ingeniero Civil Electricista U. de Chile
> F: +56 9 82142267 - dpin...@ug.uchile.cl
>
> --
> 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/CAM2MghibyQAna%2BsYE9U0H%3D5denAawz83X7wMVDQ2ig%2ByqK3DvQ%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/CAMcj6We4x%2BaOMkqspFpE7t6SMdn4g7CEqcFnOMhm0K-gh8b6oA%40mail.gmail.com.


Re: hai everyone, i am getting error in sending email portion, after submitting i got nothing in my mail. if anyone please help me

2020-05-07 Thread Kasper Laudrup

Hi Mortaz,

On 07/05/2020 22.09, Motaz Hejaze wrote:

You dont have any error messages ???

Try to send the mail to your console first to test functionality



That was pretty much the point is was trying to make in my reply to Yammuna.

Kind regards,

Kasper Laudrup

--
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/2f2dd73c-103b-50ac-784d-6d886989fbf1%40stacktrace.dk.


Re: Django tutorial, HttpResponseRedirect, sending multiple arguments

2020-05-07 Thread Ekberg Peter
Thank you for the feedback and advices. I will sure check out Django girls.
The mix of parameters was no problem, I figured that out. I was not sure
though how to write the path. But now, at least I know how to send
arguments and that's bothered me for a while. Now I am on the right track
again. :-)

Peter

-- 
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/CAAkB%2Bwm4up-SgOZ_p%3DYDq%2BrDwxnd0ZH-7qaSb4BZcTH64QoKnA%40mail.gmail.com.


Project Ideas

2020-05-07 Thread Deepti sharma
Hi everyone,
I have recently finished two courses in which I made a Meeting planner 
project, and second was a portfolio using Django.
Now I want to start one of my own, I know I will get stuck but that's how I 
will get better.
Do you have any ideas? It would be helpful :)
I want to create a simple project with database sql or postgresql, django 
and will use bootstrap or other stuff for frontend.

-- 
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/97ae270f-591f-4672-bb8a-e87c914d53c5%40googlegroups.com.


django templates stop to working html autocomplete

2020-05-07 Thread Eren ARTUÇ
hello everyone,

Im using Vs.Code. When i enabled to django templates, my HTML autocomlete 
doesnt work. i want to work Python and HTML at the same time. How can i 
solve this problem ? Do you have any idea ? 

-- 
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/9e9fc403-ea1e-47d1-b34b-82af3268c468%40googlegroups.com.


Re: Project Ideas

2020-05-07 Thread Anonymous Patel
Hey deepti we are working with startup
www.ralpasoft.com
If you are interested you can join ourteam where with other Developers you
got same environment , so you would learn many things under guidance
Thankyou.
Mail me at r...@ralpasoft.com
If interested

Raj Patel

On Fri, 8 May, 2020, 4:38 am Deepti sharma, 
wrote:

> Hi everyone,
> I have recently finished two courses in which I made a Meeting planner
> project, and second was a portfolio using Django.
> Now I want to start one of my own, I know I will get stuck but that's how
> I will get better.
> Do you have any ideas? It would be helpful :)
> I want to create a simple project with database sql or postgresql, django
> and will use bootstrap or other stuff for frontend.
>
> --
> 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/97ae270f-591f-4672-bb8a-e87c914d53c5%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/CAF_9Civ6%3D%2BF1trqvdQogse06RU77jr5GNgYjibQ5XPbjaB%2Bm9w%40mail.gmail.com.


Re: django templates stop to working html autocomplete

2020-05-07 Thread Carson
What do you want to autocomplete but not?

If you use Python as the main language, It so recommends that you convert 
IDE to PyCharm.

Eren ARTUÇ於 2020年5月8日星期五 UTC+8上午7時09分18秒寫道:
>
> hello everyone,
>
> Im using Vs.Code. When i enabled to django templates, my HTML autocomlete 
> doesnt work. i want to work Python and HTML at the same time. How can i 
> solve this problem ? Do you have any idea ? 
>

-- 
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/dc093804-03b9-4a33-bf4f-4542b46294e0%40googlegroups.com.


Re: How to omit Admin field verbose name

2020-05-07 Thread Mike Dewhirst

On 7/05/2020 7:24 pm, Derek wrote:
I do something similar but not exactly the same. Perhaps like this 
(WARNING: untested code) under the class MyModelAdmin:


    def get_form(self, request, obj=None, **kwargs):
        form = super(MyModelAdminForm, self).get_form(request, obj, 
**kwargs)

        if form.base_fields:
            form.base_fields['currency'].label = 
get_regional_currency()  # or other method...

        return form


Thank you Derek. I'll keep plugging away but I can't get it working yet 
in admin.StackedInline.


I think I might have to go down the widget path.

Cheers

Mike




On Wednesday, 6 May 2020 03:37:59 UTC+2, Mike Dewhirst wrote:

One of my Admin forms has a price field and the currency and symbol
depend on the selected region.

I would like to display (readonly) just the field content for
currency
and symbol for example ...

"AUD $ [   222.22]"

... but all I can achieve at the moment is ...

"Currency: AUD Symbol: $   [
222.22]"

Is there a technique for this?

I have checked the docs and found I can use a callable but that just
uses the callable name as the verbose_name.

I have tried making verbose_name="" in the model but that still
displays
the colon and lots of spaces.

I expect I'll need to use my own form somehow but I'd prefer
something
simpler.

Any hints greatly appreciated

Cheers

Mike

--
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/48adbb40-11d4-47d7-bba1-e068d5ae523f%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/b57f3169-8f88-7148-1fdd-633a411969d8%40dewhirst.com.au.


Django Lessons

2020-05-07 Thread Eugen Ciur
Hi, 

on https://django-lessons.com I release weekly screencasts about Django Web 
Framework. Lessons are usually very short, around 10 minutes.
Each of them focuses on a single practical topic so that you can 
immediately apply learned skills in your projects.
50% of all content always will be free.

I would love your feedback!

Regards,
Eugen / Django Lessons

-- 
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/784e88d9-9a3d-45ea-b43d-6d22b54469b2%40googlegroups.com.


Re: Django Lessons

2020-05-07 Thread David Merrick
Sounds like a very good idea.
I have one immediate question. What web servers can host Django and what
Domain Names / types?
I was using Rails for a bit but got unstuck when Rails need Dynamic Domain
Names, not Static ones.

Cheers Dave

On Fri, May 8, 2020 at 6:11 PM Eugen Ciur  wrote:

> Hi,
>
> on https://django-lessons.com I release weekly screencasts about Django
> Web Framework. Lessons are usually very short, around 10 minutes.
> Each of them focuses on a single practical topic so that you can
> immediately apply learned skills in your projects.
> 50% of all content always will be free.
>
> I would love your feedback!
>
> Regards,
> Eugen / Django Lessons
>
> --
> 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/784e88d9-9a3d-45ea-b43d-6d22b54469b2%40googlegroups.com
> 
> .
>


-- 
Dave Merrick

TutorInvercargill

http://tutorinvercargill.co.nz

Daves Web Designs

Website http://www.daveswebdesigns.co.nz

Email merrick...@gmail.com

Ph   03 216 2053

Cell 027 3089 169

-- 
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/CA%2B%3DMcKZnGhvB8U3VtmakNBRdEjNdORbP16h6Ux2JmD3WaF0jCg%40mail.gmail.com.


Re: hai everyone, i am getting error in sending email portion, after submitting i got nothing in my mail. if anyone please help me

2020-05-07 Thread yammuna pari
Dear Kasper,

Thanks for reply.

I am not getting any error message even form also working well  but after
submitting the fields are not going to email.

On Fri, May 8, 2020 at 2:49 AM Kasper Laudrup  wrote:

> Hi Yammuna,
>
> It is very likely that the error is the reason why you're not getting
> any mail.
>
> Hard to tell without knowing what kind of error you are getting though.
>
> I would suggest you try to fix the error and then see if your mail gets
> through.
>
> Kind regards,
>
> Kasper Laudrup
>
> --
> 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/154d75d3-c957-8ac2-79a7-a14dfb84766c%40stacktrace.dk
> .
>

-- 
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/CAKTtA5Y1hvXXQTBUTUFRbwmNC51A8ys4AzyrZM%2Bv4eNVv1TUXA%40mail.gmail.com.


Re: Django Lessons

2020-05-07 Thread Eugen Ciur
For first part of the question: Apache (mod_wsgi), Gunicorn, and uWSGI are 
most popular choices
I don't second part of question though - what you mean with "and what 
domain names / types" ? 

On Friday, May 8, 2020 at 8:33:43 AM UTC+2, David Merrick wrote:
>
> Sounds like a very good idea.
> I have one immediate question. What web servers can host Django and what 
> Domain Names / types?
> I was using Rails for a bit but got unstuck when Rails need Dynamic Domain 
> Names, not Static ones.
>
> Cheers Dave
>
> On Fri, May 8, 2020 at 6:11 PM Eugen Ciur > 
> wrote:
>
>> Hi, 
>>
>> on https://django-lessons.com I release weekly screencasts about Django 
>> Web Framework. Lessons are usually very short, around 10 minutes.
>> Each of them focuses on a single practical topic so that you can 
>> immediately apply learned skills in your projects.
>> 50% of all content always will be free.
>>
>> I would love your feedback!
>>
>> Regards,
>> Eugen / Django Lessons
>>
>> -- 
>> 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...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/784e88d9-9a3d-45ea-b43d-6d22b54469b2%40googlegroups.com
>>  
>> 
>> .
>>
>
>
> -- 
> Dave Merrick
>
> TutorInvercargill
>
> http://tutorinvercargill.co.nz
>
> Daves Web Designs
>
> Website http://www.daveswebdesigns.co.nz
>
> Email merri...@gmail.com 
>
> Ph   03 216 2053
>
> Cell 027 3089 169
>

-- 
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/360c1be4-e868-42b1-a22a-a0246a3b2791%40googlegroups.com.


Re: Project Ideas

2020-05-07 Thread jill patel
Which two courses you did
Even I am a beginner and searching for sources

On Fri, 8 May 2020 at 4:37 AM, Deepti sharma 
wrote:

> Hi everyone,
> I have recently finished two courses in which I made a Meeting planner
> project, and second was a portfolio using Django.
> Now I want to start one of my own, I know I will get stuck but that's how
> I will get better.
> Do you have any ideas? It would be helpful :)
> I want to create a simple project with database sql or postgresql, django
> and will use bootstrap or other stuff for frontend.
>
> --
> 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/97ae270f-591f-4672-bb8a-e87c914d53c5%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/CAAHcmGJJEN%2Bmak2zR9Tj8ApjF_ONcreAaeMc17YB5BFfMh9RcA%40mail.gmail.com.