How do I dynamically create new pages in a Django wiki?
I am creating a wiki in Django where users should be able to register, login, create pages and other users who also login should be able to see all created 开发者_Python百科pages and then either create new pages or edit existing ones.
I have already created registration and login pages and I am fine with creating and editing content on pages. My question is - do any of you (who know Django) know how I can implement the create new pages into my site? I think it will be in a "form" form where you then specify the URL, title, and content of the new page, but how do you actually create the new pages then and be able to view all created pages to any user?
I am stuck at this wall and any help would be appreciated!
At the time of page create with the form that you mentioned, if the user is logged in, you will want to store the user ID as a foreign key in your page Model. Then when you go to display created pages for a specific user, you just follow the relationship.
This was posted a long time ago, so you will probably just want to use this Django App as it solves all of this for you, in one beautiful package:
https://github.com/benjaoming/django-wiki
Have you seen the tutorial here? http://showmedo.com/videotutorials/video?name=1100000 I built a wiki with that tutorial - I think even if it doesn't answer your question may still point you in the right direction. Hope it helps!
精彩评论