Re: Regarding Django models.

2020-06-18 Thread MANISH YADAV
But if I use SQL Alchemy, can I use django admin panel. Because need that. 

-- 
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/d24e9e30-08d1-4082-ba3b-58555aebca68o%40googlegroups.com.


Re: python manage.py runserver error

2020-06-18 Thread Utsab Bashyal
enter inside your project directory   using command cd project_name in
termina and run manage.py runserver


On Fri, Jun 19, 2020 at 6:52 AM Thomas Furtado 
wrote:

> Hii, thanks for answering but it didn't work
> Now it showed: no module named 'django.contrib.statics'
>
> Em qui, 18 de jun de 2020 22:03, chaitanya orakala <
> chaitu.orak...@gmail.com> escreveu:
>
>> Hi Thomas,
>> Please run the following commands to solve this problem, before running
>> the server.
>>
>> python manage.py makemigrations
>> python manage.py migrate
>>
>> and then command
>> python manage.py runserver
>>
>> Hope this helps. Let me know if you have any questions
>>
>> On Thu, Jun 18, 2020 at 6:15 PM Thomas Furtado 
>> wrote:
>>
>>> Hi, I've seen you sent this last year and I'm having the same error
>>> message at my pycharm... Did you solve this?? could you help me with this
>>> please??
>>>
>>> Em sábado, 13 de julho de 2019 08:35:31 UTC-3, Jack Bergemann escreveu:

 (venv) C:\Users\Chas\rp-portfolio\personal_portfolio>python manage.py
 runserver
 Watching for file changes with StatReloader
 Exception in thread django-main-thread:
 Traceback (most recent call last):
   File "C:\Python37\lib\threading.py", line 926, in _bootstrap_inner
 self.run()
   File "C:\Python37\lib\threading.py", line 870, in run
 self._target(*self._args, **self._kwargs)
   File
 "C:\Users\Chas\rp-portfolio\venv\lib\site-packages\django\utils\autoreload.py",
 line 54, in wrapper
 fn(*args, **kwargs)
   File
 "C:\Users\Chas\rp-portfolio\venv\lib\site-packages\django\core\management\commands\runserver.py",
 line 109, in inner_run
 autoreload.raise_last_exception()
   File
 "C:\Users\Chas\rp-portfolio\venv\lib\site-packages\django\utils\autoreload.py",
 line 77, in raise_last_exception
 raise _exception[1]
   File
 "C:\Users\Chas\rp-portfolio\venv\lib\site-packages\django\core\management\__init__.py",
 line 337, in execute
 autoreload.check_errors(django.setup)()
   File
 "C:\Users\Chas\rp-portfolio\venv\lib\site-packages\django\utils\autoreload.py",
 line 54, in wrapper
 fn(*args, **kwargs)
   File
 "C:\Users\Chas\rp-portfolio\venv\lib\site-packages\django\__init__.py",
 line 24, in setup
 apps.populate(settings.INSTALLED_APPS)
   File
 "C:\Users\Chas\rp-portfolio\venv\lib\site-packages\django\apps\registry.py",
 line 91, in populate
 app_config = AppConfig.create(entry)
   File
 "C:\Users\Chas\rp-portfolio\venv\lib\site-packages\django\apps\config.py",
 line 90, in create
 module = import_module(entry)
   File "C:\Python37\lib\importlib\__init__.py", line 127, in
 import_module
 return _bootstrap._gcd_import(name[level:], package, level)
   File "", line 1006, in _gcd_import
   File "", line 983, in _find_and_load
   File "", line 965, in
 _find_and_load_unlocked
 ModuleNotFoundError: No module named 'hello_world'

 Traceback (most recent call last):
   File "manage.py", line 21, in 
 main()
   File "manage.py", line 17, in main
 execute_from_command_line(sys.argv)
   File
 "C:\Users\Chas\rp-portfolio\venv\lib\site-packages\django\core\management\__init__.py",
 line 381, in execute_from_command_line
 utility.execute()
   File
 "C:\Users\Chas\rp-portfolio\venv\lib\site-packages\django\core\management\__init__.py",
 line 375, in execute
 self.fetch_command(subcommand).run_from_argv(self.argv)
   File
 "C:\Users\Chas\rp-portfolio\venv\lib\site-packages\django\core\management\base.py",
 line 323, in run_from_argv
 self.execute(*args, **cmd_options)
   File
 "C:\Users\Chas\rp-portfolio\venv\lib\site-packages\django\core\management\commands\runserver.py",
 line 60, in execute
 super().execute(*args, **options)
   File
 "C:\Users\Chas\rp-portfolio\venv\lib\site-packages\django\core\management\base.py",
 line 364, in execute
 output = self.handle(*args, **options)
   File
 "C:\Users\Chas\rp-portfolio\venv\lib\site-packages\django\core\management\commands\runserver.py",
 line 95, in handle
 self.run(**options)
   File
 "C:\Users\Chas\rp-portfolio\venv\lib\site-packages\django\core\management\commands\runserver.py",
 line 102, in run
 autoreload.run_with_reloader(self.inner_run, **options)
   File
 "C:\Users\Chas\rp-portfolio\venv\lib\site-packages\django\utils\autoreload.py",
 line 587, in run_with_reloader
 start_django(reloader, main_func, *args, **kwargs)
   File
 "C:\Users\Chas\rp-portfolio\venv\lib\site-packages\django\utils\autoreload.py",
 line 572, in start_django
 reloader.run(django_main_thread)
   File
 "C:\Users\Chas\rp-portfolio\venv\lib\site-packages\django\utils\autoreload.py",
 line 

Re: python manage.py runserver error

2020-06-18 Thread Thomas Furtado
Hii, thanks for answering but it didn't work
Now it showed: no module named 'django.contrib.statics'

Em qui, 18 de jun de 2020 22:03, chaitanya orakala 
escreveu:

> Hi Thomas,
> Please run the following commands to solve this problem, before running
> the server.
>
> python manage.py makemigrations
> python manage.py migrate
>
> and then command
> python manage.py runserver
>
> Hope this helps. Let me know if you have any questions
>
> On Thu, Jun 18, 2020 at 6:15 PM Thomas Furtado 
> wrote:
>
>> Hi, I've seen you sent this last year and I'm having the same error
>> message at my pycharm... Did you solve this?? could you help me with this
>> please??
>>
>> Em sábado, 13 de julho de 2019 08:35:31 UTC-3, Jack Bergemann escreveu:
>>>
>>> (venv) C:\Users\Chas\rp-portfolio\personal_portfolio>python manage.py
>>> runserver
>>> Watching for file changes with StatReloader
>>> Exception in thread django-main-thread:
>>> Traceback (most recent call last):
>>>   File "C:\Python37\lib\threading.py", line 926, in _bootstrap_inner
>>> self.run()
>>>   File "C:\Python37\lib\threading.py", line 870, in run
>>> self._target(*self._args, **self._kwargs)
>>>   File
>>> "C:\Users\Chas\rp-portfolio\venv\lib\site-packages\django\utils\autoreload.py",
>>> line 54, in wrapper
>>> fn(*args, **kwargs)
>>>   File
>>> "C:\Users\Chas\rp-portfolio\venv\lib\site-packages\django\core\management\commands\runserver.py",
>>> line 109, in inner_run
>>> autoreload.raise_last_exception()
>>>   File
>>> "C:\Users\Chas\rp-portfolio\venv\lib\site-packages\django\utils\autoreload.py",
>>> line 77, in raise_last_exception
>>> raise _exception[1]
>>>   File
>>> "C:\Users\Chas\rp-portfolio\venv\lib\site-packages\django\core\management\__init__.py",
>>> line 337, in execute
>>> autoreload.check_errors(django.setup)()
>>>   File
>>> "C:\Users\Chas\rp-portfolio\venv\lib\site-packages\django\utils\autoreload.py",
>>> line 54, in wrapper
>>> fn(*args, **kwargs)
>>>   File
>>> "C:\Users\Chas\rp-portfolio\venv\lib\site-packages\django\__init__.py",
>>> line 24, in setup
>>> apps.populate(settings.INSTALLED_APPS)
>>>   File
>>> "C:\Users\Chas\rp-portfolio\venv\lib\site-packages\django\apps\registry.py",
>>> line 91, in populate
>>> app_config = AppConfig.create(entry)
>>>   File
>>> "C:\Users\Chas\rp-portfolio\venv\lib\site-packages\django\apps\config.py",
>>> line 90, in create
>>> module = import_module(entry)
>>>   File "C:\Python37\lib\importlib\__init__.py", line 127, in
>>> import_module
>>> return _bootstrap._gcd_import(name[level:], package, level)
>>>   File "", line 1006, in _gcd_import
>>>   File "", line 983, in _find_and_load
>>>   File "", line 965, in
>>> _find_and_load_unlocked
>>> ModuleNotFoundError: No module named 'hello_world'
>>>
>>> Traceback (most recent call last):
>>>   File "manage.py", line 21, in 
>>> main()
>>>   File "manage.py", line 17, in main
>>> execute_from_command_line(sys.argv)
>>>   File
>>> "C:\Users\Chas\rp-portfolio\venv\lib\site-packages\django\core\management\__init__.py",
>>> line 381, in execute_from_command_line
>>> utility.execute()
>>>   File
>>> "C:\Users\Chas\rp-portfolio\venv\lib\site-packages\django\core\management\__init__.py",
>>> line 375, in execute
>>> self.fetch_command(subcommand).run_from_argv(self.argv)
>>>   File
>>> "C:\Users\Chas\rp-portfolio\venv\lib\site-packages\django\core\management\base.py",
>>> line 323, in run_from_argv
>>> self.execute(*args, **cmd_options)
>>>   File
>>> "C:\Users\Chas\rp-portfolio\venv\lib\site-packages\django\core\management\commands\runserver.py",
>>> line 60, in execute
>>> super().execute(*args, **options)
>>>   File
>>> "C:\Users\Chas\rp-portfolio\venv\lib\site-packages\django\core\management\base.py",
>>> line 364, in execute
>>> output = self.handle(*args, **options)
>>>   File
>>> "C:\Users\Chas\rp-portfolio\venv\lib\site-packages\django\core\management\commands\runserver.py",
>>> line 95, in handle
>>> self.run(**options)
>>>   File
>>> "C:\Users\Chas\rp-portfolio\venv\lib\site-packages\django\core\management\commands\runserver.py",
>>> line 102, in run
>>> autoreload.run_with_reloader(self.inner_run, **options)
>>>   File
>>> "C:\Users\Chas\rp-portfolio\venv\lib\site-packages\django\utils\autoreload.py",
>>> line 587, in run_with_reloader
>>> start_django(reloader, main_func, *args, **kwargs)
>>>   File
>>> "C:\Users\Chas\rp-portfolio\venv\lib\site-packages\django\utils\autoreload.py",
>>> line 572, in start_django
>>> reloader.run(django_main_thread)
>>>   File
>>> "C:\Users\Chas\rp-portfolio\venv\lib\site-packages\django\utils\autoreload.py",
>>> line 290, in run
>>> self.run_loop()
>>>   File
>>> "C:\Users\Chas\rp-portfolio\venv\lib\site-packages\django\utils\autoreload.py",
>>> line 296, in run_loop
>>> next(ticker)
>>>   File
>>> "C:\Users\Chas\rp-portfolio\venv\lib\site-packages\django\utils\autoreload.py",
>>> line 336, in tick
>>> for filepath, 

Re: python manage.py runserver error

2020-06-18 Thread chaitanya orakala
Hi Thomas,
Please run the following commands to solve this problem, before running the
server.

python manage.py makemigrations
python manage.py migrate

and then command
python manage.py runserver

Hope this helps. Let me know if you have any questions

On Thu, Jun 18, 2020 at 6:15 PM Thomas Furtado 
wrote:

> Hi, I've seen you sent this last year and I'm having the same error
> message at my pycharm... Did you solve this?? could you help me with this
> please??
>
> Em sábado, 13 de julho de 2019 08:35:31 UTC-3, Jack Bergemann escreveu:
>>
>> (venv) C:\Users\Chas\rp-portfolio\personal_portfolio>python manage.py
>> runserver
>> Watching for file changes with StatReloader
>> Exception in thread django-main-thread:
>> Traceback (most recent call last):
>>   File "C:\Python37\lib\threading.py", line 926, in _bootstrap_inner
>> self.run()
>>   File "C:\Python37\lib\threading.py", line 870, in run
>> self._target(*self._args, **self._kwargs)
>>   File
>> "C:\Users\Chas\rp-portfolio\venv\lib\site-packages\django\utils\autoreload.py",
>> line 54, in wrapper
>> fn(*args, **kwargs)
>>   File
>> "C:\Users\Chas\rp-portfolio\venv\lib\site-packages\django\core\management\commands\runserver.py",
>> line 109, in inner_run
>> autoreload.raise_last_exception()
>>   File
>> "C:\Users\Chas\rp-portfolio\venv\lib\site-packages\django\utils\autoreload.py",
>> line 77, in raise_last_exception
>> raise _exception[1]
>>   File
>> "C:\Users\Chas\rp-portfolio\venv\lib\site-packages\django\core\management\__init__.py",
>> line 337, in execute
>> autoreload.check_errors(django.setup)()
>>   File
>> "C:\Users\Chas\rp-portfolio\venv\lib\site-packages\django\utils\autoreload.py",
>> line 54, in wrapper
>> fn(*args, **kwargs)
>>   File
>> "C:\Users\Chas\rp-portfolio\venv\lib\site-packages\django\__init__.py",
>> line 24, in setup
>> apps.populate(settings.INSTALLED_APPS)
>>   File
>> "C:\Users\Chas\rp-portfolio\venv\lib\site-packages\django\apps\registry.py",
>> line 91, in populate
>> app_config = AppConfig.create(entry)
>>   File
>> "C:\Users\Chas\rp-portfolio\venv\lib\site-packages\django\apps\config.py",
>> line 90, in create
>> module = import_module(entry)
>>   File "C:\Python37\lib\importlib\__init__.py", line 127, in import_module
>> return _bootstrap._gcd_import(name[level:], package, level)
>>   File "", line 1006, in _gcd_import
>>   File "", line 983, in _find_and_load
>>   File "", line 965, in
>> _find_and_load_unlocked
>> ModuleNotFoundError: No module named 'hello_world'
>>
>> Traceback (most recent call last):
>>   File "manage.py", line 21, in 
>> main()
>>   File "manage.py", line 17, in main
>> execute_from_command_line(sys.argv)
>>   File
>> "C:\Users\Chas\rp-portfolio\venv\lib\site-packages\django\core\management\__init__.py",
>> line 381, in execute_from_command_line
>> utility.execute()
>>   File
>> "C:\Users\Chas\rp-portfolio\venv\lib\site-packages\django\core\management\__init__.py",
>> line 375, in execute
>> self.fetch_command(subcommand).run_from_argv(self.argv)
>>   File
>> "C:\Users\Chas\rp-portfolio\venv\lib\site-packages\django\core\management\base.py",
>> line 323, in run_from_argv
>> self.execute(*args, **cmd_options)
>>   File
>> "C:\Users\Chas\rp-portfolio\venv\lib\site-packages\django\core\management\commands\runserver.py",
>> line 60, in execute
>> super().execute(*args, **options)
>>   File
>> "C:\Users\Chas\rp-portfolio\venv\lib\site-packages\django\core\management\base.py",
>> line 364, in execute
>> output = self.handle(*args, **options)
>>   File
>> "C:\Users\Chas\rp-portfolio\venv\lib\site-packages\django\core\management\commands\runserver.py",
>> line 95, in handle
>> self.run(**options)
>>   File
>> "C:\Users\Chas\rp-portfolio\venv\lib\site-packages\django\core\management\commands\runserver.py",
>> line 102, in run
>> autoreload.run_with_reloader(self.inner_run, **options)
>>   File
>> "C:\Users\Chas\rp-portfolio\venv\lib\site-packages\django\utils\autoreload.py",
>> line 587, in run_with_reloader
>> start_django(reloader, main_func, *args, **kwargs)
>>   File
>> "C:\Users\Chas\rp-portfolio\venv\lib\site-packages\django\utils\autoreload.py",
>> line 572, in start_django
>> reloader.run(django_main_thread)
>>   File
>> "C:\Users\Chas\rp-portfolio\venv\lib\site-packages\django\utils\autoreload.py",
>> line 290, in run
>> self.run_loop()
>>   File
>> "C:\Users\Chas\rp-portfolio\venv\lib\site-packages\django\utils\autoreload.py",
>> line 296, in run_loop
>> next(ticker)
>>   File
>> "C:\Users\Chas\rp-portfolio\venv\lib\site-packages\django\utils\autoreload.py",
>> line 336, in tick
>> for filepath, mtime in self.snapshot_files():
>>   File
>> "C:\Users\Chas\rp-portfolio\venv\lib\site-packages\django\utils\autoreload.py",
>> line 352, in snapshot_files
>> for file in self.watched_files():
>>   File
>> "C:\Users\Chas\rp-portfolio\venv\lib\site-packages\django\utils\autoreload.py",
>> line 251, 

Re: python manage.py runserver error

2020-06-18 Thread Thomas Furtado
Hi, I've seen you sent this last year and I'm having the same error message 
at my pycharm... Did you solve this?? could you help me with this please??

Em sábado, 13 de julho de 2019 08:35:31 UTC-3, Jack Bergemann escreveu:
>
> (venv) C:\Users\Chas\rp-portfolio\personal_portfolio>python manage.py 
> runserver
> Watching for file changes with StatReloader
> Exception in thread django-main-thread:
> Traceback (most recent call last):
>   File "C:\Python37\lib\threading.py", line 926, in _bootstrap_inner
> self.run()
>   File "C:\Python37\lib\threading.py", line 870, in run
> self._target(*self._args, **self._kwargs)
>   File 
> "C:\Users\Chas\rp-portfolio\venv\lib\site-packages\django\utils\autoreload.py",
>  
> line 54, in wrapper
> fn(*args, **kwargs)
>   File 
> "C:\Users\Chas\rp-portfolio\venv\lib\site-packages\django\core\management\commands\runserver.py",
>  
> line 109, in inner_run
> autoreload.raise_last_exception()
>   File 
> "C:\Users\Chas\rp-portfolio\venv\lib\site-packages\django\utils\autoreload.py",
>  
> line 77, in raise_last_exception
> raise _exception[1]
>   File 
> "C:\Users\Chas\rp-portfolio\venv\lib\site-packages\django\core\management\__init__.py",
>  
> line 337, in execute
> autoreload.check_errors(django.setup)()
>   File 
> "C:\Users\Chas\rp-portfolio\venv\lib\site-packages\django\utils\autoreload.py",
>  
> line 54, in wrapper
> fn(*args, **kwargs)
>   File 
> "C:\Users\Chas\rp-portfolio\venv\lib\site-packages\django\__init__.py", 
> line 24, in setup
> apps.populate(settings.INSTALLED_APPS)
>   File 
> "C:\Users\Chas\rp-portfolio\venv\lib\site-packages\django\apps\registry.py", 
> line 91, in populate
> app_config = AppConfig.create(entry)
>   File 
> "C:\Users\Chas\rp-portfolio\venv\lib\site-packages\django\apps\config.py", 
> line 90, in create
> module = import_module(entry)
>   File "C:\Python37\lib\importlib\__init__.py", line 127, in import_module
> return _bootstrap._gcd_import(name[level:], package, level)
>   File "", line 1006, in _gcd_import
>   File "", line 983, in _find_and_load
>   File "", line 965, in 
> _find_and_load_unlocked
> ModuleNotFoundError: No module named 'hello_world'
>
> Traceback (most recent call last):
>   File "manage.py", line 21, in 
> main()
>   File "manage.py", line 17, in main
> execute_from_command_line(sys.argv)
>   File 
> "C:\Users\Chas\rp-portfolio\venv\lib\site-packages\django\core\management\__init__.py",
>  
> line 381, in execute_from_command_line
> utility.execute()
>   File 
> "C:\Users\Chas\rp-portfolio\venv\lib\site-packages\django\core\management\__init__.py",
>  
> line 375, in execute
> self.fetch_command(subcommand).run_from_argv(self.argv)
>   File 
> "C:\Users\Chas\rp-portfolio\venv\lib\site-packages\django\core\management\base.py",
>  
> line 323, in run_from_argv
> self.execute(*args, **cmd_options)
>   File 
> "C:\Users\Chas\rp-portfolio\venv\lib\site-packages\django\core\management\commands\runserver.py",
>  
> line 60, in execute
> super().execute(*args, **options)
>   File 
> "C:\Users\Chas\rp-portfolio\venv\lib\site-packages\django\core\management\base.py",
>  
> line 364, in execute
> output = self.handle(*args, **options)
>   File 
> "C:\Users\Chas\rp-portfolio\venv\lib\site-packages\django\core\management\commands\runserver.py",
>  
> line 95, in handle
> self.run(**options)
>   File 
> "C:\Users\Chas\rp-portfolio\venv\lib\site-packages\django\core\management\commands\runserver.py",
>  
> line 102, in run
> autoreload.run_with_reloader(self.inner_run, **options)
>   File 
> "C:\Users\Chas\rp-portfolio\venv\lib\site-packages\django\utils\autoreload.py",
>  
> line 587, in run_with_reloader
> start_django(reloader, main_func, *args, **kwargs)
>   File 
> "C:\Users\Chas\rp-portfolio\venv\lib\site-packages\django\utils\autoreload.py",
>  
> line 572, in start_django
> reloader.run(django_main_thread)
>   File 
> "C:\Users\Chas\rp-portfolio\venv\lib\site-packages\django\utils\autoreload.py",
>  
> line 290, in run
> self.run_loop()
>   File 
> "C:\Users\Chas\rp-portfolio\venv\lib\site-packages\django\utils\autoreload.py",
>  
> line 296, in run_loop
> next(ticker)
>   File 
> "C:\Users\Chas\rp-portfolio\venv\lib\site-packages\django\utils\autoreload.py",
>  
> line 336, in tick
> for filepath, mtime in self.snapshot_files():
>   File 
> "C:\Users\Chas\rp-portfolio\venv\lib\site-packages\django\utils\autoreload.py",
>  
> line 352, in snapshot_files
> for file in self.watched_files():
>   File 
> "C:\Users\Chas\rp-portfolio\venv\lib\site-packages\django\utils\autoreload.py",
>  
> line 251, in watched_files
> yield from iter_all_python_module_files()
>   File 
> "C:\Users\Chas\rp-portfolio\venv\lib\site-packages\django\utils\autoreload.py",
>  
> line 103, in iter_all_python_module_files
> return iter_modules_and_files(modules, frozenset(_error_files))
>   File 
> 

Shouldn't there be a library already for how to render your JS Frontend code into HTML and then insert your Django templates with jinja2 very easily?

2020-06-18 Thread Andrew


Hi all! I'm no frontend person, but I do help triage issues in 
djangorestframework-simplejwt. It's probably one of the most used 
authentication library for DRF users and most of all frontend framework 
devs of Django (i.e. React, Angular, Vue).

I've been getting lots of comments about issue #157 
 not 
getting merged. I'm still not convinced that it should be merged at this 
point, but I'm wondering if there's a better way for these frontend 
framework JS devs to integrate with Django sessions.

Again, I'm no frontend JS person. In fact, I've never actually coded with 
React or any of these frameworks before (I just generally know enough how 
most integrate with Django). But looking into the techs themselves, 
shouldn't there be a way to render the HTML content on python manage.py 
runserver (or however way you're deploying with something like gunicorn), 
map out where you want to put your template tags (like you code with the JS 
tech and a library inserts where you want the tags or variables), and then 
voila... you can use the sessions middlewear?

If this hasn't been done, someone should make it happen... If enough 
attention comes by for a better idea, I'd love to help collaborate!

My GitHub page: https://github.com/Andrew-Chen-Wang

-- 
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/4e8d86c3-1f02-4572-b447-ed4639858248n%40googlegroups.com.


The syntax of the file name, directory name or volume label is incorrect: ''

2020-06-18 Thread Thomas Furtado
Microsoft Windows [versão 10.0.18362.900]
(c) 2019 Microsoft Corporation. Todos os direitos reservados.

(venv) C:\Users\User\PycharmProjects\curso-udemy-master>python manage.py 
runserver
Watching for file changes with StatReloader
Exception in thread django-main-thread:
Traceback (most recent call last):
  File "C:\Python38\lib\threading.py", line 932, in _bootstrap_inner
self.run()
  File "C:\Python38\lib\threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
  File 
"C:\Users\User\PycharmProjects\curso-udemy-master\venv\lib\site-packages\django\utils\autoreload.py",
 
l
ine 53, in wrapper
fn(*args, **kwargs)
  File 
"C:\Users\User\PycharmProjects\curso-udemy-master\venv\lib\site-packages\django\core\management\command
s\runserver.py", line 109, in inner_run
autoreload.raise_last_exception()
  File 
"C:\Users\User\PycharmProjects\curso-udemy-master\venv\lib\site-packages\django\utils\autoreload.py",
 
l
ine 76, in raise_last_exception
raise _exception[1]
  File 
"C:\Users\User\PycharmProjects\curso-udemy-master\venv\lib\site-packages\django\core\management\__init_
_.py", line 357, in execute
autoreload.check_errors(django.setup)()
  File 
"C:\Users\User\PycharmProjects\curso-udemy-master\venv\lib\site-packages\django\utils\autoreload.py",
 
l
ine 53, in wrapper
fn(*args, **kwargs)
  File 
"C:\Users\User\PycharmProjects\curso-udemy-master\venv\lib\site-packages\django\__init__.py",
 
line 24,
in setup
apps.populate(settings.INSTALLED_APPS)
  File 
"C:\Users\User\PycharmProjects\curso-udemy-master\venv\lib\site-packages\django\apps\registry.py",
 
line
 91, in populate
app_config = AppConfig.create(entry)
  File 
"C:\Users\User\PycharmProjects\curso-udemy-master\venv\lib\site-packages\django\apps\config.py",
 
line 9
0, in create
module = import_module(entry)
  File "C:\Python38\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
  File "", line 1014, in _gcd_import
  File "", line 991, in _find_and_load
  File "", line 973, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'bootstrapform'
Traceback (most recent call last):
  File "manage.py", line 21, in 
main()
  File "manage.py", line 17, in main
execute_from_command_line(sys.argv)
  File 
"C:\Users\User\PycharmProjects\curso-udemy-master\venv\lib\site-packages\django\core\management\__init_
_.py", line 401, in execute_from_command_line
utility.execute()
  File 
"C:\Users\User\PycharmProjects\curso-udemy-master\venv\lib\site-packages\django\core\management\__init_
_.py", line 395, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
  File 
"C:\Users\User\PycharmProjects\curso-udemy-master\venv\lib\site-packages\django\core\management\base.py
", line 328, in run_from_argv
self.execute(*args, **cmd_options)
  File 
"C:\Users\User\PycharmProjects\curso-udemy-master\venv\lib\site-packages\django\core\management\command
s\runserver.py", line 60, in execute
super().execute(*args, **options)
  File 
"C:\Users\User\PycharmProjects\curso-udemy-master\venv\lib\site-packages\django\core\management\base.py
", line 369, in execute
output = self.handle(*args, **options)
  File 
"C:\Users\User\PycharmProjects\curso-udemy-master\venv\lib\site-packages\django\core\management\command
s\runserver.py", line 95, in handle
self.run(**options)
  File 
"C:\Users\User\PycharmProjects\curso-udemy-master\venv\lib\site-packages\django\core\management\command
s\runserver.py", line 102, in run
autoreload.run_with_reloader(self.inner_run, **options)
  File 
"C:\Users\User\PycharmProjects\curso-udemy-master\venv\lib\site-packages\django\utils\autoreload.py",
 
l
ine 599, in run_with_reloader
start_django(reloader, main_func, *args, **kwargs)
  File 
"C:\Users\User\PycharmProjects\curso-udemy-master\venv\lib\site-packages\django\utils\autoreload.py",
 
l
ine 584, in start_django
reloader.run(django_main_thread)
  File 
"C:\Users\User\PycharmProjects\curso-udemy-master\venv\lib\site-packages\django\utils\autoreload.py",
 
l
ine 299, in run
self.run_loop()
  File 
"C:\Users\User\PycharmProjects\curso-udemy-master\venv\lib\site-packages\django\utils\autoreload.py",
 
l
ine 305, in run_loop
next(ticker)
  File 
"C:\Users\User\PycharmProjects\curso-udemy-master\venv\lib\site-packages\django\utils\autoreload.py",
 
l
ine 345, in tick
for filepath, mtime in self.snapshot_files():
  File 
"C:\Users\User\PycharmProjects\curso-udemy-master\venv\lib\site-packages\django\utils\autoreload.py",
 
l
ine 361, in snapshot_files
for file in self.watched_files():
  File 
"C:\Users\User\PycharmProjects\curso-udemy-master\venv\lib\site-packages\django\utils\autoreload.py",
 
l
ine 260, in watched_files
yield from iter_all_python_module_files()
  File 
"C:\Users\User\PycharmProjects\curso-udemy-master\venv\lib\site-packages\django\utils\autoreload.py",
 
l
ine 105, in 

Re: Regarding Django models.

2020-06-18 Thread DOT. py
Use SQL Alchemy ORM , Django ORM has foreign key policy , if u can solve it
using that it's on u ..

On Fri, Jun 19, 2020, 01:23 MANISH YADAV  wrote:

> hello community members,
> I am a student and interested in Django. can you please help me.
> I am designing a project in Django. For that, I have my database schema
> which consists of the composite primary key and composite foreign key. But
> Django does not support any type of composite key.
> I have tried out but unable to solve it. I am giving a sample of the
> database schema so you can understand better.
>
> DATABASE SCHEMA
>
> Department (*deptId*, dept_name, head_id, dept_exe_id)   > * deptId*
> is primary key
>
> AcademicYear (*deptId, year*)
>  ->  *deptId*s references from Department and *(deptId, year)*
> composite primary key
>
> Semester (*deptId, year, sem*)
> --> *deptId, year *is references from AcademicYear and *(deptId,
> year, sem)* composite primary key
>
> Division (*deptId, year, sem, div, batch*)
>  ---> *deptId, year, sem *is references from semester and *(deptId,
> year, sem, div, batch)* composite primary key.
>
>
> Regards,
>
> Manish Yadav
>
> --
> 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/8681de2d-977e-4817-be8d-2d1e865e93a6o%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/CABCeVgwV3ybXZ4DK6TirifTEDUzfO5h%3DJ%3D3U22PxJZO9AsST1A%40mail.gmail.com.


Migration problems when using intermediate (through) table on many-to-many relationship

2020-06-18 Thread 'Rodrigo Estevão' via Django users
I've been facing a migration problem when using a *through* table on 
many-to-many relationship.

When I create the migration using modles configured as follow ...

# src/apps/core/valuation/models.py

from django.utils import timezone
from django.db import models
from django.utils.translation import gettext_lazy as _


class Valuation(models.Model):
ref_year = models.PositiveIntegerField(
_('reference year'),
default=timezone.now().year
)
ref_month = models.PositiveSmallIntegerField(
_('reference month'),
default=timezone.now().month
)
remark = models.TextField(
_('notes'),
null=True,
blank=True,
)

class Meta:
db_table = 'core\".\"valuation'
verbose_name = _('Valuation')
verbose_name_plural = _('Valuations')


# src/apps/loader/datafile/models.py

from django.db import models
from django.utils.translation import gettext_lazy as _


class DataFile(models.Model):
path = models.FileField(_('path'), max_length=4096)
hash = models.CharField(_('file hash'), max_length=128)
remark = models.CharField(
_('remark'),
max_length=128,
null=True,
blank=True
)
uploaded_at = models.DateTimeField(
_('uploaded at'),
auto_now_add=True,
editable=False
)
uploaded_by = models.ForeignKey(
'account.Account',
db_column='uploaded_by',
verbose_name=_('uploaded by'),
related_name='+',
on_delete=models.PROTECT,
)

class Meta:
db_table = 'loader\".\"data_file'
verbose_name = 'data file'
verbose_name_plural = 'data files'


# src/apps/loader/dataload/models.py

from django.db import models
from django.utils.translation import gettext_lazy as _

from apps.loader.datafile.models import DataFile

from apps.core.valuation.models import Valuation

class DataLoad(models.Model):
valuation = models.ForeignKey(
to=Valuation,
verbose_name=_('valuation'),
related_name='dataloads',
on_delete=models.PROTECT
)
datafile = models.ManyToManyField(
to=DataFile,
related_name='dataload',
through='dataload.DataLoadFile',
through_fields=('dataload', 'datafile',)
)

class Meta:
db_table = 'loader\".\"data_load'
verbose_name = 'data_load'
verbose_name_plural = 'data_load'


class DataLoadFile(models.Model):
dataload = models.ForeignKey(
to=DataLoad,
verbose_name=_('data load'),
related_name='datafiles',
on_delete=models.PROTECT
)
datafile = models.ForeignKey(
to=DataFile,
verbose_name=_('data file'),
related_name='+',
on_delete=models.PROTECT
)

class Meta:
db_table = 'loader\".\"data_load_files'
verbose_name = 'data load file'
verbose_name_plural = 'data load files'

... it creates the following migration file

# Generated by Django 3.0.7 on 2020-06-18 15:58

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

initial = True

dependencies = [
('valuation', '0001_initial'),
('datafile', '0001_initial'),
]

operations = [
migrations.CreateModel(
name='DataLoad',
fields=[
('id', models.AutoField(auto_created=True, 
primary_key=True, serialize=False, verbose_name='ID')),
],
options={
'verbose_name': 'data_load',
'verbose_name_plural': 'data_load',
'db_table': 'loader"."data_load',
},
),
migrations.CreateModel(
name='DataLoadFile',
fields=[
('id', models.AutoField(auto_created=True, 
primary_key=True, serialize=False, verbose_name='ID')),
('datafile', 
models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, 
related_name='+', to='datafile.DataFile', verbose_name='data file')),
('dataload', 
models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, 
related_name='datafiles', to='dataload.DataLoad', verbose_name='data 
load')),
],
options={
'verbose_name': 'data load file',
'verbose_name_plural': 'data load files',
'db_table': 'loader"."data_load_files',
},
),
migrations.AddField(
model_name='dataload',
name='datafile',
field=models.ManyToManyField(related_name='dataload', 
through='dataload.DataLoadFile', to='datafile.DataFile'),
),
migrations.AddField(
model_name='dataload',
name='valuation',

field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, 
related_name='dataload', to='valuation.Valuation', 
verbose_name='valuation'),
),
]

when I run the migrate 

Regarding Django models.

2020-06-18 Thread MANISH YADAV
hello community members,
I am a student and interested in Django. can you please help me.
I am designing a project in Django. For that, I have my database schema 
which consists of the composite primary key and composite foreign key. But 
Django does not support any type of composite key.
I have tried out but unable to solve it. I am giving a sample of the 
database schema so you can understand better.

DATABASE SCHEMA

Department (*deptId*, dept_name, head_id, dept_exe_id)   > * deptId* is 
primary key

AcademicYear (*deptId, year*)
 ->  *deptId*s references from Department and *(deptId, year)* 
composite primary key

Semester (*deptId, year, sem*)
--> *deptId, year *is references from AcademicYear and *(deptId, year, 
sem)* composite primary key

Division (*deptId, year, sem, div, batch*) ---> 
*deptId, 
year, sem *is references from semester and *(deptId, year, sem, div, batch)* 
composite 
primary key.


Regards,

Manish Yadav

-- 
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/8681de2d-977e-4817-be8d-2d1e865e93a6o%40googlegroups.com.


Re: Training Resources for using JavaScript with Django

2020-06-18 Thread Julio Cojom
in your template, open a js block

{% block javascript %}

not possible to delete if calling self.errors in a Form in InlineFormSet

2020-06-18 Thread Carles Pina i Estany


Hi, 

Yesterday and today I implemented something and I had a surprise. I'm
explaining here with questions at the end but also in case that I might
save some time to someone working with forms (if someone is going to try
the same approach that I did and it doesn't work).

What I want to do: the user fills in a form (with Django forms using
django-crispy-form). If there is a validation error in a specific field
I need to show a new Field (a checkbox) in order to get confirmation
before the final submission.

Very important: this form is in an InlineFormSet (via inlineformset_factory)

My first reaction: in MyForm.__init__(self) I did something along the lines 
(pseudocode) of:
"""
if 'amount' in self.errors:
self.fields['allow_error'] = forms.BooleanField()
divs.append('allow_error')
"""

This worked... but it has one problem that some people might have
already spotted! The deletion was not working. kwargs['data'] contained
the 'DELETE' key correctly (with the prefix, etc.). But it was not
available in self.clean_fields when it was trying to be used by Django
in order to decide if the form was going to be deleted.

After some investigation:
self.errors is a property and calls BaseForm.errors which does:
"""
if self._errors is None:
self.full_clean()
return self._errors
"""
(https://github.com/django/django/blob/master/django/forms/forms.py#L169)


My form is created in BaseFormSet._construct_form method. This does (at the 
very end):
"""
form = self.form(**defaults)
self.add_fields(form, i)
"""
(https://github.com/django/django/blob/master/django/forms/formsets.py#L175)

The "add_fields" method adds the "DELETE" in self.fields:
(https://github.com/django/django/blob/master/django/forms/formsets.py#L390)

It needs to be in self.fields when self.clean_data is populated or it is 
ignored.

Since in the MyForm.__init__ method I called self.errors and the result
is cached/optimized: 'DELETE' is never added in self.clean_fields (it's
not in self.fields when I called self.errors that triggers the
validation, full_clean, etc; and when it's added in self.fields it's too
late) and then the form never triggers the deletion.

I have some questions:
a) Does it say somewhere in the documents to avoid calling self.errors
from the __init__? I might have missed it. I had some similar problem
using the debugger (via self.errors or self.is_valid perhaps, etc.).

b) I currently now read data from self.data and get the number that I
need and I apply the same logic as the "clean" to decide if I need to
show the checkbox or not. I wonder if there is some other way to
approach this issue that is a bit cleaner (avoiding self.data, self
contained in the form logic, etc.). Do you use any other approach?

c) Actually, should Django tried to prevent my error somehow? :-)

Thanks very much!

-- 
Carles Pina i Estany

-- 
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/20200618141534.GA30379%40pina.cat.


Re: Why Should I use DRF over Django

2020-06-18 Thread maninder singh Kumar
DRF causes serialization of data and converts it to JSON, making it an
efficient way to communicate with your frontend.  An API allows you to
build a common core that can be used on multiple platforms like websites,
mobile applications, plugins, and so on.
You can build an API with pure Django too.

regards .. .willy

Maninder Kumar
about.me/maninder.s.kumar



On Thu, Jun 18, 2020 at 6:12 PM Rajprabhu Arulnathan <
arulrajprabhu...@gmail.com> wrote:

> Apart from Rest API & serializer why I should use DRF over Django Because
> We could write what we want in Django & I want to know the advantage of
> using DRF over Django
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/afae9004-3edc-4083-997a-ddfcab647d98o%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/CABOHK3QehsudxQCtxzoFKtXbTt-6Ma80oZPBmxwA28xA%2BmAz_w%40mail.gmail.com.


Re: Why Should I use DRF over Django

2020-06-18 Thread Andréas Kühne
Like Shishir says it's not using DRF instead of django, It's DRF on top of
django.

The main reason for using DRF instead of using django by itself is that you
get an enormous consistency. Serialization is really simple, you get
validation on all fields with valid JSON results. You get all of the status
codes automatically correctly.
All of this can be achieved with Django by itself - but you will need to
write a lot of boilerplate code before you get the same functionality that
you get from DRF.

But it's only use is to create a REST API - if you want to have more than
that, then you write regular django views.

Regards,

Andréas


Den tors 18 juni 2020 kl 14:54 skrev Shishir Jha :

> Its not that use drf "over" django. Its like you use drf "with" django.
> Whenever you want to create rest api, django rest framework is the library
> created to do that more usually. Django on the other end is a framework to
> create web application. There is never the case when you are using drf and
> not django. However you can use django without drf even to create rest
> apis. If there was something you would choose "over" django, it would be
> flask. That is a reasonable comparision. Hope this helps.
>
> Thanks and regards,
> Shishir Jha
>
> On Thu, 18 Jun 2020, 6:12 pm Rajprabhu Arulnathan, <
> arulrajprabhu...@gmail.com> wrote:
>
>> Apart from Rest API & serializer why I should use DRF over Django Because
>> We could write what we want in Django & I want to know the advantage of
>> using DRF over Django
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/afae9004-3edc-4083-997a-ddfcab647d98o%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%2BC7wFRHyaovqn2nM03TK9LjvXT_XDOJNPiY_N%3Dfnh_meuKBvw%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/CAK4qSCca%2BAYACPEDDrWpi9ZipJK%2Buc10L_g8N%2Ba%3DyiBLR8T2Jw%40mail.gmail.com.


Training Resources for using JavaScript with Django

2020-06-18 Thread meva...@gmail.com
Hello Community Members,

Can you please point me towards resources for using Javascript /Jquery 
/AJAX with Django,

Want to create single page application which can send /receive data without 
reloading to different pages and to be able to show progress of an ongoing 
operation through percentage /progress bar.

Regards

Vaibhav  

-- 
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/f69e79ca-3738-4e5c-805b-f3b3eb485064n%40googlegroups.com.


Re: Why Should I use DRF over Django

2020-06-18 Thread Shishir Jha
Its not that use drf "over" django. Its like you use drf "with" django.
Whenever you want to create rest api, django rest framework is the library
created to do that more usually. Django on the other end is a framework to
create web application. There is never the case when you are using drf and
not django. However you can use django without drf even to create rest
apis. If there was something you would choose "over" django, it would be
flask. That is a reasonable comparision. Hope this helps.

Thanks and regards,
Shishir Jha

On Thu, 18 Jun 2020, 6:12 pm Rajprabhu Arulnathan, <
arulrajprabhu...@gmail.com> wrote:

> Apart from Rest API & serializer why I should use DRF over Django Because
> We could write what we want in Django & I want to know the advantage of
> using DRF over Django
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/afae9004-3edc-4083-997a-ddfcab647d98o%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%2BC7wFRHyaovqn2nM03TK9LjvXT_XDOJNPiY_N%3Dfnh_meuKBvw%40mail.gmail.com.


After converting Static to Django form the Menus, not working on mobile device mode

2020-06-18 Thread Hadisur Rahman
The site is perfectly working on itself by default but when I convert it in 
Django format the only menus. not working when I browse the site in mobile 
device mode. 

here is the pic when it is in default mode [image: Screenshot-33.png]

After converting in Django format the above pic right side lines not 
working. see below pic.

[image: Screenshot-34.png]

here is the static code link https://colorlib.com/wp/template/travello/
and here is the Django format code link 
https://github.com/hudacse6/Tourist_Site




-- 
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/561255f9-5738-4b83-bbb0-259b842469ccn%40googlegroups.com.


Menu does not work when i try to browse the site in mobile device mode after covert the site from STATIC TO Django format.

2020-06-18 Thread Hadisur Rahman
Here is the full project Github link (
https://github.com/hudacse6/Tourist_Site)

All of the tasks work well but only the menu means when I try to browse the 
site the manus does not show. 



[image: Screenshot-33.png]



[image: Screenshot-34.png]
The menu,s are shown perfectly when I code of that site are not in Django 
format but in Django format it won,t work. 

You found the Django format code here 
https://github.com/hudacse6/Tourist_Site

and without the Django format code here 
https://colorlib.com/wp/template/travello/


Though the codes are so long so I don,t put them here, please don,t mind 
thanks. 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/2ff2debf-eb83-44b3-9e1c-5789d45b2e29o%40googlegroups.com.


Why Should I use DRF over Django

2020-06-18 Thread Rajprabhu Arulnathan
Apart from Rest API & serializer why I should use DRF over Django Because 
We could write what we want in Django & I want to know the advantage of 
using DRF over Django

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/afae9004-3edc-4083-997a-ddfcab647d98o%40googlegroups.com.


Re: Employee leave module in django?

2020-06-18 Thread Puneet Makhija
ok
Meera
So whats the problem
Just create it
If you have any query just ask
To me

On Thu, Jun 18, 2020, 4:54 PM meera gangani 
wrote:

> Hello ,
>
> I want to implement an employee leave module in django??
> "Am New" in django
> Please help me?
>
> Thanks in advance
> -Meera Gangani
>
> --
> 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/CANaPPPKP88ZscoDCxrwJZU0UcH30pzxqUQqFLyk%2B4g8Yfj%2BBXA%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/CAHqz0_YS5XWDVc%2BrSUtLC7j6ebATaYuncmXwJsVUNSJ0TvXEiA%40mail.gmail.com.


Employee leave module in django?

2020-06-18 Thread meera gangani
Hello ,

I want to implement an employee leave module in django??
"Am New" in django
Please help me?

Thanks in advance
-Meera Gangani

-- 
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/CANaPPPKP88ZscoDCxrwJZU0UcH30pzxqUQqFLyk%2B4g8Yfj%2BBXA%40mail.gmail.com.


Re: someone to help in this please

2020-06-18 Thread Peter Kirieny
thanks again  Richard, this helped a lot

On Wed, 17 Jun 2020 at 16:07, Richard Balwane 
wrote:

> -> Do a .whl installation - In the environment!
> Download  "GDAL-3.0.4-cp37-cp37m-win_amd64.whl", if using Python 3.7 on
> Windows 64-bit
> Say...
> Command(env activated, path to the file):
> python.exe -m pip install
> "C:\\Users\\Mossad\\Downloads\\GDAL-3.0.4-cp37-cp37m-win_amd64.whl"
>
>  ->  Include 'gdal300'  in
> env\Lib\site-packages\django\contrib\gis\gdal\libgdal.py file for this
> GDAL-3.0.4 .whl installation
> (There is a list of these .dlls for nt users)
>   Set:
> 1. GDAL_LIBRARY_PATH in settings.py:
>   import os
>   GDAL_LIBRARY_PATH = os.path.join(
> PROJECT_DIR, r"env\\Lib\\site-packages\\osgeo\\gdal300.dll"
> )
>
> 2.  GDAL_DRIVER_PATH = os.path.join(
> PROJECT_DIR,
> r"env\\Lib\site-packages\\osgeo\\gdalplugins\\ogr_FileGDB.dll"
> )
>
> And, you are good to go.
>
> Praise be to The Almighty God.
>
>
>
> *Richard Dick Balwane*
>
> *Mobiles:+256 755 442248, *
>
> *+256 781 493558.*
> *Twiter:   @RBalwane*
> *WhatsApp:   **+256 755 442248*
>
>
> *Balwane Holding Inc.*
>
>
>
>
> On Tue, 16 Jun 2020 at 18:11, Peter Kirieny 
> wrote:
>
>> am using Geodjango with postgresql db and i get this error while trying
>> to run the server;
>> raise ImproperlyConfigured(
>> django.core.exceptions.ImproperlyConfigured: Could not find the GDAL
>> library (tried "gdal204", "gdal203", "gdal202", "gdal201", "gdal20"). Is
>> GDAL installed? If it i
>> s, try setting GDAL_LIBRARY_PATH in your settings.
>>
>> the libraries are installed just don't know  how to set the paths
>> 'am new in programming'
>>
>> --
>> 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/CAL8t8eof1jY3wwUa9Fj_owAK8WEoVpZSFnOCFrQsmD_w3Yy%3Dfg%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/CAAjYwK9JRdX%3DyUtrkeV6jxJsDtHKS-NfP30buww2NbkHjPwLjQ%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/CAL8t8erQZ0bzt%2BHN%2BVpXX-UBnptGNujz%2Bts9T3pVnth-8ehH4Q%40mail.gmail.com.


Re: FileNotFoundError at /urlpath, after hosting Django project to Heroku

2020-06-18 Thread Kasper Laudrup

Hej Lejaha

On 18/06/2020 11.42, lejaha...@gmail.com wrote:
Created a an application that generates pdf-files from latex templates 
saved on the project, using the subprocess('pdflatex nameofTemplate' ) 
method.
The application works fine, locally. But does not work on the server and 
returns "[Errno 2] No such file or directory: 'pdflatex mytexfile.tex': 
'pdflatex mytexfile.tex'", everytime I call the method to generate the 
latex files.


Please kindly advise on how I can make the pdflatex and latex files 
accessible to my subprocess.call() method.




By installing pdflatex on the server and ensuring its in the path of the 
user running the application or giving the full path to the pdflatex 
executable in the call to subprocess.


How to install software on the server depends on the OS of the server 
and how its maintained and you'll most likely have better luck getting 
answers if you ask whoever is maintaining the server.


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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/3b5e415d-4893-4abc-d892-bacd99c9fba2%40stacktrace.dk.


FileNotFoundError at /urlpath, after hosting Django project to Heroku

2020-06-18 Thread lejaha...@gmail.com
Created a an application that generates pdf-files from latex templates 
saved on the project, using the subprocess('pdflatex nameofTemplate' ) 
method.
The application works fine, locally. But does not work on the server and 
returns "[Errno 2] No such file or directory: 'pdflatex mytexfile.tex': 
'pdflatex mytexfile.tex'", everytime I call the method to generate the 
latex files. 

Please kindly advise on how I can make the pdflatex and latex files 
accessible to my subprocess.call() method.

-- 
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/4274a277-06d8-4b82-b354-9431b9a5d303n%40googlegroups.com.


RE: why in views we use def(functions) and model we use class, why not we use def(fuction) in models and class in views

2020-06-18 Thread Vishesh Mangla
If your wish whatever you want to use, all you have to use is the “request” variable that Django gives you. Btw see “generic views”.  Sent from Mail for Windows 10 From: yashwanth balanaguSent: 18 June 2020 12:23To: Django usersSubject: why in views we use def(functions) and model we use class, why not we use def(fuction) in models and class in views why in views we use def(functions) and model we use class, why not we use def(fuction) in models and class in views-- 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/4e4b1e4b-1a59-43d9-8835-4992e986f943o%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/42275F4A-510E-4C3B-B5CA-14C4D4156228%40hxcore.ol.


Django Aggregate(annotate, count) is working differently.

2020-06-18 Thread Himanshu Pharawal
models.py
class Intrest(models.Model):
 user = models.ForeignKey(User, related_name='intrests', on_delete=models.
CASCADE)
 keyword = models.CharField(max_length=100)

class SponsoredBook(models.Model):
 title = models.CharField(max_length=20)

class Keyword(models.Model):
 sponsored_book = models.ForeignKey(SponsoredBook, related_name='keywords', 
on_delete=models.CASCADE)
 title = models.CharField(max_length=50, unique=True)


views.py
def get(self, request):
 user = User.objects.filter(id=3).prefetch_related('intrests')
 sub = Subquery(user[0].intrests.annotate(key=Lower('keyword')).values('key'
))
 sponsored_books = models.SponsoredBook.objects.annotate(tit=Lower(
'keywords__title')).filter(tit__in=sub).annotate(points=Count('id')).
order_by('points')[:6]
 all_sponsored_books = models.SponsoredBook.objects.all()[:6]
 for sponsored_book in sponsored_books:
 print(sponsored_book.__dict__)
 print()

Case explained
There are two interests stored in db for user(id=3) names as

   1. python
   2. programming

And three sponsored books stored in db with their correspond interests 
named as 

   1. Test1 - Interests(ptyhon, programming)
   2. Test2 - Interests(python, A)
   3. Test3 - Interests(B, C)

Problem
For the above database, models and views it shows Test1 book two times and 
Test2 book one time but expectation was to having Test1 one time and Test2 
also one time only the order should be affect but here query set is able to 
group by books with there id and give them points on the basis of 
there repetition repetition.

*Let me know if you need for more information on the same.*

-- 
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/bc724ec0-99ad-4180-919e-f036a051b8a6o%40googlegroups.com.


why in views we use def(functions) and model we use class, why not we use def(fuction) in models and class in views

2020-06-18 Thread yashwanth balanagu
why in views we use def(functions) and model we use class, why not we use 
def(fuction) in models and class in views

-- 
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/4e4b1e4b-1a59-43d9-8835-4992e986f943o%40googlegroups.com.