Django real-time chat app

2019-08-26 Thread Suraj Thapa FC
Anyone have real-time pluggable chat system app in django.

-- 
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/CAPjsHcENui0Yv%2BnVYpEtxyo0ZOtwjQ6b1tCv_xtUpzW3VLMT%3Dg%40mail.gmail.com.


Re: page not found but url exists

2019-08-26 Thread Sipum
Hey,

Try by giving forward slashes(/) at the end of the each urls instead of
using backward slashes like...

Do as -
register/
login/customer/

I think It will work

On Tue, 27 Aug, 2019, 3:16 AM James Schneider, 
wrote:

>
>
>
>> Using the URLconf defined in bnt.urls, Django tried these URL patterns,
>> in this order:
>>
>>1. admin/
>>2. [name='home']
>>3. /login [name='clogin']
>>4. /login/customer [name='cpage']
>>5. /register [name='cregister']
>>6. /register/customer [name='cpage']
>>
>> The current path, register, didn't match any of these.
>>
>
>
> I'm assuming your template has a typo in the {% url %} tag referencing
> 'register' instead of 'cregister'.
>
> The rest of the error page should indicate the line that is making the URL
> name resolution call.
>
> -James
>
> --
> 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%2Be%2BciWdirAoL_xMRJEdD%3DRY6omVH4UC6xsFFb4RfH747LaSNA%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/CAGHZBzxyHHvFjaKKiwesxgO3K%3DLk9BLNEnUgwuH%3Dd%3Dc8xFSJPg%40mail.gmail.com.


Re: page not found but url exists

2019-08-26 Thread James Schneider
> Using the URLconf defined in bnt.urls, Django tried these URL patterns,
> in this order:
>
>1. admin/
>2. [name='home']
>3. /login [name='clogin']
>4. /login/customer [name='cpage']
>5. /register [name='cregister']
>6. /register/customer [name='cpage']
>
> The current path, register, didn't match any of these.
>


I'm assuming your template has a typo in the {% url %} tag referencing
'register' instead of 'cregister'.

The rest of the error page should indicate the line that is making the URL
name resolution call.

-James

-- 
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%2Be%2BciWdirAoL_xMRJEdD%3DRY6omVH4UC6xsFFb4RfH747LaSNA%40mail.gmail.com.


How can I stop my page from generating a resubmission alert after there is an invalid authentication attempt?

2019-08-26 Thread Mihir Malik
Upon submission of an invalid authentication after displaying the error 
that my login credentials were incorrect, whenever I refresh the page it 
keeps generating a re-submission of forms alert. I have inherited the 
standard 'contrib.auth' LoginView. Any help would be appreciated. I am new 
to Django so any advice on avoiding such problems in the future would also 
be greatly appreciated.

-- 
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/8dde6f15-e7d6-458d-9678-5fd1821d725d%40googlegroups.com.


Re: page not found but url exists

2019-08-26 Thread Luca Mazzilli
Kean,
Have you tried removing the initial slash inside the path?

-- 
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/bc263648-0291-44af-96c6-a7f1b2f5141f%40googlegroups.com.


Re: page not found but url exists

2019-08-26 Thread Kean Dumba
Tried this with print request,
However it didn’t improve the issue.

It can’t be a redirect issue, as it’s not even finding the first instance
of the url which is GET action. The redirect is only actionable after on
page actions I.e. user register Name, email etc.

Are their any other root causes to this.

Best,

K



On Mon, 26 Aug 2019 at 20:17, Gil Obradors  wrote:

> admin/ urls are working fine?
> if you put print('hello0) at first line inside cregister, you see at the
> console?
>
> If yes the problem is in redirects
>
>
> Missatge de Kean  del dia dl., 26 d’ag. 2019 a les
> 19:32:
>
>> Hi Gil,
>>
>> please see
>>
>> views.cregister
>>
>> def cregister(request):
>> next = request.GET.get('next')
>> form = CUserRegisterForm(request.POST or None)
>> if form.is_valid():
>> user = form.save(commit=False)
>> password1 = form.cleaned_data.get('password1')
>> password1 = form.cleaned_data.get('password2')
>> user.setpassword(password1)
>> user.setpassword(password2)
>> user.save()
>> new_user = authenticate(username=username, password=password)
>> login(request, user)
>> if next:
>> return redirect('next')
>> return redirect('cpage')
>>
>> context = {
>>
>> 'form': form,
>>
>> }
>> return render(request, "cregister.html", context)
>>
>> projectname/urls.py
>>
>> from django.contrib import admin
>> from django.urls import path, include
>>
>> urlpatterns = [
>> path('admin/', admin.site.urls),
>> path('', include('core.urls')),
>> ]
>>
>> Best,
>>
>> K
>> On 26 Aug 2019, at 18:29, Gil Obradors  wrote:
>>
>> Hi!
>>
>> Can you paste views.cregister
>> and projectname/urls.py ?
>>
>>
>>
>> Missatge de Kean  del dia dl., 26 d’ag. 2019 a les
>> 19:10:
>>
>>> Hi,
>>>
>>> I'm new to Django. I created several urls, in urls.py, however, when I
>>> try to navigate to the URL it says page not found.
>>> Page not found (404)
>>> Request Method: GET
>>> Request URL: http://127.0.0.1:8000/register
>>>
>>> Using the URLconf defined in bnt.urls, Django tried these URL patterns,
>>> in this order:
>>>
>>>1. admin/
>>>2. [name='home']
>>>3. /login [name='clogin']
>>>4. /login/customer [name='cpage']
>>>5. /register [name='cregister']
>>>6. /register/customer [name='cpage']
>>>
>>> The current path, register, didn't match any of these.
>>>
>>>
>>>
>>>
>>>
>>> urls.py
>>>
>>> from django.conf.urls import url
>>> from django.urls import path
>>> from . import views
>>>
>>> urlpatterns = [
>>>
>>> path('', views.home, name='home'),
>>> path('/login', views.clogin, name='clogin'),
>>> path('/login/customer', views.cpage, name='cpage'),
>>> path('/register', views.cregister, name='cregister'),
>>> path('/register/customer', views.cpage, name='cpage'),
>>> path('/logout', views.clogout, name='clogout'),
>>>
>>> ]
>>>
>>>
>>> Please can anyone advise, if they had this issue and how they resolved,
>>>
>>> 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/8a72d003-fcf7-4280-8635-6f4986f3e002%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/CAK-JoTTb_a4392MBgNy12vVCayYtsxzijfC%3DznY3NK5kP5Bcfg%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/AE4A7AB2-C1BA-42DE-8C45-44D8B3133FCC%40gmail.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
> 

Re: page not found but url exists

2019-08-26 Thread Gil Obradors
admin/ urls are working fine?
if you put print('hello0) at first line inside cregister, you see at the
console?

If yes the problem is in redirects


Missatge de Kean  del dia dl., 26 d’ag. 2019 a les 19:32:

> Hi Gil,
>
> please see
>
> views.cregister
>
> def cregister(request):
> next = request.GET.get('next')
> form = CUserRegisterForm(request.POST or None)
> if form.is_valid():
> user = form.save(commit=False)
> password1 = form.cleaned_data.get('password1')
> password1 = form.cleaned_data.get('password2')
> user.setpassword(password1)
> user.setpassword(password2)
> user.save()
> new_user = authenticate(username=username, password=password)
> login(request, user)
> if next:
> return redirect('next')
> return redirect('cpage')
>
> context = {
>
> 'form': form,
>
> }
> return render(request, "cregister.html", context)
>
> projectname/urls.py
>
> from django.contrib import admin
> from django.urls import path, include
>
> urlpatterns = [
> path('admin/', admin.site.urls),
> path('', include('core.urls')),
> ]
>
> Best,
>
> K
> On 26 Aug 2019, at 18:29, Gil Obradors  wrote:
>
> Hi!
>
> Can you paste views.cregister
> and projectname/urls.py ?
>
>
>
> Missatge de Kean  del dia dl., 26 d’ag. 2019 a les
> 19:10:
>
>> Hi,
>>
>> I'm new to Django. I created several urls, in urls.py, however, when I
>> try to navigate to the URL it says page not found.
>> Page not found (404)
>> Request Method: GET
>> Request URL: http://127.0.0.1:8000/register
>>
>> Using the URLconf defined in bnt.urls, Django tried these URL patterns,
>> in this order:
>>
>>1. admin/
>>2. [name='home']
>>3. /login [name='clogin']
>>4. /login/customer [name='cpage']
>>5. /register [name='cregister']
>>6. /register/customer [name='cpage']
>>
>> The current path, register, didn't match any of these.
>>
>>
>>
>>
>>
>> urls.py
>>
>> from django.conf.urls import url
>> from django.urls import path
>> from . import views
>>
>> urlpatterns = [
>>
>> path('', views.home, name='home'),
>> path('/login', views.clogin, name='clogin'),
>> path('/login/customer', views.cpage, name='cpage'),
>> path('/register', views.cregister, name='cregister'),
>> path('/register/customer', views.cpage, name='cpage'),
>> path('/logout', views.clogout, name='clogout'),
>>
>> ]
>>
>>
>> Please can anyone advise, if they had this issue and how they resolved,
>>
>> 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/8a72d003-fcf7-4280-8635-6f4986f3e002%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/CAK-JoTTb_a4392MBgNy12vVCayYtsxzijfC%3DznY3NK5kP5Bcfg%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/AE4A7AB2-C1BA-42DE-8C45-44D8B3133FCC%40gmail.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-JoTQOb7nj%3DE9fmcnmS4tONTOfB85sGAfNy0Xr_aF5q8yP3w%40mail.gmail.com.


Re: How can I host my application in web hosting?

2019-08-26 Thread Techie Masters
You can use PayPal on digitalocean.
On 25 Aug 2019, 11:11 +0300, Nur Mohsin , wrote:
> Assalamu Alaikum Yusuf Bhaia,
>
> As I have no credit card, that's why I couldn't choose AWS or DO. I am from 
> Bangladesh and suffering to choose a hosting provider in Bangladesh where 
> Django and Postgresql are well supported.
> Would you please suggest me any company?
>
> Thanks.
>
> > On Sun, Aug 25, 2019 at 11:26 AM Abu Yusuf  
> > wrote:
> > > You people are working on django projects?
> > > Is that a startup?
> > >
> > > > On Sun, Aug 25, 2019 at 11:25 AM Abu Yusuf  
> > > > wrote:
> > > > > You are most welcome!
> > > > >
> > > > > > On Thu, Aug 22, 2019 at 11:49 PM Wasim Rana  
> > > > > > wrote:
> > > > > > > Thank you so much for your response.
> > > > > > > Wasim Rana
> > > > > > >
> > > > > > > CEO and Director
> > > > > > > SiteFor99
> > > > > > > www.sitefor99.com
> > > > > > > Cell: +880 173 406 4296
> > > > > > > Ring Road, Shyamoli,
> > > > > > > Dhaka - 1207
> > > > > > >
> > > > > > >
> > > > > > > > On Thu, Aug 22, 2019 at 5:55 PM Abu Yusuf 
> > > > > > > >  wrote:
> > > > > > > > > Is it a django application? Not every hosting provider 
> > > > > > > > > provide django deployments.
> > > > > > > > > You can use amazon aws and digital ocean. You can do also in 
> > > > > > > > > heroku and pythonanywhere, they are totally free.
> > > > > > > > >
> > > > > > > > > > On Thu, Aug 22, 2019 at 5:47 PM Wasim Rana 
> > > > > > > > > >  wrote:
> > > > > > > > > > > Hello, I am building a web application locally in my 
> > > > > > > > > > > computer. It's almost done and I want to host it in 
> > > > > > > > > > > Siteground hosting. How can I do that? Please help.
> > > > > > > > > > > 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/bfc3fc3d-0614-4588-8391-b3a64b1a151a%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/CACNsr29ws9CDAEECAafFX6yBe6STcoPyGN-6WR1mGDWiENma4g%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/CALbNXK5Ky8qquFBML2tbxysfwwv%2BdrKteSQuh%2B9mGOWU1-1QVQ%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/CACNsr2_5h6PcWLJVzzMP8KXaihoNS7DrGv91NUqZ-XK629ke_g%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/CAM0c9RpByV3SFfeiGOO9svFx-V5xMtyHGhZ6tzx%3D6Hj170UQMg%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/6ade00ba-f7aa-4ef9-aaf5-a8ec355b1ff5%40Spark.


Re: page not found but url exists

2019-08-26 Thread Kean
Hi Gil,

please see

views.cregister

def cregister(request):
next = request.GET.get('next')
form = CUserRegisterForm(request.POST or None)
if form.is_valid():
user = form.save(commit=False)
password1 = form.cleaned_data.get('password1')
password1 = form.cleaned_data.get('password2')
user.setpassword(password1)
user.setpassword(password2)
user.save()
new_user = authenticate(username=username, password=password)
login(request, user)
if next:
return redirect('next')
return redirect('cpage')

context = {

'form': form,

}
return render(request, "cregister.html", context)

projectname/urls.py

from django.contrib import admin
from django.urls import path, include

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

Best,

K
On 26 Aug 2019, at 18:29, Gil Obradors  wrote:

> Hi!
> 
> Can you paste views.cregister
> and projectname/urls.py ?
> 
> 
> 
> Missatge de Kean  del dia dl., 26 d’ag. 2019 a les 19:10:
> Hi, 
> 
> I'm new to Django. I created several urls, in urls.py, however, when I try to 
> navigate to the URL it says page not found.
> Page not found (404)
> Request Method:   GET
> Request URL:  http://127.0.0.1:8000/register
> Using the URLconf defined in bnt.urls, Django tried these URL patterns, in 
> this order:
> 
> admin/
> [name='home']
> /login [name='clogin']
> /login/customer [name='cpage']
> /register [name='cregister']
> /register/customer [name='cpage']
> The current path, register, didn't match any of these.
> 
> 
> 
> 
> 
> 
> urls.py
> 
> from django.conf.urls import url
> from django.urls import path
> from . import views
> 
> urlpatterns = [
> 
> path('', views.home, name='home'),
> path('/login', views.clogin, name='clogin'),
> path('/login/customer', views.cpage, name='cpage'),
> path('/register', views.cregister, name='cregister'),
> path('/register/customer', views.cpage, name='cpage'),
> path('/logout', views.clogout, name='clogout'),
> 
> ]
> 
> 
> Please can anyone advise, if they had this issue and how they resolved,
> 
> 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/8a72d003-fcf7-4280-8635-6f4986f3e002%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/CAK-JoTTb_a4392MBgNy12vVCayYtsxzijfC%3DznY3NK5kP5Bcfg%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/AE4A7AB2-C1BA-42DE-8C45-44D8B3133FCC%40gmail.com.


Re: page not found but url exists

2019-08-26 Thread Gil Obradors
Hi!

Can you paste views.cregister
and projectname/urls.py ?



Missatge de Kean  del dia dl., 26 d’ag. 2019 a les 19:10:

> Hi,
>
> I'm new to Django. I created several urls, in urls.py, however, when I try
> to navigate to the URL it says page not found.
> Page not found (404)
> Request Method: GET
> Request URL: http://127.0.0.1:8000/register
>
> Using the URLconf defined in bnt.urls, Django tried these URL patterns,
> in this order:
>
>1. admin/
>2. [name='home']
>3. /login [name='clogin']
>4. /login/customer [name='cpage']
>5. /register [name='cregister']
>6. /register/customer [name='cpage']
>
> The current path, register, didn't match any of these.
>
>
>
>
>
> urls.py
>
> from django.conf.urls import url
> from django.urls import path
> from . import views
>
> urlpatterns = [
>
> path('', views.home, name='home'),
> path('/login', views.clogin, name='clogin'),
> path('/login/customer', views.cpage, name='cpage'),
> path('/register', views.cregister, name='cregister'),
> path('/register/customer', views.cpage, name='cpage'),
> path('/logout', views.clogout, name='clogout'),
>
> ]
>
>
> Please can anyone advise, if they had this issue and how they resolved,
>
> 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/8a72d003-fcf7-4280-8635-6f4986f3e002%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/CAK-JoTTb_a4392MBgNy12vVCayYtsxzijfC%3DznY3NK5kP5Bcfg%40mail.gmail.com.


how to add graphs in django admin panel

2019-08-26 Thread Balaji Shetty
Hi everyone

Can anybody suggest me
how to add different graphs in django admin panel for relational models. I
will apply count, group by clsuse query to display count.

One more questions. We can change default django Administration GUI using
django admin suit. How is it. Is there any other way to change it


Thanks in advance.


-- 
Mr Shetty Balaji
Asst. Prof.
IT Department
SGGS I
Nanded. My. India

-- 
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/CAECSbOuSHU_pq8ofKse%3DMrr43usU5Sb%2BzzzhTrNrsi%3DQ%2BPT15Q%40mail.gmail.com.


page not found but url exists

2019-08-26 Thread Kean
Hi, 

I'm new to Django. I created several urls, in urls.py, however, when I try 
to navigate to the URL it says page not found.
Page not found (404)
Request Method: GET
Request URL: http://127.0.0.1:8000/register

Using the URLconf defined in bnt.urls, Django tried these URL patterns, in 
this order:

   1. admin/
   2. [name='home']
   3. /login [name='clogin']
   4. /login/customer [name='cpage']
   5. /register [name='cregister']
   6. /register/customer [name='cpage']

The current path, register, didn't match any of these.





urls.py

from django.conf.urls import url
from django.urls import path
from . import views

urlpatterns = [

path('', views.home, name='home'),
path('/login', views.clogin, name='clogin'),
path('/login/customer', views.cpage, name='cpage'),
path('/register', views.cregister, name='cregister'),
path('/register/customer', views.cpage, name='cpage'),
path('/logout', views.clogout, name='clogout'),

]


Please can anyone advise, if they had this issue and how they resolved,

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/8a72d003-fcf7-4280-8635-6f4986f3e002%40googlegroups.com.


Re: images in production mode. is pointed to a different path.

2019-08-26 Thread Aldian Fazrihady
On production, static files shouldn't be the burden of django server. Many
people are using Nginx to handle static file. This is the guide:
https://docs.djangoproject.com/en/2.2/howto/static-files/deployment/

On Mon, Aug 26, 2019 at 11:13 PM janderson abreu  wrote:

> Good afternoon, I'm having trouble displaying images in production mode. is 
> pointed to a different path. image src points to -> 
> https://campeonatosdejiujitsu.com/social/file.jpg and 
> https://campeonatosdejiujitsu.com/social/images/file.jpg the images are at: 
> https://campeonatosdejiujitsu.com/static/ file.jpg 
> https://campeonatosdejiujitsu.com/static/file.jpg
> follows the gist with detailing and 
> logs:https://gist.github.com/Jandersolutions/e3af7a1e66ee7b81110d2a869e9ec1c8
>
> --
> 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/f7105ee2-6236-44e5-99cc-4c2788a34e16%40googlegroups.com
> 
> .
>


-- 
Regards,

Aldian Fazrihady
http://aldianfazrihady.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/CAN7EoAYaRg9E_N66SyiEqK09ZzYQogspo_CG%3DANxSu8TwGg4aQ%40mail.gmail.com.


Re: Doesn't save data django Foreignkey model

2019-08-26 Thread Mark Ochieng
Are trying to save data for Customer that does not exist in your 
CustomerData table yet. Because I think the error is tries to inform you 
that Billing data can only be created for a customer that already exists on 
you CustomerData

On Sunday, August 25, 2019 at 5:17:24 PM UTC+3, Asaduzzaman Sohel wrote:
>
> I've two model. I would like to save data from ForeignKey model. I'm 
> created a modelform and save with my main foreignkey model. But I got this 
> error ValueError at /c/customer/1/ Cannot assign "'1'": 
> "BillingData.customer" must be a "CustomerData" instance.
>
> I created Django model form and hocked up with view.
>
> models.py file
>
> class CustomerData(models.Model):
> customer_name = models.CharField(max_length=100)
> customer_no = models.CharField(max_length=100, default='', blank=True)
> mobile_number = models.IntegerField()
> alternative_phone = models.IntegerField(null=True, blank=True)
> union_name = models.ForeignKey(UnionName, on_delete=models.SET_NULL, 
> null=True)
> word_name = models.ForeignKey(UnionWordName, on_delete=models.SET_NULL, 
> null=True)
> full_address = models.CharField(max_length=200, null=True, blank=True)
> create_date = models.DateTimeField(auto_now_add=True)
> updated = models.DateTimeField(auto_now=True)
>
> def __str__(self):
> return '%s, Mobile: %s' % (self.customer_name, self.mobile_number)
>
> def get_absolute_url(self):
> return reverse('customer_data', kwargs={'pk': self.pk})
>
> class BillingData(models.Model):
> bill_no = models.CharField(max_length=100, default='', blank=True)
>
> customer = models.ForeignKey(CustomerData, on_delete=models.CASCADE)
> sales_person = models.ForeignKey(settings.AUTH_USER_MODEL, 
> on_delete=models.SET_NULL, null=True)
> customer_money = models.IntegerField()
> create_date = models.DateTimeField(auto_now_add=True)
> updated = models.DateTimeField(auto_now=True)
>
> def __str__(self):
> return '%s %s' % (self.customer.customer_name, 
> self.create_date.date())
>
> def get_absolute_url(self):
> return reverse('customers.views.BillingPage', kwargs={'pk': self.pk})
>
> forms.py file 
>
> class BillCreateForms(forms.ModelForm):
> bill_no = forms.CharField(max_length=100)
> customer = forms.ChoiceField(choices=[(x.id, x.customer_name) for x in 
> CustomerData.objects.all()])
> customer_money = forms.IntegerField()
>
> def save(self, commit=True):
> instance = super(BillCreateForms, self).save(commit=False)
> customer_pk = self.cleaned_data['customer']
>
> instance.customer_id = CustomerData.objects.get(pk=customer_pk).pk
> instance.save(commit)
> return instance
>
> class Meta:
> model = BillingData
> fields = ('bill_no', 'customer', 'customer_money',)
>
> views.py file
>
> class CustomerDataView(FormMixin, generic.DetailView):
> model = CustomerData
> form_class = BillCreateForms
> template_name = "customers/customerdata_detail.html"
> print(form_class)
>
> success_url = '/c/'
>
> def post(self, request, *args, **kwargs):
> if not request.user.is_authenticated:
> return HttpResponseForbidden()
> form = self.get_form()
> if form.is_valid():
> return self.form_valid(form)
> else:
> return self.form_invalid(form)
>
> I expect data save with foreignkey relation data. But doesn't save here.
>
>
> models.py file https://paste.ubuntu.com/p/8RKDGwjhgh/ 
> 
> forms.py file https://paste.ubuntu.com/p/gD4B5nFWJP/ 
> 
> views.py file https://paste.ubuntu.com/p/njyfwNztY9/ 
> 
>
>
> this is full traceback paste.ubuntu.com/p/Z92rVxJpnJ
>

-- 
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/bfdadce6-6b73-4c5f-8586-64a5f3cf8a21%40googlegroups.com.


Re: How can I switch AUTH_USER_MODEL for each application?

2019-08-26 Thread Sim
https://docs.djangoproject.com/en/2.2/ref/settings/#databases

DATABASES in settings.py is a dict() and use database_routers.

Good luck

On Mon, Aug 26, 2019 at 12:47 PM Ayu Nakata 
wrote:

> I want to use each database in each application.
> I tried using different settings.py for each application, but it didn't
> work.
> Can you give me some advice?
> 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/d6713c1f-a0e0-439a-9731-c04f9f2f9217%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/CAJenkLDbnoyUG-bJWb7Oe8QUBMZ%2BssHOE7qxOvztrG7pu5-vFQ%40mail.gmail.com.


Re: Rest Franework

2019-08-26 Thread Andréas Kühne
Hi,

OK - If you only want to create an autocomplete list - or a dropdown list
with information django restframework could be a bit of an overkill for
that specific task - you could instead use something like this:
https://django-autocomplete-light.readthedocs.io/en/master/tutorial.html

That's a plugin that creates a simple dropdown with autocomplete?

Regards,

Andréas


Den fre 23 aug. 2019 kl 14:26 skrev Soumen Khatua :

> Hi  Andres,
> Yes I read your article what you shared with me now I understand that I
> need to override the inbuilt django rest framework template to get expected
> result. But I don't know How can i do that, So my query is what is road map
> to do that? As of Now I extended restframework provided *base.html* but
> How can I render  these into a template and customize it accordingly.
>
> Thank you for your response.
>
> Regards,
> Soumen
>
> On Fri, Aug 23, 2019 at 4:15 PM Andréas Kühne 
> wrote:
>
>> Hi Soumen,
>>
>> You have asked this question (or variants of it) 3 times now. If you
>> aren't satisfied with the solutions you have received already - try
>> replying to the suggestions you already have received. I don't think you
>> will get different answers by repeating the same question multiple times.
>> Also people here won't write the code for you, but we are happy to show you
>> pointers to where you need to look. Previously we have said that you need
>> to use the Filtering and that you will need to do a javascript query to get
>> the information from the backend.
>>
>> What kind of answer are you looking for? Because if you put together
>> these things you will get the solution to this problem.
>>
>> Best regards,
>>
>> Andréas
>>
>>
>> Den ons 21 aug. 2019 kl 09:42 skrev Soumen Khatua <
>> soumenkhatua...@gmail.com>:
>>
>>> Hi Folks,
>>> I want to implemnet something like if user type any query parameter then
>>> matched string should come first then if the typed words contains in
>>> between records then short length of string should come second and so on,as
>>> an example:
>>>
>>>
>>> *http://127.0.0.1:8000/get/search/?word=the
>>> *
>>>
>>> *the--- first record*
>>> *they-- second **record*
>>> *their--- third **record*
>>> *theirs-- fourth **record*
>>> **
>>>
>>>
>>> Plase tell me how I can solve this probelm.
>>>
>>> Thank you
>>>
>>>
>>> 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/CAPUw6Waisqm10yKOPSe4gY5S%2BX0NRg_eiBjsiGW1Ld-NAiXnZg%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/CAK4qSCeAkoOGeOVp27WRytH33qwz%3Dk1s1ov%3D22T-cvbkMcsdAA%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/CAPUw6WaZA2OQ8m9V-xGUBHyBUDEMgoj6K7nE-_qd9JN2HsVk8g%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/CAK4qSCd3p-j6pqWgO_GcMxGFoAwjWjKDgV7%2BzmSZU0jtAqp8JQ%40mail.gmail.com.


How can I switch AUTH_USER_MODEL for each application?

2019-08-26 Thread Ayu Nakata
I want to use each database in each application.
I tried using different settings.py for each application, but it didn't 
work.
Can you give me some advice?
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/d6713c1f-a0e0-439a-9731-c04f9f2f9217%40googlegroups.com.