Re: Mysql for Django

2023-09-24 Thread DieHardMan 300
Do you mean you can't use mysqlclient with Django? Do you already install 
homebrew in MAC? Do you already install mysql server using homebrew?
ในวันที่ วันจันทร์ที่ 25 กันยายน ค.ศ. 2023 เวลา 3 นาฬิกา 50 นาที 25 วินาที 
UTC+7 Lakhjeet Samra เขียนว่า:

> Hi Guys, 
> I am new to Django
> I use Mac ,
>  I am unable to down mysqlclient  for Django project any suggestions 
> I have Mysql workbench installed  Is it right.
>
> Thank You
> Lakhjeet
>

-- 
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/051ed6a3-574f-4813-b976-0b82b0480019n%40googlegroups.com.


Re: PermissionError

2023-07-09 Thread DieHardMan 300
You might want to check if the project folder permission allow nginx to 
read/modify/delete. Normally checking by enter "ls -l" inside project 
folder in ubuntu terminal to check if "www-data:www-data" (user:group) has 
CRUD permission. If not using chown and chmod command.
ในวันที่ วันอาทิตย์ที่ 9 กรกฎาคม ค.ศ. 2023 เวลา 23 นาฬิกา 53 นาที 21 วินาที 
UTC+7 Makan Dianka เขียนว่า:

> I mean show the full path of the folder that u want rename 
>
> Le dim. 9 juil. 2023, 18:50, Makan Dianka  a écrit :
>
>> can u so the full path of folder that u want rename plz?
>>
>> Le dim. 9 juil. 2023, 16:54, Munna Singh  a écrit :
>>
>>> Hi,
>>> I'm using windows system for development purposes on which my code is 
>>> working fine but the same code throwing error on remote system(ubuntu).
>>>  repo_dir = "xyz"
>>>   renamed_repo_dir = "xyz"+"_delete_xyz"
>>>  os.rename(repo_dir, renamed_repo_dir)
>>>   PermissionError: [Errno 13] Permission denied:
>>> I'm trying to rename an existing directory coz i have to write a new 
>>> directory with same path thn deleting the renamed one.
>>>
>>> Please help.
>>>
>>> thanks
>>> Munna Singh
>>>
>>> -- 
>>> 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/CAPrh91RZjcfrsJge_%3D_AsD6SMD-hQL7uvLEh%3DPR-UFocQ-oV0w%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/4d7ed1e9-2279-47e2-992f-d7b713d60923n%40googlegroups.com.


Re: need help

2023-07-05 Thread DieHardMan 300
On the server, change the following in settings
DEBUG = True# django will tell what cause the error 
instead of error500
ALLOWED_HOST = ["*"]# this allow all hosts but you should do this only 
for testing
most of the time, error 500 often cause from database connection 
problems in server side, you should create new user in database and give 
permissions to that user (do no use root user)
ในวันที่ วันพฤหัสบดีที่ 6 กรกฎาคม ค.ศ. 2023 เวลา 0 นาฬิกา 49 นาที 56 วินาที 
UTC+7 Bouka Largent เขียนว่า:

> hello 
>
> Le mar. 4 juil. 2023, 4:44, Theresa Taye  a écrit :
>
>> Hello,
>>
>> You see a Server error because Debug is set to False. To know what the 
>> actual error is, turn it back to True. Then when you are done debugging you 
>> can change that especially if you are pushing to production.
>>
>> On Tue, 4 Jul 2023 at 16:21, Abdoulaye SENE  
>> wrote:
>>
>>> thanks for the help. but after  writing ["*"] i see   Server Error (500)
>>>
>>> Le mardi 4 juillet 2023 à 14:46:01 UTC, ALBERT ASHABA AHEEBWA a écrit :
>>>
 Sorry I meant turn 
 DEBUG = True




 Best Regards,

 Albert Ashaba Aheebwa
 +256 781 435857 <+256%20781%20435857>

 On Tue, 4 Jul 2023, 17:44 ALBERT ASHABA AHEEBWA, <
 ashabaahe...@gmail.com> wrote:

> Go to your settings.py and look for allowed_hosts and make it 
> ALLOWED_HOSTS = ["*"]
>
> or better yet, if you are in development, turn
> DEBUG = False
>
>
>
> Best Regards,
>
> Albert Ashaba Aheebwa
> +256 781 435857 <+256%20781%20435857>
>
> On Tue, 4 Jul 2023, 17:38 Abdoulaye SENE,  
> wrote:
>
>> hello,
>> while programming, i see this problem : " CommandError: You must set 
>> settings.ALLOWED_HOSTS if DEBUG is False."
>> i wonder if someone can help me to fix it.
>>
>> -- 
>> 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/171c894c-5f04-445d-939f-c6c949caae35n%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/82b9160b-6056-4cc6-9fa5-6d52de5512a1n%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/CAENBRfMNWVA-_jm0eUiDGSL-1kQJvDsLnXGjZ870aivXFEDfCA%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/8663160e-338a-44f6-97df-9c6fab6b1cecn%40googlegroups.com.


Dashboard with plotting graph

2023-06-20 Thread DieHardMan 300
Hello, I hope everyone have a good day. I want to start building dashboard 
with the plotting graph in my Django 4.2 web application. So I want some 
recommendations of what libraries should I use or what libraries work best 
for you guys.

-- 
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/996f9141-d514-41f4-8658-7deb9c7c041an%40googlegroups.com.


Re: template css issue

2023-06-07 Thread DieHardMan 300
Did you collectstatic and config Nginx to serve the static folder? It's 
happen to me sometimes when I deploy project to server.

ในวันที่ วันพุธที่ 7 มิถุนายน ค.ศ. 2023 เวลา 13 นาฬิกา 42 นาที 01 วินาที 
UTC+7 Praveen Chaudhary เขียนว่า:

> This is the original template and it's working locally.
>
>
> Thank you!
> Your E-mail has been received
> Prabin Chaudhary
> +977-9840193890 <+977%20984-0193890>
> *https://www.linkedin.com/in/icedreamerpraveen/ 
> *
> Software Engineer | Youth Innovation Lab
>
> On Wed, 7 Jun 2023 at 12:23, Praveen Chaudhary  
> wrote:
>
>> Hello Everyone,
>>
>> Hope you are doing well. I want a small favor from you guys.
>> Here I have attached two files. These files are the email template sent 
>> from the django project to the outlook. The template looks correct and the 
>> css is working fine when I send the email from local but the css is not 
>> working when I deploy it to the server. You can see the difference .
>> Can anyone please tell me what i am missing or doing wrong. 
>>
>> *Prabin Chaudhary*
>>
>> Software Engineer | Youth Innovation Lab 
>>
>> Mobile: +977-9840193890 <+977%20984-0193890> | prabin...@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/b32afe0a-6ce4-4386-94db-35c477eb7ca4n%40googlegroups.com.


Re: Django inside WSL cannot connect to host database

2023-05-31 Thread DieHardMan 300
Are you set "ALLOWED_HOSTS" in settings.py for  "172.21.48.1"  ?
ในวันที่ วันพุธที่ 31 พฤษภาคม ค.ศ. 2023 เวลา 14 นาฬิกา 38 นาที 48 วินาที 
UTC+7 Robbi Nespu เขียนว่า:

>
> Hello,
> I am using windows machine to develop django project but now i want to 
> make my program run on WSL and keep the DB are running on host (windows 
> machine), 
>
> This mean the Django program inside WSL will try to connect to postgresql 
> on WINDOWS.
>
>
>
> > $ cat /etc/resolv.conf | grep name
> > nameserver 172.21.48.1
>
>
> The NMAP show the IP and PORT are correct
>
> > 
> > $ nmap -p 5432 172.21.48.1
> > Starting Nmap 7.80 ( https://nmap.org ) at 2023-05-31 15:26 +08
> > Nmap scan report for WINDOWSMACHINE.mshome.net (172.21.48.1)
> > Host is up (0.00049s latency).
> > 
> > PORT STATE SERVICE
> > 5432/tcp filtered postgresql
> > 
> > Nmap done: 1 IP address (1 host up) scanned in 0.24 seconds
>
>
> This are my setting-database
>
> > DATABASES = {
> > 'default': {
> > 'ENGINE': 'django.db.backends.postgresql',
> > 'NAME' : 'LMHOST',
> > 'USER' : 'postgres',
> > 'PASSWORD' : '',
> > 'HOST': '172.21.48.1',
> > 'PORT': 5432,
> > }
> > }
>
> but the connection cannot be established. Here the output I get
>
> > $ python manage.py migrate
> > Traceback (most recent call last):
> > File 
> "/home/robbi/.virtualenvs/DJANGO_VIRTUALENV/lib/python3.9/site-packages/django/db/backends/base/base.py",
>  
> line 289, in ensure_connection
> > self.connect()
> > File 
> "/home/robbi/.virtualenvs/DJANGO_VIRTUALENV/lib/python3.9/site-packages/django/utils/asyncio.py",
>  
> line 26, in inner
> > return func(*args, **kwargs)
> > File 
> "/home/robbi/.virtualenvs/DJANGO_VIRTUALENV/lib/python3.9/site-packages/django/db/backends/base/base.py",
>  
> line 270, in connect
> > self.connection = self.get_new_connection(conn_params)
> > File 
> "/home/robbi/.virtualenvs/DJANGO_VIRTUALENV/lib/python3.9/site-packages/django/utils/asyncio.py",
>  
> line 26, in inner
> > return func(*args, **kwargs)
> > File 
> "/home/robbi/.virtualenvs/DJANGO_VIRTUALENV/lib/python3.9/site-packages/django/db/backends/postgresql/base.py",
>  
> line 275, in get_new_connection
> > connection = self.Database.connect(**conn_params)
> > File 
> "/home/robbi/.virtualenvs/DJANGO_VIRTUALENV/lib/python3.9/site-packages/psycopg/connection.py",
>  
> line 728, in connect
> > raise ex.with_traceback(None)
> > psycopg.OperationalError: connection failed: server closed the 
> connection unexpectedly
> > This probably means the server terminated abnormally
> > before or while processing the request.
>
>
> any clue on this? I have already tried disable firewall but still no luck
>
> -- 
> Regards
> Robbi Nespu
>
> PGP: D311 B5FF EEE6 0BE8 9C91 FA9E 0C81 FA30 3B3A 80BA
>
>

-- 
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/1c9881bc-ef4d-493a-b1e9-96866e59e7dbn%40googlegroups.com.


Re: Finding Help in getting started in Django

2023-05-31 Thread DieHardMan 300
I'd like to give some advice before start your Django journey and Django 
project configurations
-- Before Start Django --
1. master Python "class" bacause you might use django class-based view a 
lot, learn "decorator" and standard library "datetime" and "re"
2. choose "Python version" for your django project, I recommend Python 3.10 
or 3.11. You should check current installed Python version
in your terminal --> py --version
** if you use Unix OS like MacOS or Linux, type "python3" instead of "py"
3. I highly recommend create virtual environment for each django project, 
install virtualenv with pip
windows cmd --> py -m pip install virtualenv
then --> py -m virtualenv app-env
macos terminal --> python3 -m pip install virtualenv
then --> python3 -m virtualenv app-env
4. activate virtual environment you just created
windows cmd --> app-env\Scripts\activate.bat   or  
 app-env\Scripts\activate
macos terminal --> source/bin/activate
to stop virtualenv just type --> deactivate
5. install django latest version via pip (you must activate virtualenv 
first)
--> py -m pip install django
-- Start Django --
1. start new django project (don't forget to activate virtualenv first)
--> django-admin startproject my-app
2. go inside project folder and create "requirements.txt" and type all 
requirement library for your project
   --- requirements.txt ---
django >= 4.2.0, < 4.3.0
wheel >= 0.4.0
ipython >= 8.11.0   # python shell for django project
python-decouple >= 3.7.0# for hiding sensitive data in settings.py 
before uploading to git
setuptools >= 67.7.0
psycopg >= 3.0.0   # postgresql database driver. if you 
use django 4.1 or lower you must install psycopg2 instead of psycopg
 mysqlclient => 2.1.1# mysql database driver. if you 
already use postgresql you don't need this
3. install specified dependencies
--> py -m pip install -r requirements.txt
for upgrade your dependencies --> py -m pip install --upgrade -r 
requirements.txt
by doing this you have more control to your project dependencies
for example if you specified "django >= 4.2.0, < 4.3.0" it will upgrade 
django between 4.2.0 to 4.2.* but never 4.3.0
4. in your main project directory it will have 3 files now
my-app,  manage.py  and  requirements.txt
5. open "settings.py" in "my-app"
first thing you need to be cautious is SECRET_KEY constant. You must 
never lose it or expose this to public that's why "python-decouple" library 
needed
for more information https://pypi.org/project/python-decouple/
6. in DATABASE section change it to your database
--- for postgresql ---
DATABASES = {
'default': {
DATABASE_ENGINE='django.db.backends.postgresql'
DATABASE_NAME='mydatabase'
DATABASE_USER='root'
DATABASE_PASSWORD=''
DATABASE_HOST='localhost'
DATABASE_PORT='5432'
}
}
--- for mysql ---
DATABASES = {
'default': {
ALLOWED_HOSTS='localhost'
DATABASE_ENGINE='django.db.backends.mysql'
DATABASE_NAME='mydatabase'
DATABASE_USER='root'
DATABASE_PASSWORD=''
DATABASE_HOST='localhost'
DATABASE_PORT='3306'
}
add your "user" and "password", both database port above are default port 
though
7. start your first database migrate
--> py manage.py migrate

Now go for Django Tutorial --> https://docs.djangoproject.com/en/4.2/
I hope this help you avoid some problems in the future.

ในวันที่ วันอังคารที่ 30 พฤษภาคม ค.ศ. 2023 เวลา 21 นาฬิกา 56 นาที 14 วินาที 
UTC+7 Veronica Ndemo เขียนว่า:

> Hi guys I need help.I am just getting started in using Django and I would 
> love to get guidance on how to go about the Django framework

-- 
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/8f7da283-844b-4fd3-aa73-324a5ada7d7cn%40googlegroups.com.


Re: Finding Help in getting started in Django

2023-05-31 Thread DieHardMan 300
I'd like to give some advice before start your Django journey and Django 
project configurations
-- Before Start Django --
1. master Python "class" bacause you might use django class-based view a 
lot, learn "decorator" and standard library "datetime" and "re"
2. choose "Python version" for your django project, I recommend Python 3.10 
or 3.11. You should check current installed Python version
in your terminal --> py --version
** if you use Unix OS like MacOS or Linux, type "python3" instead of "py"
3. I highly recommend create virtual environment for each django project, 
install virtualenv with pip
windows cmd --> py -m pip install virtualenv
then --> py -m virtualenv app-env
macos terminal --> python3 -m pip install virtualenv
then --> python3 -m virtualenv app-env
4. activate virtual environment you just created
windows cmd --> app-env\Scripts\activate.bat   or  
 app-env\Scripts\activate
macos terminal --> source/bin/activate
to stop virtualenv just type --> deactivate
5. install django latest version via pip (you must activate virtualenv 
first)
--> py -m pip install django
-- Start Django --
1. start new django project (don't forget to activate virtualenv first)
--> django-admin startproject my-app
2. go inside project folder and create "requirements.txt" and type all 
requirement library for your project
   --- requirements.txt ---
django >= 4.2.0, < 4.3.0
wheel >= 0.4.0
ipython >= 8.11.0   # python shell for django project
python-decouple >= 3.7.0# for hiding sensitive data in settings.py 
before uploading to git
setuptools >= 67.7.0
psycopg >= 3.0.0   # postgresql database driver. if you 
use django 4.1 or lower you must install psycopg2 instead of psycopg
 mysqlclient => 2.1.1# mysql database driver. if you 
already use postgresql you don't need this
3. install specified dependencies
--> py -m pip install -r requirements.txt
for upgrade your dependencies --> py -m pip install --upgrade -r 
requirements.txt
by doing this you have more control to your project dependencies
for example if you specified "django >= 4.2.0, < 4.3.0" it will upgrade 
django between 4.2.0 to 4.2.* but never 4.3.0
4. in your main project directory it will have 3 files now
my-app,  manage.py  and  requirements.txt
5. open "settings.py" in "my-app"
first thing you need to be cautious is SECRET_KEY constant. You must 
never lose it or expose this to public that's why "python-decouple" library 
needed
for more information https://pypi.org/project/python-decouple/
6. in DATABASE section change it to your database
--- for postgresql ---
DATABASES = {
'default': {
ALLOWED_HOSTS='localhost'
DATABASE_ENGINE='django.db.backends.postgresql'
DATABASE_NAME='mydatabase'
DATABASE_USER='root'
DATABASE_PASSWORD=''
DATABASE_HOST='localhost'
DATABASE_PORT='5432'
}
}
--- for mysql ---
DATABASES = {
'default': {
ALLOWED_HOSTS='localhost'
DATABASE_ENGINE='django.db.backends.mysql'
DATABASE_NAME='mydatabase'
DATABASE_USER='root'
DATABASE_PASSWORD=''
DATABASE_HOST='localhost'
DATABASE_PORT='3306'
}
add your "user" and "password", both database port above are default port 
though
7. start your first database migrate
--> py manage.py migrate

Now go for Django Tutorial --> https://docs.djangoproject.com/en/4.2/
I hope this help you avoid some problems in the future.

ในวันที่ วันอังคารที่ 30 พฤษภาคม ค.ศ. 2023 เวลา 21 นาฬิกา 56 นาที 14 วินาที 
UTC+7 Veronica Ndemo เขียนว่า:

Hi guys I need help.I am just getting started in using Django and I would 
love to get guidance on how to go about the Django framework

-- 
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/c3ccfae8-1ca0-4b02-98b6-e7d8b32776a2n%40googlegroups.com.


Re: UPLOAD STATIC FILES

2023-05-30 Thread DieHardMan 300
settings.py
- add following line if not exist
--
STATIC_URL = 'static/'

in your static folder ---> project_name/app_name/static/app_name/
* I recommend create another folder in your static folder with your app 
name to avoid duplicate static file name with other apps
* Also I recommend create "new folder" name "css" and "js"
--> project_name/app_name/static/app_name/css
--> project_name/app_name/static/app_name/js

now on top of your "template" html file add following line:
* note that you must add this line for every template you using static 
or "extends" from template that use static

{% load static %}


how to import css


or
hello, world


how to import javascript




in django tutorial --> 
https://docs.djangoproject.com/en/4.2/intro/tutorial06/
and documentation for this --> 
https://docs.djangoproject.com/en/4.2/howto/static-files/

ในวันที่ วันจันทร์ที่ 29 พฤษภาคม ค.ศ. 2023 เวลา 22 นาฬิกา 31 นาที 33 วินาที 
UTC+7 Obiorah Callistus เขียนว่า:

> please how can i display .css and .js files in my template

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/b8de72ab-fc82-4a44-9354-84d3f3890e73n%40googlegroups.com.


Re: UPLOAD STATIC FILES

2023-05-30 Thread DieHardMan 300
settings.py
- add following line if not exist
--
STATIC_URL = 'static/'

in your static folder ---> project_name/app_name/static/app_name/
* I recommend create another folder in your static folder with your app 
name to avoid duplicate static file name with other apps
* Also I recommend create "new folder" name "css" and "js"
--> project_name/app_name/static/app_name/css
--> project_name/app_name/static/app_name/js

now on top of your "template" html file add following line:
* note that you must add this line for every template you using static 
or "extends" from template that use static

{% load static %}


how to import css


or
hello, world


how to import javascript




in django tutorial --> 
https://docs.djangoproject.com/en/4.2/intro/tutorial06/
and documentation for this 
--> https://docs.djangoproject.com/en/4.2/howto/static-files/

ในวันที่ วันจันทร์ที่ 29 พฤษภาคม ค.ศ. 2023 เวลา 22 นาฬิกา 31 นาที 33 วินาที 
UTC+7 Obiorah Callistus เขียนว่า:

please how can i display .css and .js files in my template 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/16f24801-c43d-4381-9d96-3ee1885a07b5n%40googlegroups.com.


Re: Can't load the images

2023-05-28 Thread DieHardMan 300
1. Make sure that django.contrib.staticfiles is included in your 
INSTALLED_APPS 

2. also if it already included, adding the following snippet to your urls.py
:
---
from django.conf import settings
from django.conf.urls.static import static

urlpatterns = [
# others urls,
] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
---
3. also in your settings.py adding STATIC_ROOT, make sure you have 
"pathlib" imported above:
---
from  pathlib import Path
# ...
# ... other code
# ...
STATIC_URL = "static/"
STATIC_ROOT = Path.joinpath(BASE_DIR, STATIC_URL)
---
or if you prefer os module adding this instead in settings.py
---
import os
# ...
# ... other code
# ...
STATIC_URL = "static/"
STATIC_ROOT = os.path.join(BASE_DIR, STATIC_URL)
---
Although this is not suitable for production, only for development.
for production -> 
deployment https://docs.djangoproject.com/en/4.2/howto/static-files/deployment/
I hope this help.
ในวันที่ วันเสาร์ที่ 27 พฤษภาคม ค.ศ. 2023 เวลา 23 นาฬิกา 28 นาที 21 วินาที 
UTC+7 Ramesh Parajuli เขียนว่า:

> Please help 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/a27080c6-bdbc-4c7b-9f6e-9817bf0496e1n%40googlegroups.com.


Template Filter - stringformat issue

2023-03-14 Thread DieHardMan 300
I tried Django template built-in filter "stringformat" to fixed string 
length to 3 for example assume I have variable name "data" contain "A1" I 
want to display this variable as "A1 " (1 blank space) so my code is
{{ data|stringformat:":<3s" }}  --> Result is None
so I tried another 6 examples
{{ data|stringformat:":<3" }}  --> Result is None
{{ data|stringformat:"{:<3}" }}  --> Result is None
{{ data|stringformat:":3" }}  --> Result is None
{{ data|stringformat:"{:3}" }} --> Result is None
{{ data|stringformat:":<3s" }} --> Result is None
{{ data|stringformat:"3s" }} --> Result is "A1" not "A1 "
I'm not sure what I'm missing, I cannot find answer online if anyone could 
help I would be appriciate.

-- 
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/a2e3c84c-5206-4bc7-9833-3b6eb48b835dn%40googlegroups.com.