Re: Combining django apps

2022-10-19 Thread Jun Tanaka


Thank you for your answer. I can not see below "Let me show you an 
example". Probably, some of last sentences got cutoff. And I want to see an 
example. 

2022年10月19日水曜日 13:49:41 UTC+9 eupaulo...@gmail.com:

> First of all, you need to add all your apps in INSTALED APPS into the 
> project > setings.py. I have 3 apps, core, members, and home. 
>
> INSTALLED_APPS = [
>   (..)
>   'core',
>   'members',
>   'home',
>  ]
>
> Secondly, you need to create a route to each app in your project > urls.py
>
> urlpatterns = [
>   path(' ', include('home.urls')),
>   path('udemy/', include('core.urls')),
>   path('w3schools/', include('members.urls')),
>   path('c-panel/', admin.site.urls),
>  ]
>
>
> After that, each app will be self-independent I  mean with your own 
> models, templates, statics, etc. 
>
> * Of course, you will need to run state collect and migrations commands on 
> the terminal 
> ** make sure -->  ROOT_URLCONF = 'YOURPROJECT.urls' <-- project > 
> setings.py
>
> Let me show you an example 
>
>
>
>
> Em terça-feira, 18 de outubro de 2022 às 07:01:15 UTC-3, tna...@gmail.com 
> escreveu:
>
>>
>> mysite/
>>
>> manage.py
>>
>> config/
>>
>> __init__.py
>>
>> settings.py
>>
>> urls.py
>>
>> wsgi.py
>>
>> app1/
>>
>> app1a/
>>
>>   app1b/
>>
>> app2/
>>
>> app3/
>>
>> I would like to know how to combine  apps together just like above.  Each 
>> app itself  works fine when runserver. I followed some websites talking 
>> about this but I always get some error like ‘app1a' is not a registered 
>> namespace. I'm not very familiar with combining apps. I hope someone can 
>> tell me the simplest way to do that.
>>
>> 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/a4f31d27-4b2d-4efb-96c8-41b67817c0a7n%40googlegroups.com.


Re: Combining django apps

2022-10-19 Thread Jun Tanaka


Also, some website says something like

INSTALLED_APPS = [ 'todo.apps.TodoConfig', 

 

You say,

INSTALLED_APPS = [ 'todo', 
I am confused. Which is proper? And the difference?  


2022年10月19日水曜日 13:49:41 UTC+9 eupaulo...@gmail.com:

> First of all, you need to add all your apps in INSTALED APPS into the 
> project > setings.py. I have 3 apps, core, members, and home. 
>
> INSTALLED_APPS = [
>   (..)
>   'core',
>   'members',
>   'home',
>  ]
>
> Secondly, you need to create a route to each app in your project > urls.py
>
> urlpatterns = [
>   path(' ', include('home.urls')),
>   path('udemy/', include('core.urls')),
>   path('w3schools/', include('members.urls')),
>   path('c-panel/', admin.site.urls),
>  ]
>
>
> After that, each app will be self-independent I  mean with your own 
> models, templates, statics, etc. 
>
> * Of course, you will need to run state collect and migrations commands on 
> the terminal 
> ** make sure -->  ROOT_URLCONF = 'YOURPROJECT.urls' <-- project > 
> setings.py
>
> Let me show you an example 
>
>
>
>
> Em terça-feira, 18 de outubro de 2022 às 07:01:15 UTC-3, tna...@gmail.com 
> escreveu:
>
>>
>> mysite/
>>
>> manage.py
>>
>> config/
>>
>> __init__.py
>>
>> settings.py
>>
>> urls.py
>>
>> wsgi.py
>>
>> app1/
>>
>> app1a/
>>
>>   app1b/
>>
>> app2/
>>
>> app3/
>>
>> I would like to know how to combine  apps together just like above.  Each 
>> app itself  works fine when runserver. I followed some websites talking 
>> about this but I always get some error like ‘app1a' is not a registered 
>> namespace. I'm not very familiar with combining apps. I hope someone can 
>> tell me the simplest way to do that.
>>
>> 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/c3761fa9-e7c8-484b-9d57-a2ae6ee4fcf7n%40googlegroups.com.


Re: PLEASE HELP ME KNOW HOW TO ARRANGE INSTALLED APPS.

2022-10-19 Thread johnpaul mulongo
You need to give the django apps you created unique names (try to see them
as separate entities), in your case this would be 'core' and 'store', then
you need to add them to the INSTALED_APPS list like so in the settings file:
[...,
'core.apps.CoreConfig',
'store.apps.StoreConfig',
]



On Wed, Oct 19, 2022 at 8:29 AM regan opere  wrote:

> Many, thanks for the reply. However, I have two apps in the directory
> called Apps..
> so when I name the apps in the settings using
> tiles.apps.TilesConfig' it still does'nt work
>
>   naming them like this:
>
>  'apps.core.apps',
>
> 'apps.store.apps',
> also still giver the error: django.core.exceptions.ImproperlyConfigured:
> Application labels aren't unique, duplicates: apps
>
> however, when I delete one of the apps from the settings, the server runs
> without an error
> On Wednesday, October 19, 2022 at 2:17:55 AM UTC+3 Codex wrote:
>
>> Lets take App Directory name tiles.
>> So inthe installed app list it will be
>>
>> 'tiles.apps.TilesConfig',
>> Or put simply
>> 'tiles',
>> Hope it helps .
>>
>>
>> On Tue, Oct 18, 2022, 06:16 regan opere  wrote:
>>
>>> Hello, I am new to django and I am still learning.
>>> I have created two apps core and store and I have registered them in the
>>> settings file of my root directory.
>>>  This is the error I get:
>>> django.core.exceptions.ImproperlyConfigured: Application labels aren't
>>> unique, duplicates: apps
>>>
>>> my settings look like this
>>> INSTALLED_APPS = [
>>> 'django.contrib.admin',
>>> 'django.contrib.auth',
>>> 'django.contrib.contenttypes',
>>> 'django.contrib.sessions',
>>> 'django.contrib.messages',
>>> 'django.contrib.staticfiles',
>>>
>>> 'apps.core.apps',
>>>
>>> 'apps.store.apps',
>>>
>>>
>>> and their individual apps.py look like this:
>>>
>>> class CoreConfig(AppConfig):
>>> default_auto_field = 'django.db.models.BigAutoField'
>>> name = 'core'
>>>
>>>
>>> and
>>>
>>> class StoreConfig(AppConfig):
>>> default_auto_field = 'django.db.models.BigAutoField'
>>> name = 'store'
>>>
>>>
>>>
>>> without the second app 'store" the server runs just fine
>>>
>>> --
>>>
>> 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/fab8949f-1012-4fad-8259-b63c67195f69n%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/65db3780-57ec-41ec-afaf-abe16ae85e69n%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/CAOj59W0fjZbkGpGvrSyFiCwAAJrt6%3D_6d1zb1G759J9igyu4aA%40mail.gmail.com.


Warning about filtering queryset in ClassBasedViews

2022-10-19 Thread DaniBoy
Following the example in 
https://docs.djangoproject.com/en/4.1/topics/class-based-views/generic-display/#viewing-subsets-of-objects
 I 
try the following

class BookListView(ListView):
model = Book
queryset = Book.objects.filter(publication_date__lte=timezone.now())

I found that this code snippet to retrieve only books that has the 
publication date before today (assuming that could be books with 
publication date in the future) not work as I would expected. 

After some digging, I found that timezone.now() it's cached when server 
starts up (in a production environment), so this query filter by the date 
the server was started. So the solution is to use a dynamic filtering. 

Could be a good idea to include some warning about this in the 
documentation? I have tried to find some information but I did not find 
anything.

-- 
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/e1604f4f-a00e-4302-9cfe-ab3c882b5645n%40googlegroups.com.


Django devs, reverse job board

2022-10-19 Thread tomaž Ovsenjak
Greetings! 

I present to you a new platform for you to find django gigs/job 
https://djangodevs.com

You can: 
1. create developer profile
2. show off your work 
3. get contacted by businesses 

Join now at https://djangodevs.com

Br 

-- 
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/d276df84-097f-4384-99d4-4d8f672f63f5n%40googlegroups.com.


How to change the prefix of a formeset's empty_form?

2022-10-19 Thread Hércules Lopes
I'm working on a page with nested formsets, it works fine with static 
inline formsets, but when I try to create forms dynamically I get a 
problem. The prefix generated for a nested formset is its parent's one + 
its own, like: student-0-address-0.

But for empty_form both are just '__prefix__, like': 
student-__prefix__-address-__prefix__.

Eventually when the user adds a new form my javascript will change every 
'__prefix__' in the new cloned empty_form element to the amount of 
class="student-form" there is, so it ends up like this:

# first nested formset generated:
Street:


# second nested formset generated:
Street:


The second -1- here should be zero, but my regex changes every 
'__prefix__'. I suppose I could change the regex to only target each 
individually, but then I'd have two problems, so how can i change the 
default empty_form prefix?

-- 
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/97fa5ebb-5cb6-4eb3-b583-c23d38518db9n%40googlegroups.com.


Re: Job Request As A Software Developer

2022-10-19 Thread tomaž Ovsenjak
Greetings! 

I present to you a new platform for you to find django gigs/job 
https://djangodevs.com

You can: 
1. create developer profile
2. show off your work 
3. get contacted by businesses 

Join now at https://djangodevs.com

Br 

On Friday, September 2, 2022 at 4:50:48 AM UTC+2 go...@gobidasu.com wrote:

> Hi Onjomba,
>
> I noticed you have a strong, in-demand skill set. We'd love to have you 
> join our talent network of software developers, data scientists, and 
> designers, called LD Talent - ldtalentwork.com. By joining LD Talent, 
> you’ll have the following benefits:
>
> - Explore remote opportunities: both contract and full-time, with US-based 
> companies
> - Set your own hourly rate and work on your own schedule
> - Gain financial incentives upon posting new learnings on our Github/Blog 
> - blog.ldtalentwork.com
> - Get funded to build your own ideas through the LD Ventures wing
>
> Become a part of the network by sending your resume to 
> in...@ldtalentwork.com and learn more about how you can advance your 
> career. If you have any questions, here’s our bookable calendar - 
> ldtalentwork.com/contact/ . Thank you.
>
> Regards
> Gobi
>
> On Thu, Sep 1, 2022, 13:24 Onjomba Felix  wrote:
>
>> Hae,
>> I am humbly requesting if you have any job or referral to a job just tell 
>> me bellow is my Cover Letter and CV.
>> [image: WhatsApp Image 2022-08-30 at 21.03.40.jpg]
>>
>> -- 
>>
> 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/CAJU16zc2C9BGiQaAEnrbUDLdXgL%2B4zFs%3DpJzfLJjKrsiD3BNDQ%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/cd6421ee-4cae-43c2-bde9-0bded748655dn%40googlegroups.com.