Building a modular app?

35 views
Skip to first unread message

Simon Connah

unread,
Apr 2, 2023, 10:27:01 AM4/2/23
to django...@googlegroups.com
Hi,

I want to make a blogging platform and have a question about organising the project.

With my blog, I'll have the blog in one Django app and then have something like a forum in another app, along with additional functions in other apps. Also, I'd like to have a single-user system that uses AbstractUser (or AbstractBaseUser).

So how do all apps require my AbstractUser class for authentication, and then the other apps be added or removed based on what is needed for each site? I want to split auth from the rest project.

Thanks!
signature.asc

Sebastian Jung

unread,
Apr 2, 2023, 3:31:40 PM4/2/23
to django...@googlegroups.com
Hello,

I would use database replication where tables are sync between 2 databases...

Regards

--
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/Y-FsxPZKXSIkwB9-Hj599nnwPVu5XWMbDlfv0HEnIu9cLNeRU5b-1egUTZv8vUpHVLc4uq6oP8pVEXlxW9PqVDQQMud9BJBdBn6V6EI0hEM%3D%40protonmail.com.

Ryan Nowakowski

unread,
Apr 3, 2023, 9:54:08 AM4/3/23
to django...@googlegroups.com
Create an app with 2 views: login and logout:

https://docs.djangoproject.com/en/4.1/topics/auth/default/#how-to-log-a-user-in

That's your auth app. You can override your user model there also.

Then in your settings file set AUTH_USER_MODEL:

https://docs.djangoproject.com/en/4.1/topics/auth/customizing/#substituting-a-custom-user-model

Finally in your other apps, refer to that setting when foreign keying to user:

https://docs.djangoproject.com/en/4.1/topics/auth/customizing/#reusable-apps-and-auth-user-model

Ryan Nowakowski

unread,
Apr 3, 2023, 9:55:09 AM4/3/23
to django...@googlegroups.com
Start a new thread instead of hijacking this one?
Reply all
Reply to author
Forward
0 new messages