Re: how to Display images other than from static folder.

2022-01-31 Thread Lunga Baliwe
i think you want to use MEDIA_URL, see
https://learndjango.com/tutorials/django-file-and-image-uploads-tutorial
and also check https://docs.djangoproject.com/en/3.2/topics/files/ static
files are things like logos, css and maybe some javascript.

On Mon, Jan 31, 2022 at 5:36 PM DJANGO DEVELOPER 
wrote:

> tell me what you want to get as a result? do you want to display multiple
> images on HTML template?
>
> On Mon, Jan 31, 2022 at 8:27 PM ramsha azhar 
> wrote:
>
>> So guide me the write way ...
>>
>> On Mon, 31 Jan 2022, 7:45 pm DJANGO DEVELOPER, 
>> wrote:
>>
>>> you are doing it the wrong way. totally the wrong way. I am not being
>>> rude.
>>>
>>> On Mon, Jan 31, 2022 at 7:42 PM ramsha azhar 
>>> wrote:
>>>
 Gide me Django develpers. I just want to display my pictures that are
 created each time new.
 My mages are created in my project folder, not in the static folder.
 how I display images on the HTML page by using the path of my project
 folder.

 views.py

 def Image_display(request):
   BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
   filename = 'Tree.jpg'
   filepath = BASE_DIR + '//' + filename
   images = Image.objects.all('filepath')
   return render(request, "xyz.html", {'images': images})

 url.py
 path('Image_display/', views.Image_display, name="Image_display"),

 HTML page
 
 
 
 

 --
 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/8da245ea-ea90-4730-83c0-accafc93b86bn%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/CAKPY9p%3DE1FmUc%3Dqqy1tGYBJbimFX873XXSTDndnn4kVUjo3ZWg%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/CAMyb2%3DheLgJo5dMxsCgQ8cm%3Dp0px5EHpLr2frYtDowV8mmC%2BbQ%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/CAKPY9p%3DOofwq7YrTp%3DWoKyO7mgxVovK2wN3-%3Dm9Ed2zTWZ%2BdAg%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/CANDnEWee3Dp3B55RFDtwjmcNTz%2BNd%2BrGiufNfv%3DC7%2Bh6KeaYBQ%40mail.gmail.com.


Re: Model Design

2022-05-06 Thread Lunga Baliwe
Also/maybe if you haven't please check
https://django-import-export.readthedocs.io/en/latest/

On Thu, May 5, 2022 at 3:59 PM 'David Turner' via Django users <
django-users@googlegroups.com> wrote:

> We receive the data every two weeks and then use django-import-export to
> import the data into our database. There is no mention of the account
> manager in these as this is something on our side. Am I missing the point
> in that by having the foreign key to the account manager this would impact
> on the import?
>
> On 5 May 2022, at 14:51, Ayser shuhaib  wrote:
>
>
> To help understand more the problem, would you please explain why adding
> an extra field to your models to be used as a foreign key, is not an option?
>
> On Thu, 05 May 2022 at 15:36, 'dtdave' via Django users <
> django-users@googlegroups.com> wrote:
>
>> We receive data from various third parties in their proprietary format in
>> excel. We then import this into our database and our models have been
>> designed around their format.
>> There is no option to change the way this data is received.
>> However, we now need to add an account manager to this data and under
>> normal circumstances this would be a case of adding a foreign key to the
>> data.
>>
>> What would be the best method of dealing with this given that we cannot
>> change the format of the data we receive nor the current models given that
>> they mirror this structure.
>> One suggestion has been to use a generic foreign key but I am not sure
>> how this would work.
>>
>> Thanks in advance
>>
>>
>>
>> --
>> 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/97d1988f-b230-46a8-93dc-be583860467an%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/bLKn2Dm15sU/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/CAE0AZGKB5Mj5%3DFfuHVAASVG-GU3i7Opc1OsxySy_C9A3y0axeA%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/1AAD717E-D010-433B-8998-68FEC047E311%40googlemail.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/CANDnEWcGxZmj9AZaaYS5grwbmgrn6mRUzt65S5tXwFin-jEQWQ%40mail.gmail.com.


Django sms

2012-09-14 Thread Lunga Baliwe
Good day,

I am writting a website that sends sms to a cell phone. I am 
using django-sendsms-0.2.2. I followed the README.rst doc and the output 
does appear on the console. How do I make it to actually send the sms?

Your help will appreciated.

Kind regards,
Lunga

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/NywGfiMlZtQJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django sms

2012-09-14 Thread Lunga Baliwe
The code I wrote is the one on  
https://github.com/stefanfoulis/django-sendsms which is:

settings.py
SENDSMS_BACKEND = 'sendsms.backends.console.SmsBackend'

view.py
from sendsms import api
def home(request):
api.send_sms(body='I can haz txt', from_phone='0768903661', 
to=['0768903661'])
return render_to_response('home.html')

After I ran the server, this what I get on the console:
from: 0768903661
to: 0768903661
flash: False
I can haz txt
---

Maybe its like Dennis said, that this is meant for testing purpose, do I 
have to subscribe to twilio in order to be able to actually send the sms?


On Friday, September 14, 2012 8:40:10 PM UTC+2, Lunga Baliwe wrote:
>
> Good day,
>
> I am writting a website that sends sms to a cell phone. I am 
> using django-sendsms-0.2.2. I followed the README.rst doc and the output 
> does appear on the console. How do I make it to actually send the sms?
>
> Your help will appreciated.
>
> Kind regards,
> Lunga
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/Gobzn88UMnYJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django sms

2012-09-15 Thread Lunga Baliwe
Thanks Dennis,

I'm kind of newbie to software,  but now I have an idea of what I need to 
do because two of cellphone service providers in South Africa(Vodacom and 
MTN - thanks for the list) do support email2sms.
I now have an idea of what I need to do, if I end up using the Django-sms 
app, I will post back.

The website will send sms' to a group of people who are members of an 
organisation informing them of meetings and other group announcements.

Thanks for the clear explanation and for your help.  

On Friday, September 14, 2012 8:40:10 PM UTC+2, Lunga Baliwe wrote:
>
> Good day,
>
> I am writting a website that sends sms to a cell phone. I am 
> using django-sendsms-0.2.2. I followed the README.rst doc and the output 
> does appear on the console. How do I make it to actually send the sms?
>
> Your help will appreciated.
>
> Kind regards,
> Lunga
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/nxdB59nEMrYJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: No module named wsgi

2013-05-29 Thread Lunga Baliwe
Thanks for your replying, am only seeing your reply now.


On Thu, May 23, 2013 at 7:49 PM, Sandeep kaur  wrote:

> On Thu, May 23, 2013 at 8:29 PM, Luggaz  wrote:
> > I don't know what I dd but it seems to work now!
> >
> mod wsgi installation could have also solved he purpose, using this
> command :
>
> $sudo apt-get install apache2 libapache2-mod-wsgi
>
> --
> Sandeep Kaur
> E-Mail: mkaurkha...@gmail.com
> Blog: sandymadaan.wordpress.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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Django not showing css - static files

2014-03-14 Thread Lunga Baliwe
Good day Mike,

I have STATIC_ROOT = os.path.join(BASE_DIR, 'website/static/')
website being the app name


On Fri, Mar 14, 2014 at 12:57 AM, Mike Dewhirst wrote:

> On 14/03/2014 9:05am, Luggaz wrote:
>
>> Good day,
>>
>> My static files are not showing on production, they show when I run them
>> development mode. I am running Django1.6 on apache,mod_wsgi. I get the
>> not found error on the files.
>>
>
> Have you copied all your static files into STATIC_ROOT ??
>
>
>> I have been on it for hours and have tried changing and tweaking
>> STATIC_ROOT and STATICFILES_DIR
>>
>> I have attached 3 images, the apache file, and the difference between
>> the dev and the production screenshot.
>>
>> Regards
>> Lunga
>>
>> --
>> 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 post to this group, send email to django-users@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/dcfa6c8e-
>> 9183-45ec-bfcf-74b5db3910c9%40googlegroups.com
>> > 9183-45ec-bfcf-74b5db3910c9%40googlegroups.com?utm_medium=
>> email&utm_source=footer>.
>>
>> 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 post to this group, send email to django-users@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/532237E0.7040001%40dewhirst.com.au.
>
> 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 post to this group, send email to django-users@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/CANDnEWegQnzOBMcM3d16PGSbDb_Z%2BvJP-ULTcSmm3wunPMxc%3DA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django not showing css - static files

2014-03-14 Thread Lunga Baliwe
yes I think I have on apache I got it like this.

Alias /static/ /home/project_name/website/static

Order allow, deny
Allow from all


I did run collecstatic aswell

On Fri, Mar 14, 2014 at 8:18 PM, Tom Evans  wrote:

> On Fri, Mar 14, 2014 at 6:08 PM, Lunga Baliwe  wrote:
> > Good day Mike,
> >
> > I have STATIC_ROOT = os.path.join(BASE_DIR, 'website/static/')
> > website being the app name
>
> STATIC_ROOT has nothing to do with apps, it is where the files are
> copied to (by django) and served from (by your webserver).
>
> Assuming staticfiles works for you in development, there are very few
> things that you can do wrong, so (in turn):
>
> Have you run collectstatic to copy files from your static folders
> (application static folders and folders listed in STATICFILES_DIRS) to
> your STATIC_ROOT?
>
> Have you configured your webserver to serve files in the folder
> indicated by STATIC_ROOT at the URL indicated by STATIC_URL?
>
> Cheers
>
> Tom
>
> --
> 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 post to this group, send email to django-users@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/CAFHbX1Lo%3DU9m-gMmO%2Bc-dOXNWAjj%2Bx%3DN2UkUDq9QXuNh4YV%3D9Q%40mail.gmail.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 post to this group, send email to django-users@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/CANDnEWdJKt7Pa6WB-bNGh_%2BHpnS8WSCMX0Ev7nH98v2JQ7Q17w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django not showing css - static files

2014-03-14 Thread Lunga Baliwe
I just put on the last forward slash on
Alias /static/ /home/project_name/website/static/

And it worked, yho thanks Mike...


On Fri, Mar 14, 2014 at 8:29 PM, Lunga Baliwe  wrote:

> yes I think I have on apache I got it like this.
>
> Alias /static/ /home/project_name/website/static
> 
> Order allow, deny
> Allow from all
> 
>
> I did run collecstatic aswell
>
> On Fri, Mar 14, 2014 at 8:18 PM, Tom Evans wrote:
>
>> On Fri, Mar 14, 2014 at 6:08 PM, Lunga Baliwe  wrote:
>> > Good day Mike,
>> >
>> > I have STATIC_ROOT = os.path.join(BASE_DIR, 'website/static/')
>> > website being the app name
>>
>> STATIC_ROOT has nothing to do with apps, it is where the files are
>> copied to (by django) and served from (by your webserver).
>>
>> Assuming staticfiles works for you in development, there are very few
>> things that you can do wrong, so (in turn):
>>
>> Have you run collectstatic to copy files from your static folders
>> (application static folders and folders listed in STATICFILES_DIRS) to
>> your STATIC_ROOT?
>>
>> Have you configured your webserver to serve files in the folder
>> indicated by STATIC_ROOT at the URL indicated by STATIC_URL?
>>
>> Cheers
>>
>> Tom
>>
>> --
>> 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 post to this group, send email to django-users@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/CAFHbX1Lo%3DU9m-gMmO%2Bc-dOXNWAjj%2Bx%3DN2UkUDq9QXuNh4YV%3D9Q%40mail.gmail.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 post to this group, send email to django-users@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/CANDnEWf0VxhEkO%2BBZYbc4uC6hjQC9wR895ZykXORh0rGmWhv9g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django not showing css - static files

2014-03-14 Thread Lunga Baliwe
Really appreciate it


On Fri, Mar 14, 2014 at 8:34 PM, Lunga Baliwe  wrote:

> I just put on the last forward slash on
> Alias /static/ /home/project_name/website/static/
>
> And it worked, yho thanks Mike...
>
>
> On Fri, Mar 14, 2014 at 8:29 PM, Lunga Baliwe  wrote:
>
>> yes I think I have on apache I got it like this.
>>
>> Alias /static/ /home/project_name/website/static
>> 
>> Order allow, deny
>> Allow from all
>> 
>>
>> I did run collecstatic aswell
>>
>> On Fri, Mar 14, 2014 at 8:18 PM, Tom Evans wrote:
>>
>>> On Fri, Mar 14, 2014 at 6:08 PM, Lunga Baliwe 
>>> wrote:
>>> > Good day Mike,
>>> >
>>> > I have STATIC_ROOT = os.path.join(BASE_DIR, 'website/static/')
>>> > website being the app name
>>>
>>> STATIC_ROOT has nothing to do with apps, it is where the files are
>>> copied to (by django) and served from (by your webserver).
>>>
>>> Assuming staticfiles works for you in development, there are very few
>>> things that you can do wrong, so (in turn):
>>>
>>> Have you run collectstatic to copy files from your static folders
>>> (application static folders and folders listed in STATICFILES_DIRS) to
>>> your STATIC_ROOT?
>>>
>>> Have you configured your webserver to serve files in the folder
>>> indicated by STATIC_ROOT at the URL indicated by STATIC_URL?
>>>
>>> Cheers
>>>
>>> Tom
>>>
>>> --
>>> 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 post to this group, send email to django-users@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/CAFHbX1Lo%3DU9m-gMmO%2Bc-dOXNWAjj%2Bx%3DN2UkUDq9QXuNh4YV%3D9Q%40mail.gmail.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 post to this group, send email to django-users@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/CANDnEWc2cm7oUr_Mmmd%3DuDvzxAqd%2B6caDjiCmzTTBPFg2Co%2Bkw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django not showing css - static files

2014-03-14 Thread Lunga Baliwe
And thank you Tom as well


On Fri, Mar 14, 2014 at 8:35 PM, Lunga Baliwe  wrote:

> Really appreciate it
>
>
> On Fri, Mar 14, 2014 at 8:34 PM, Lunga Baliwe  wrote:
>
>> I just put on the last forward slash on
>> Alias /static/ /home/project_name/website/static/
>>
>> And it worked, yho thanks Mike...
>>
>>
>> On Fri, Mar 14, 2014 at 8:29 PM, Lunga Baliwe  wrote:
>>
>>> yes I think I have on apache I got it like this.
>>>
>>> Alias /static/ /home/project_name/website/static
>>> 
>>> Order allow, deny
>>> Allow from all
>>> 
>>>
>>> I did run collecstatic aswell
>>>
>>> On Fri, Mar 14, 2014 at 8:18 PM, Tom Evans wrote:
>>>
>>>> On Fri, Mar 14, 2014 at 6:08 PM, Lunga Baliwe 
>>>> wrote:
>>>> > Good day Mike,
>>>> >
>>>> > I have STATIC_ROOT = os.path.join(BASE_DIR, 'website/static/')
>>>> > website being the app name
>>>>
>>>> STATIC_ROOT has nothing to do with apps, it is where the files are
>>>> copied to (by django) and served from (by your webserver).
>>>>
>>>> Assuming staticfiles works for you in development, there are very few
>>>> things that you can do wrong, so (in turn):
>>>>
>>>> Have you run collectstatic to copy files from your static folders
>>>> (application static folders and folders listed in STATICFILES_DIRS) to
>>>> your STATIC_ROOT?
>>>>
>>>> Have you configured your webserver to serve files in the folder
>>>> indicated by STATIC_ROOT at the URL indicated by STATIC_URL?
>>>>
>>>> Cheers
>>>>
>>>> Tom
>>>>
>>>> --
>>>> 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 post to this group, send email to django-users@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/CAFHbX1Lo%3DU9m-gMmO%2Bc-dOXNWAjj%2Bx%3DN2UkUDq9QXuNh4YV%3D9Q%40mail.gmail.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 post to this group, send email to django-users@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/CANDnEWc%2BMTesgQGxTZ47z9GRJ8Bq6buydENbdRSm_RucB6Y4%3DA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: what is the meaning of this error

2019-05-27 Thread Lunga Baliwe
You probably have to import and use like this
https://docs.djangoproject.com/en/2.2/topics/http/shortcuts/#redirect

from django.shortcuts import redirect
def my_view(request):
...
obj = MyModel.objects.get(...)
return redirect(obj)


On Tue, May 28, 2019 at 1:49 AM Saeed Pooladzadeh 
wrote:

> hello
>
> Can you please help me to understand the meaning of this error:
>
> NameError at /emp
>
> name 'redirect' is not defined
>
> Request Method: POST
> Request URL: http://localhost:62597/emp
> Django Version: 2.2
> Exception Type: NameError
> Exception Value:
>
> name 'redirect' is not defined
>
> Exception Location: E:\Django_Try\bot4\bot3\saeed\views.py in emp, line 14
> Python Executable: E:\Django_Try\bot4\bot3\env\Scripts\python.exe
> Python Version: 3.6.6
> Python Path:
>
> ['E:\\Django_Try\\bot4\\bot3',
>  '',
>  'E:\\Django_Try\\bot4\\bot3',
>  'E:\\Django_Try\\bot4\\bot3\\env\\Scripts\\python36.zip',
>  'C:\\Program Files (x86)\\Microsoft Visual 
> Studio\\Shared\\Python36_64\\DLLs',
>  'C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\Python36_64\\lib',
>  'C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\Python36_64',
>  'E:\\Django_Try\\bot4\\bot3\\env',
>  'E:\\Django_Try\\bot4\\bot3\\env\\lib\\site-packages']
>
> Server time: Mon, 27 May 2019 23:01:46 +
>
>  Is it mean Django cant understand the meaning of redirect??
> But I have used redirect on my other project?
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/938de80b-874f-4339-a8ec-000bda037e74%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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CANDnEWdFAZvfOZ8_ibAqDXNJVJOaVwUyzmBjBMpy5yuaO7N2ig%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django Testing

2020-03-31 Thread Lunga Baliwe
Good day,

I hope this (
https://docs.djangoproject.com/en/3.0/intro/tutorial05/#writing-our-first-test)
can help, its part of the Django tutorials.

On Tue, Mar 31, 2020 at 4:35 PM ekong, emmanuel 
wrote:

> I’m having the same difficulty...
>
> On Tue, 31 Mar 2020 at 3:32 PM, Abrar Ahmad 
> wrote:
>
>> Hello Sir
>> I have trouble in learnig Testing tutorial of Djanog Documentation.
>> Can any one tell me what is the main concept of learnign test and how can
>> we learn it in easiest way.
>> I am waiting for reply
>>
>> --
>> 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/6e807ef4-09b6-459d-9d7f-ddb42931c4d9%40googlegroups.com
>> 
>> .
>>
>
> *Disclaimer*
> This e-mail is intended solely for the named recipient. The information
> contained in this message is strictly confidential.
>
>- If you are not the named recipient, you are hereby notified that any
>use, dissemination or reproduction of this document and or its content is
>prohibited and may be deemed unlawful.
>- If you are not the named recipient of this e-mail, please notify the
>sender by a return e-mail and delete all copies of it from your computer
>and mail.
>
> Any views expressed in this e-mail are those of the individual sender,
> except where the sender specifically states them to be those of Landmark
> University , to whom no liability shall be attached
> whatsoever.
>
> 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/CAAP9wcyqaBJLLdc86wkSOtiNoCUDuQVHOh7mpPtCnCmRAbtRxw%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/CANDnEWfZuDeX7_0tvSdVY3-gWxdhinwyMGYQE3_ftri7e3OmjA%40mail.gmail.com.


Re: Django pdfs

2020-04-22 Thread Lunga Baliwe
Maybe you can check Django FileField
  for
upload and check what it looks like on the admin side.


On Wed, Apr 22, 2020 at 6:09 PM Hella Nick  wrote:

> me to。do you help me?
>
> Perceval Maturure 于2020年4月22日 周三07:31写道:
>
>> Hi Django Users
>>
>> I am developing a Django document management system which will cater for
>> pdf file uploads. What is the best resource to use (tutorial) as I want to
>> have the pdfs accessible from admin. Can I do this with Django filer
>>
>> Regards
>>
>> Perceval
>>
>> --
>> 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/B912F6EC-E628-49E8-91AB-8442B25A7E34%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/CAHfGPEfRLO_VqswP9sHG%2BOM_HOob%2BQw2ztgvZx3TbMd5%3Dtk50w%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/CANDnEWdBhLMgNud%2B6CZguak0%3DSEivu2VHOGEOY1RV2kVjS7oFw%40mail.gmail.com.


Re: Django pdfs

2020-04-23 Thread Lunga Baliwe
Hi Perceval,

On production I think you have to allow access to your MEDIA path, I
normally do this on the apache config per site.

Do you mind sharing your code or maybe  screen shots of what appears on the
admin screen.

Also it maybe be worth to return a name or url path like __str__
<https://docs.djangoproject.com/en/3.0/ref/models/instances/#django.db.models.Model.__str__>
your
model.

You may also wanna check
https://django-easy-pdf.readthedocs.io/en/v0.2.0-dev1/  and
https://stackoverflow.com/questions/11779246/how-to-show-a-pdf-file-in-a-django-view/46267916

On Thu, Apr 23, 2020 at 12:26 PM Perceval Maturure 
wrote:

> Hi Lunga
> When debug mode is False in production the url link of the file is not
> accessible in admin which is ok for security reasons but in admin I can
> download the file for preview
> Regards
> Perceval
>
> On Wed, 22 Apr 2020 at 18:39, Lunga Baliwe  wrote:
>
>> Maybe you can check Django FileField
>> <https://docs.djangoproject.com/en/3.0/ref/models/fields/#filefield>  for
>> upload and check what it looks like on the admin side.
>>
>>
>> On Wed, Apr 22, 2020 at 6:09 PM Hella Nick  wrote:
>>
>>> me to。do you help me?
>>>
>>> Perceval Maturure 于2020年4月22日 周三07:31写道:
>>>
>>>> Hi Django Users
>>>>
>>>> I am developing a Django document management system which will cater
>>>> for pdf file uploads. What is the best resource to use (tutorial) as I want
>>>> to have the pdfs accessible from admin. Can I do this with Django filer
>>>>
>>>> Regards
>>>>
>>>> Perceval
>>>>
>>>> --
>>>> 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/B912F6EC-E628-49E8-91AB-8442B25A7E34%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/CAHfGPEfRLO_VqswP9sHG%2BOM_HOob%2BQw2ztgvZx3TbMd5%3Dtk50w%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/django-users/CAHfGPEfRLO_VqswP9sHG%2BOM_HOob%2BQw2ztgvZx3TbMd5%3Dtk50w%40mail.gmail.com?utm_medium=email&utm_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/CANDnEWdBhLMgNud%2B6CZguak0%3DSEivu2VHOGEOY1RV2kVjS7oFw%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CANDnEWdBhLMgNud%2B6CZguak0%3DSEivu2VHOGEOY1RV2kVjS7oFw%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
> --
> Sent from Gmail Mobile
>
> --
> 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/CAFZtZmAXX6s8E3h40CviBWqyfbyMqCZf%2ByJ2t9au4nNBUege6g%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAFZtZmAXX6s8E3h40CviBWqyfbyMqCZf%2ByJ2t9au4nNBUege6g%40mail.gmail.com?utm_medium=email&utm_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/CANDnEWcsKHPj%2BazXSnpEAb6BubFZPzxhtskjpTaz1c%2B93rO-%3Dw%40mail.gmail.com.


Re: Django pdfs

2020-04-23 Thread Lunga Baliwe
Also check
https://docs.djangoproject.com/en/3.0/ref/models/instances/#get-absolute-url

Kind regards,
Lunga Baliwe

On Thu, Apr 23, 2020 at 1:04 PM Lunga Baliwe  wrote:

> Hi Perceval,
>
> On production I think you have to allow access to your MEDIA path, I
> normally do this on the apache config per site.
>
> Do you mind sharing your code or maybe  screen shots of what appears on
> the admin screen.
>
> Also it maybe be worth to return a name or url path like __str__
> <https://docs.djangoproject.com/en/3.0/ref/models/instances/#django.db.models.Model.__str__>
>  your
> model.
>
> You may also wanna check
> https://django-easy-pdf.readthedocs.io/en/v0.2.0-dev1/  and
> https://stackoverflow.com/questions/11779246/how-to-show-a-pdf-file-in-a-django-view/46267916
>
> On Thu, Apr 23, 2020 at 12:26 PM Perceval Maturure 
> wrote:
>
>> Hi Lunga
>> When debug mode is False in production the url link of the file is not
>> accessible in admin which is ok for security reasons but in admin I can
>> download the file for preview
>> Regards
>> Perceval
>>
>> On Wed, 22 Apr 2020 at 18:39, Lunga Baliwe  wrote:
>>
>>> Maybe you can check Django FileField
>>> <https://docs.djangoproject.com/en/3.0/ref/models/fields/#filefield>  for
>>> upload and check what it looks like on the admin side.
>>>
>>>
>>> On Wed, Apr 22, 2020 at 6:09 PM Hella Nick  wrote:
>>>
>>>> me to。do you help me?
>>>>
>>>> Perceval Maturure 于2020年4月22日 周三07:31写道:
>>>>
>>>>> Hi Django Users
>>>>>
>>>>> I am developing a Django document management system which will cater
>>>>> for pdf file uploads. What is the best resource to use (tutorial) as I 
>>>>> want
>>>>> to have the pdfs accessible from admin. Can I do this with Django filer
>>>>>
>>>>> Regards
>>>>>
>>>>> Perceval
>>>>>
>>>>> --
>>>>> 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/B912F6EC-E628-49E8-91AB-8442B25A7E34%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/CAHfGPEfRLO_VqswP9sHG%2BOM_HOob%2BQw2ztgvZx3TbMd5%3Dtk50w%40mail.gmail.com
>>>> <https://groups.google.com/d/msgid/django-users/CAHfGPEfRLO_VqswP9sHG%2BOM_HOob%2BQw2ztgvZx3TbMd5%3Dtk50w%40mail.gmail.com?utm_medium=email&utm_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/CANDnEWdBhLMgNud%2B6CZguak0%3DSEivu2VHOGEOY1RV2kVjS7oFw%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/django-users/CANDnEWdBhLMgNud%2B6CZguak0%3DSEivu2VHOGEOY1RV2kVjS7oFw%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>> --
>> Sent from Gmail Mobile
>>
>> --
>> 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/CAFZtZmAXX6s8E3h40CviBWqyfbyMqCZf%2ByJ2t9au4nNBUege6g%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CAFZtZmAXX6s8E3h40CviBWqyfbyMqCZf%2ByJ2t9au4nNBUege6g%40mail.gmail.com?utm_medium=email&utm_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/CANDnEWd1Np8NVggTn%2BZFWotKp0QdKo%2BF8W4TLUJJcmAYOyPJLQ%40mail.gmail.com.


Re: Django pdfs

2020-04-23 Thread Lunga Baliwe
I don't know about the download button but the PDF file should be just a
normal file like an image file
Check this Django admin
<https://readthedocs.org/projects/django-admin-cookbook/downloads/pdf/latest/>
cookbook
for working with django admin, there's an example of downloading a csv
hopefully it should work the same for the pdf aswell.
and also check
https://stackoverflow.com/questions/42077645/how-to-make-an-admin-action-in-django-to-download-users-pdf-files

On Thu, Apr 23, 2020 at 2:11 PM Perceval Maturure 
wrote:

>
> Hi Lunga
> thats the part of the model and the file in django admin in production.
> when debug is off i cant access to url to download the file, would be nice
> to have an download button in admin, just clicking on it and download the
> file. is the possible?
> Regards
> Perceval
>
> On Thu, Apr 23, 2020 at 1:13 PM Lunga Baliwe  wrote:
>
>> Also check
>> https://docs.djangoproject.com/en/3.0/ref/models/instances/#get-absolute-url
>>
>> Kind regards,
>> Lunga Baliwe
>>
>> On Thu, Apr 23, 2020 at 1:04 PM Lunga Baliwe  wrote:
>>
>>> Hi Perceval,
>>>
>>> On production I think you have to allow access to your MEDIA path, I
>>> normally do this on the apache config per site.
>>>
>>> Do you mind sharing your code or maybe  screen shots of what appears on
>>> the admin screen.
>>>
>>> Also it maybe be worth to return a name or url path like __str__
>>> <https://docs.djangoproject.com/en/3.0/ref/models/instances/#django.db.models.Model.__str__>
>>>  your
>>> model.
>>>
>>> You may also wanna check
>>> https://django-easy-pdf.readthedocs.io/en/v0.2.0-dev1/  and
>>> https://stackoverflow.com/questions/11779246/how-to-show-a-pdf-file-in-a-django-view/46267916
>>>
>>> On Thu, Apr 23, 2020 at 12:26 PM Perceval Maturure 
>>> wrote:
>>>
>>>> Hi Lunga
>>>> When debug mode is False in production the url link of the file is not
>>>> accessible in admin which is ok for security reasons but in admin I can
>>>> download the file for preview
>>>> Regards
>>>> Perceval
>>>>
>>>> On Wed, 22 Apr 2020 at 18:39, Lunga Baliwe  wrote:
>>>>
>>>>> Maybe you can check Django FileField
>>>>> <https://docs.djangoproject.com/en/3.0/ref/models/fields/#filefield>  for
>>>>> upload and check what it looks like on the admin side.
>>>>>
>>>>>
>>>>> On Wed, Apr 22, 2020 at 6:09 PM Hella Nick 
>>>>> wrote:
>>>>>
>>>>>> me to。do you help me?
>>>>>>
>>>>>> Perceval Maturure 于2020年4月22日 周三07:31写道:
>>>>>>
>>>>>>> Hi Django Users
>>>>>>>
>>>>>>> I am developing a Django document management system which will cater
>>>>>>> for pdf file uploads. What is the best resource to use (tutorial) as I 
>>>>>>> want
>>>>>>> to have the pdfs accessible from admin. Can I do this with Django filer
>>>>>>>
>>>>>>> Regards
>>>>>>>
>>>>>>> Perceval
>>>>>>>
>>>>>>> --
>>>>>>> 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/B912F6EC-E628-49E8-91AB-8442B25A7E34%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/CAHfGPEfRLO_VqswP9sHG%2BOM_HOob%2BQw2ztgvZx3TbMd5%3Dtk50w%40mail.gmail.com
>>>>>> <https://groups.google.com/d/msgid/django-users/CAHfGPEfRLO_VqswP9sHG%2BOM_HOob%2BQw2ztgvZx3TbMd5%3Dtk50w%40mail.gmail.com?utm_medium=email&utm_source=footer>
>

Re: How to create variables for an e-commerce website

2020-05-06 Thread Lunga Baliwe
maybe also check https://djangopackages.org/grids/g/ecommerce/ for django
ecommerce packages

On Wed, May 6, 2020 at 8:35 PM Motaz Hejaze  wrote:

> One solution is to make a 3 columns table , the first column is
> 'property_name' , second column 'property_value' , third column is a
> foriegn key to the item that this property belongs to 'item_id'
>
> On Wed, 6 May 2020, 8:06 pm Ahmed Khairy, 
> wrote:
>
>> Hi am looking for resources to create variables such as size and color to
>> an e-commerce website
>>
>> --
>> 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/e6ce14b0-c0ff-46fa-8903-635ed60c4459%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/CAHV4E-fUaT793Yctyim_cyY-SzrpNkw_Sbn6dO4O-8QEm-agOg%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/CANDnEWcAnK0QHTWyiHtr%2BC3AkGwmvtq0EP3YG6jQBFCgyZD8XA%40mail.gmail.com.


Django REST, Djoser and LOGIN_REDIRECT_URL

2018-11-19 Thread Lunga Baliwe
Hello everyone.
I am not an experienced Django dev, also I am new to Django REST and I'm
working on a project that uses Django REST with Djoser.

The requirement is that  every-time a user logs-in,  the user must be sent
an sms for authentication(Two factor authentication). Is this possible with
Djoser or Django REST?
I know the Two factor auth is possible after a user registers because on
the serializers there's a create function that can be intercepted. I don't
know what is the interception point after a user logs in or if my way of
thinking not correct.

Normally on a plain Django site, one would set LOGIN_REDIRECT_URL to the
view that you want to go to after the user logs in and then on that view,
you can do whatever needs to be done.


Kind regards.
Lunga

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CANDnEWd%3DgpqVci3_7bEGOLowaPyJkkiHBaZfffB7EQH7NyQejw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: STATIC FILES not working for admin site, projects and apps on DJANGO

2018-12-30 Thread Lunga Baliwe
Please have a look at this link
https://docs.djangoproject.com/en/2.1/howto/deployment/wsgi/modwsgi/ on how
to setup static files.
You may also want to run python manage.py collectstatic

On Sun, Dec 30, 2018 at 4:31 AM abel otugeme  wrote:

> This is how a site looks when i open it up in my browser No CSS! i
> have done the necessary settings for Django to find the static files
>
> On Sat, Dec 29, 2018 at 5:14 PM Kasper Laudrup 
> wrote:
>
>> Hi Abel,
>>
>> On 29/12/2018 08.07, abel otugeme wrote:
>> > I really need help i have combed through stackover flow and this group
>> > but the solutions provided don't work for me.  i use a 32bit windows 7
>> > OS and the latest version of django
>> >
>>
>> It would probably be easier for someone to help you if you tried to
>> describe what your actual problem is.
>>
>> 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 post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/c8273be3-bc53-2103-f503-ae7668f01622%40stacktrace.dk
>> .
>> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAMrS0S91GG0A%3D3Z263Q9nxLccStat-URs3NsW_pfqES_J5uU2Q%40mail.gmail.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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CANDnEWfqpqyk-nesQcAKT-4i9tzAw8aJne2VjXFkgxqFWKJXiA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: get user that is member of two different group

2020-01-02 Thread Lunga Baliwe
Hi there,
maybe you can use  something like
User.objects.filter(groups__name__in=['test1', 'test2']).
Also check https://docs.djangoproject.com/en/3.0/ref/models/querysets/#in for
examples of using __in

On Thu, Jan 2, 2020 at 6:49 AM sum abiut  wrote:

> Hi,
> I have two separate groups, for example, test1, and test2. I want to get a
> user that is a member of group test1 and group test2.
>
> I've try User.objects.filter(groups__name='test1') to get users of  group
> test1. not sure how to check if a user belongs to group test1 and is also
> belong to group test2
>
> --
> 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/CAPCf-y6F2rbgG1%3DgK4QX8FDKDq61b8mVdvtrtv5LwQQmfwhY3g%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/CANDnEWeuXRnMqCiS8co%3DhifuUhC8NrYo8e1j8Y_EVF6r1sBwew%40mail.gmail.com.