runserver not working

2022-03-21 Thread 'Delvin Alexander' via Django users
would anyone know why my "manage.py runserver" is not working?

Every time i try running it on the command prompt, i get relocated to my 
visual studio of manage.py file that states this:

#*!/usr/bin/env python*
*"""Django's command-line utility for administrative tasks."""*
*import os*
*import sys*


*def main():*
*"""Run administrative tasks."""*
*os.environ.setdefault('DJANGO_SETTINGS_MODULE', 
'django_project.settings')*
*try:*
*from django.core.management import execute_from_command_line*
*except ImportError as exc:*
*raise ImportError(*
*"Couldn't import Django. Are you sure it's installed and "*
*"available on your PYTHONPATH environment variable? Did you "*
*"forget to activate a virtual environment?"*
*) from exc*
*execute_from_command_line(sys.argv)*


*if __name__ == '__main__':*
*main()*


A step in the right direction will be super helpful for me.

-- 
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/69291c68-61e7-4557-8175-7b705bcfcbb0n%40googlegroups.com.


Re: How do detect if template is being viewed on mobile device?

2022-03-21 Thread Kayode Oladipo
Hello,
I had this exact problem, and I solved it using this package.

https://pypi.org/project/django-user-agents/

Cheers.

On Sun, Mar 20, 2022 at 7:01 PM Django2021  wrote:

> Thanks for your answers.
> Rephrasing question in another thread.
>
>
> On Thursday, March 17, 2022 at 8:11:10 AM UTC+1 Antonis Christofides wrote:
>
>> Inside of a Django function or template we need to know if to display
>> a landscape or portrait of a form - based on knowing if the viewer is
>> using a mobile or not.
>>
>> Your requirement to know whether you are using "landscape or portrait" is
>> unusual. Normally we are only interested in knowing the width of the
>> screen. If the screen is wide enough, we show the wide version, without
>> caring about what the height of the screen is (it could be a large screen
>> in portrait, for example).
>>
>> In any case, I think you can solve it with CSS (even if you really want
>> to take the height of the screen into account). This problem has nothing to
>> with Python and Django, it's merely a HTML+CSS issue. If you don't want to
>> learn much CSS, using a CSS framework like Bootstrap can help.
>>
>> Regards,
>>
>> Antonis
>>
>> Antonis Christofides
>>
>>
>>
>>
>> On 16/03/2022 22.42, Django2021 wrote:
>>
>> > There are many ways to approach this problem, so it would be best to
>> explain what you are trying to achieve.
>>
>> Inside of a Django function or template we need to know if to display
>> a landscape or portrait of a form - based on knowing if the viewer is
>> using a mobile or not.
>> On Wednesday, March 16, 2022 at 9:34:09 PM UTC+1 Antonis Christofides
>> wrote:
>>
>>> Hello,
>>>
>>> there are many ways to approach this problem, so it would be best to
>>> explain what you are trying to achieve.
>>>
>>> Regards,
>>>
>>> Antonis
>>>
>>> Antonis Christofides+30-6979924665 <+30%20697%20992%204665> (mobile)
>>>
>>>
>>> On 16/03/2022 22.28, Django2021 wrote:
>>>
>>>
>>> With Django how is it possible to detect
>>> * if template is being viewed on mobile device?
>>> and/or
>>> * if template is being viewed in portrait or landscape mode?
>>>
>>> Any suggestions 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...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/7be1145e-662e-4d57-afa6-b9d178f7fb0fn%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...@googlegroups.com.
>>
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/83a4a51d-6913-47ce-a5da-f49f4b3d72abn%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/886527f7-3750-4d93-b119-1b75bce8609cn%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/CA%2BARzD96-sSTVAGgxD335miXEBrFZJydcBqm8igJefLjxQZoug%40mail.gmail.com.


Re: Using Admin to manage users that is not in django

2022-03-21 Thread Thiago Luiz Parolin
Thank you!!
I will follow your instructions. I think this will be enough for my app.

Em seg., 21 de mar. de 2022 às 00:26, Aldian Fazrihady 
escreveu:

> Django admin is so coupled to Django models.
> Django admin is customizable.
>
> If you want some "integration" with your existing Django admin that is
> already linked to your existing models,
> you can edit the Django admin index page template and put the link to your
> Samba AD DC management page.
> Your Samba AD DC management page will be an ordinary Django app.
>
> On Mon, Mar 21, 2022 at 9:52 AM Thiago Luiz Parolin 
> wrote:
>
>> Hi.
>> I am trying to make a web app to manage samba AD DC.
>> Using python bindings from samba, i can access users/groups/features of
>> our directory.
>> What i want is:
>>  - How can i use the django admin to manage AD? Because all the user base
>> is inside samba, not in django.
>>  - Or i need to build my own 'admin'?
>>
>> Thanks for any advice.
>>
>> --
>> 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/CANbmKytFbGCezptTES%2BqEBebpsVQg0wYrnM129W7jRyR50xSxA%40mail.gmail.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/CAN7EoAaYh2H6A_31ehLktAzN7-W%3DTA_0vzqNiWT34nBovMb5Pg%40mail.gmail.com
> 
> .
>


-- 
Thiago Luiz Parolin

-- 
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/CANbmKytBfy57YDCva1xpYS_q4%2Bau%3Dc5ky5qAhY%2BZPZ6JG-SQ8g%40mail.gmail.com.