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: AttributeError 'QuerySet' object has no attribute '_meta'

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

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

> You can't pass *all* the objects to the form. You have to get the specific
> one you want to edit and pass that as the instance.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/e78cfd54-9800-4c17-b8a4-0ffaf5ddcfd4%40googlegroups.com
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAKvrVZO_rKiPOm9ZLZ%2BmiUpTgUy-xim%2Br7s8kRWskThHtndjpw%40mail.gmail.com.


Re: Exception value name is not defined

2019-08-16 Thread Kean Dumba
Hi N’BE,

The github code you provided worked.
I now see all the records.

Thank you for the help.

Best,

K

On Thu, 15 Aug 2019 at 22:14, N'BE SORO  wrote:

> https://github.com/Soro08/django_help/blob/master/README.md
>
> Le jeu. 15 août 2019 à 22:54, N'BE SORO  a écrit :
>
>> This is normal in the view.py file is what appears. Now if you want to
>> use the data in the template You must use a loop to browse the items. I
>> will send you a Github link or I will better explain.
>>
>> Le jeu. 15 août 2019 à 20:49, Kean  a écrit :
>>
>>>
>>> Hi, pls see the result of the code, no objects, just the ID number, and
>>> the model name, plus query set,
>>> not sure what issue is here.
>>>
>>>
>>> On 15 Aug 2019, at 21:29, N'BE SORO  wrote:
>>>
>>> Ok.
>>>
>>> Use this code:
>>>
>>> data = Test.objects.all()
>>>
>>> context = {
>>> 'data': data,
>>> }
>>>
>>>
>>> in Your template use:
>>>
>>>
>>> data.name,
>>> data.broname
>>> ...
>>>
>>>
>>>
>>> Le jeu. 15 août 2019 à 19:56, Kean  a écrit :
>>>
 Hi, N’BE,

 The code you sent, when i apply using my model and substitute the
 objects for those defined in my model, in the context, the browser,  throws
 up unidentified error for the object defined in the context, i.e. my object
 name.

 Please see example below which better explains what I am trying to
 achieve:

 Example,

 I have one table in models,

 Models.py

 class Test(request):
 Name = models.CharField(max_length=10)
 Surname = models.CharField(max_length=10)
 Father_name = models.CharField(max_length=10)
 Mother_name = models.CharField(max_length=10)
 Brother_name = models.CharField(max_length=10)
 Sister_name = models.CharField(max_length=10)

  def__self__(self):
 return self. name

 --
 When I use your “working' code in views

 I only see the result of one object: Name: John Smith

 I would like to see the results of all the objects stored in the
 database: Name: John Smith, Father name: Sam Smith,
 Mother name: Angela Smith, Brother name: James Smith and Sister name:
 Sarah Smith.

 All 6 objects, would need to appear in the view,

 Is there a way to code this?

 Best,

 K


 On 15 Aug 2019, at 20:36, N'BE SORO  wrote:

 Ok.

 Simple exemple.

 data_1 = Model_1.objects.all()
 data_2 = Model_2.objects.all()
 data_3 = Model_3.objects.all()
 data_4 = Model_4.objects.all()
 data_5 = Model_5.objects.all()
 data_6 = Model_6.objects.all()

 context = {

'data_1':  data_1,
'data_2':  data_2,
'data_3':  data_3,
'data_4':  data_4,
'data_5':  data_5,
'data_6':  data_6,
 }

 return render(request, 'yourpage.html, context)


 

 Replaces Model_1 ... Model_6 by your models you want to send in your
 view.


 Invite your template use data_1,..., data_6



 Le jeu. 15 août 2019 à 19:28, Kean  a écrit :

> Hi N’BE,
>
> If I have 6 objects in my dbase model, I would want all six to be
> returned to the view, via template.
>
> However, the code you sent is only returning 1 object, so i am missing
> 5
>
> how can I  use the view code, to ensure all 6 are returned o the
> template?
>
> Best,
>
> K
>
>
> On 15 Aug 2019, at 20:21, N'BE SORO  wrote:
>
> you want to send what model on your view?
>
> Le jeu. 15 août 2019 à 19:04, Kean  a écrit :
>
>> Hi N’BE,
>>
>> Thanks, the code worked, the problem is I wanted to use the context
>> to return all objects in the database to
>> the defined html view,
>>
>> However, I am still  only getting the self defined str and returning
>> to view, is there any way to get all records in the table to display?
>>
>> Best,
>>
>> Kea
>>
>> On 15 Aug 2019, at 19:50, N'BE SORO  wrote:
>>
>> Hello Use this code
>>
>>
>> def editremovebusiness(request):
>> data = Businessownercreate.objects.all()
>> context = {
>> 'data': data,
>> }
>> return render(request, 'editremovebusiness.html', context)
>>
>> Le jeu. 15 août 2019 à 18:45, RONAK JAIN  a
>> écrit :
>>
>>> Hey Kean,
>>>
>>> What is the object here?
>>>
>>>
>>>
>>>
>>> On Thu, Aug 15, 2019 at 11:37 PM Kean  wrote:
>>>
 Hi,

 I have written the following code in views.py

 def editremovebusiness(request):
 data = Businessownercreate.objects.all()
 context = {
 'Creator': obj.Creator,
 'Micro_Small_Medium': obj.Micro_Small_Medium,
 }
 return render(request, 'editremovebusiness.html',
 context={"data":data})

 when I save it and check the url

Re: tinymce no module exists

2019-08-04 Thread Kean Dumba
Hi Sam,

Thanks added tinymce to apps as recommended, but still getting the same
error

Best,

K

On Sun, 4 Aug 2019 at 15:06, Sam W  wrote:

> Add it to the installed apps
>
>  INSTALLED_APPS = (
> ...
> 'tinymce',
> )
>
> --
> 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/a4245a83-39b3-4214-ad31-cb2a7f1bb473%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/CAKvrVZMOCW2VA%2BSG7D8MfZRhZgHHg4J91FxwsvqR5vowBfaAjg%40mail.gmail.com.


Re: Document flow between parties

2019-08-01 Thread Kean Dumba
Hi Mike,

Thanks you for the direction.
II’m new to django and python,
So will have to read-up on how
to utilise this resource, before Iearning and applying.

As a newbie, I’m really enjoying my journey in programming,

Best,

K

On Thu, 1 Aug 2019 at 07:14, Mike Dewhirst  wrote:

> On 1/08/2019 1:35 am, Kean wrote:
> >  Hi .
> >
> > Please can anyone refer me to a good source to learn how to write a
> > programme which supports document creation, flow,
> > conversion, management and tracking between parties?
>
> https://djangopackages.org/grids/g/document-management/
>
> These are all django packages and therefore should be readable and
> deliver some understanding. If one of them suits you it would be best to
> adopt that and adapt if necessary.
>
> I dabbled in this sort of thing some years ago and the concepts were
> easy enough to understand then but things are different now so I can't
> help.
>
> I reckon you need to swap barcodes out and blockchain in.
>
> Good luck.
>
> Mike
>
> >
> > 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/92ed4806-d7f3-4cce-b626-bc5da8768e2b%40googlegroups.com
> > <
> https://groups.google.com/d/msgid/django-users/92ed4806-d7f3-4cce-b626-bc5da8768e2b%40googlegroups.com?utm_medium=email_source=footer
> >.
>
> --
> 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/04146eb3-2af4-0e2f-ac1e-bf13cca0da00%40dewhirst.com.au
> .
>

-- 
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/CAKvrVZOkUW_UkSmMLOh2rWNhiZ6nA63kGax2RZYfEV9O3FujYA%40mail.gmail.com.


Cant create venv

2019-07-28 Thread Kean Dumba
Hi,

I was writing some code in sublime text for my django app.
and my python session suspended after migrate. now i'm not able to run 
django or venv,
the error below is what i receive.

keans-air:project ProductionEnv$ python3 -m venv project

dyld: Library not loaded: @executable_path/../.Python

  Referenced from: /usr/local/bin/python3

  Reason: image not found

Trace/BPT trap: 5


Is this issue familiar to anyone, please can you let me know what it is and 
how to fix?

n.b. unfortunately, the web resources returned on google search did not 
resolve.


thanks,


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/f407b115-ecc7-4557-b3b2-b12e47c009be%40googlegroups.com.


Re: Problem with running Django with nginx and uwsgi in Ubuntu

2019-07-26 Thread Kean Dumba
Thanks Aldian,

The community have reached out to me with thoughts, as well as guidance,
I.e. django for girls, django forums and github


These resources have made a significant  difference, things are working and
I’m slowly learning.
the community are welcoming, knowledgable, helpful and patient, espevialk
 to us ‘newbs’ who have no programming experience.

Big Thank you to the django and python community, it is valued.

Best,

Kean







On Fri, 26 Jul 2019 at 22:34, Aldian Fazrihady  wrote:

> Try increasing client_max_body_size. For example, ```client_max_body_size
> 75M```
>
>
> ‪On Fri, Jul 26, 2019 at 7:28 PM ‫אורי‬‎  wrote:‬
>
>> Django users,
>>
>> I'm trying to install a new server, and I can't run Django with nginx and
>> uwsgi. I receive an error "502 Bad Gateway" and there are messages on the
>> error log which I don't understand:
>>
>> 2019/07/20 10:50:44 [error] 2590#2590: *1 upstream prematurely closed 
>> connection while reading response header from upstream, client: 
>> 79.183.208.33, server: *.speedy.net.3.speedy-technologies.com, request: "GET 
>> / HTTP/1.1", upstream: "uwsgi://unix:/run/uwsgi/app/speedy_net/socket:", 
>> host: "3.speedy-technologies.com"
>>
>> I have 4 websites and here is the main (default) configuration file:
>>
>> server {
>> listen [::]:80 default_server;
>> listen 80 default_server;
>> server_name *.speedy.net.3.speedy-technologies.com 
>> speedy.net.3.speedy-technologies.com;
>>
>> access_log /var/log/nginx/speedy-net.access.log;
>> error_log /var/log/nginx/speedy-net.error.log;
>>
>> client_max_body_size 50M;
>>
>> root  /home/ubuntu/speedy-net/speedy/net/static_serve/root;
>> try_files $uri @uwsgi;
>>
>> location @uwsgi {
>> include uwsgi_params;
>> uwsgi_pass unix:/run/uwsgi/app/speedy_net/socket;
>> }
>>
>> location /admin/ {
>> auth_basic "admin site";
>> auth_basic_user_file /etc/nginx/htpasswd_admin;
>> include uwsgi_params;
>> uwsgi_pass unix:/run/uwsgi/app/speedy_net/socket;
>> }
>>
>> location /static {
>> alias /home/ubuntu/speedy-net/speedy/net/static_serve;
>> access_log off;
>> # expires max;
>> gzip on;
>> gzip_min_length 1100;
>> gzip_buffers 4 32k;
>> gzip_types text/css text/javascript text/xml text/plain 
>> text/x-component application/javascript application/x-javascript 
>> application/json application/xml  application/rss+xml font/truetype 
>> application/x-font-ttf font/opentype application/vnd.ms-fontobject 
>> image/svg+xml;
>> gzip_vary on;
>> gzip_comp_level 6;
>> }}
>>
>> And:
>>
>> [uwsgi]
>> project = net
>>
>> chdir = /home/ubuntu/speedy-net
>> home = %(chdir)/envmodule = speedy.%(project).wsgi:application
>>
>> plugins = python3
>> master = true
>> processes = 4
>>
>> chmod-socket = 666
>> vacuum = true
>>
>> uid = ubuntu
>> gid = ubuntu
>>
>> touch-reload = /run/uwsgi/app/speedy_%(project)/reload
>>
>> I tried to test with sudo nginx -t but I received a message that my
>> configuration is OK. What is the problem?
>>
>> *Edit:*
>>
>> The old server (which is working):
>>
>> $ find /run/uwsgi/
>>
>>

-- 
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/CAKvrVZPTEbU-EtcLF%2BuzEzxR6_gVMAkAhnLYW6jYQMdnH_r8Eg%40mail.gmail.com.