Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add view to upload datapackages #1

Open
wants to merge 2 commits into
base: production
Choose a base branch
from

Conversation

Bachibouzouk
Copy link
Contributor

Summary of the discussion

Added views and html templates to vizualize the current datapackages, add a new one from a zip file (at the moment only from a form), or delete one

I would like to let this view be accessed only by someone logged in as admin to control deletion or addition of scenarios

Type of change (CHANGELOG.md)

Added

  • url to view/add/delete scenario datapackages

@Bachibouzouk Bachibouzouk requested a review from henhuy November 7, 2024 15:55
@Bachibouzouk Bachibouzouk force-pushed the feature/zip-file-upload branch from 2c8395c to 7b2d91f Compare November 7, 2024 15:58

urlpatterns = [
path("admin/add_datapackage", add_datapackage, name="add_datapackage"),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I though this would force the admin login, but it doesn't, do you have an idea how to enforce this without creating user database @henhuy ?

Copy link

@henhuy henhuy Nov 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you have to create a custom AdminSite in order to add a custom view...
See https://docs.djangoproject.com/en/5.1/ref/contrib/admin/#adding-views-to-admin-sites
Never did this before.
Nevertheless, I think even for a admin user you will not get around migrating a user table, as createsuperuser creates a user in DB with admin=True as far as I know...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants